Update to 2.0.10

use phpunit6 when available
skip tests with PHPUnit < 4.8.35 (EPEL-6)

(cherry picked from commit 39d5bd939c)
This commit is contained in:
Remi Collet 2018-02-20 08:32:12 +01:00
commit 04a8db852c
3 changed files with 28 additions and 13 deletions

1
.gitignore vendored
View file

@ -8,3 +8,4 @@ clog
/php-phpseclib-2.0.6-34a7699.tgz
/php-phpseclib-2.0.7-f4b6a52.tgz
/php-phpseclib-2.0.9-c9a3fe3.tgz
/php-phpseclib-2.0.10-d305b78.tgz

View file

@ -3,18 +3,17 @@
%global github_owner phpseclib
%global github_name phpseclib
%global github_commit c9a3fe35e20eb6eeaca716d6a23cde03f52d1558
%global github_commit d305b780829ea4252ed9400b3f5937c2c99b51d4
%global github_short %(c=%{github_commit}; echo ${c:0:7})
%global with_tests 0%{!?_without_tests:1}
Name: php-%{composer_vendor}
Version: 2.0.9
Version: 2.0.10
Release: 1%{?dist}
Summary: PHP Secure Communications Library
Group: System Environment/Libraries
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{name}-%{version}-%{github_short}.tgz
Source1: %{name}-autoload.php
# Generate a full archive from git snapshot, with tests
@ -24,7 +23,12 @@ BuildArch: noarch
%if %{with_tests}
BuildRequires: php-composer(fedora/autoloader)
BuildRequires: %{_bindir}/phpunit
%if 0%{?fedora} >= 26
%global phpunit %{_bindir}/phpunit6
%else
%global phpunit %{_bindir}/phpunit
%endif
BuildRequires: %{phpunit}
BuildRequires: %{_bindir}/phpab
# Optional at runtime, to avoid too muck skipped tests
BuildRequires: php-bcmath
@ -75,13 +79,18 @@ date_default_timezone_set('UTC');
EOF
ret=0
for cmd in php php70 php71 php72; do
if which $cmd; then
$cmd %{_bindir}/phpunit || ret=1
fi
done
exit $ret
if php %{phpunit} --atleast-version 4.8.35; then
ret=0
for cmd in "php %{phpunit}" php70 php71 php72; do
if which $cmd; then
set $cmd
$1 -d memory_limit=1G ${2:-%{_bindir}/phpunit6} --verbose || ret=1
fi
done
exit $ret
else
: Skip test as PHPUnit is too old
fi
%endif
@ -93,6 +102,11 @@ exit $ret
%changelog
* Tue Feb 20 2018 Remi Collet <remi@remirepo.net> - 2.0.10-1
- Update to 2.0.10
- use phpunit6 when available
- skip tests with PHPUnit < 4.8.35 (EPEL-6)
* Wed Nov 29 2017 Remi Collet <remi@remirepo.net> - 2.0.9-1
- Update to 2.0.9

View file

@ -1 +1 @@
SHA512 (php-phpseclib-2.0.9-c9a3fe3.tgz) = a139cb0eb19e45f5159fa5f767ac1534665eccbf476cb5ea67f3b10aa1b5d29dcf08517e659275673547472899238b1bfe6dc2e610a2cbe6bc23eb2b2cadcf8b
SHA512 (php-phpseclib-2.0.10-d305b78.tgz) = e11f37c320f458c77d77e34c35c59cb3e93100cff4a46d327de8d9a1a34b6da1a7e303b61d9ed7a734a8ace50859abf7301828b3b099b3a7c0c83ce8c09aa629