From 3557ed1526b380f16b08579a3c3e6b534137edea Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 11 Aug 2020 08:53:00 +0200 Subject: switch to phpunit9 --- php-phar-io-version3.spec | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'php-phar-io-version3.spec') diff --git a/php-phar-io-version3.spec b/php-phar-io-version3.spec index 64b61f2..83b7a39 100644 --- a/php-phar-io-version3.spec +++ b/php-phar-io-version3.spec @@ -6,7 +6,13 @@ # # Please, preserve the changelog entries # -%global bootstrap 0 +%bcond_with bootstrap +%if %{with bootstrap} +%bcond_with tests +%else +%bcond_without tests +%endif + %global gh_commit c6bb6825def89e0a32220f88337f8ceaf1975fa0 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phar-io @@ -17,15 +23,10 @@ %global ns_project Version %global major 3 %global php_home %{_datadir}/php -%if %{bootstrap} -%bcond_with tests -%else -%bcond_without tests -%endif Name: php-%{pk_vendor}-%{pk_project}%{major} Version: 3.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library for handling version information and constraints License: BSD @@ -39,11 +40,16 @@ BuildRequires: php-pcre BuildRequires: php-spl BuildRequires: php-fedora-autoloader-devel >= 1.0.0 %if %{with tests} -BuildRequires: phpunit8 +%if 0%{?fedora} >= 32 +%global phpunit %{_bindir}/phpunit9 +%else +%global phpunit %{_bindir}/phpunit8 +%endif +BuildRequires: %{phpunit} %endif # from composer.json -# "php": "^7.2" +# "php": "^7.2 || ^8.0", Requires: php(language) >= 7.2 # from phpcompatinfo report for version 3.0.0 Requires: php-pcre @@ -79,10 +85,12 @@ cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major} : Run upstream test suite ret=0 BS=%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php -for cmd in php php72 php73 php74 php80; do +for cmd in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do if which $cmd; then - $cmd -d auto_prepend_file=$BS \ - %{_bindir}/phpunit8 --bootstrap $BS --verbose || ret=1 + set $cmd + $1 -d auto_prepend_file=$BS \ + ${2:-%{_bindir}/phpunit9} \ + --bootstrap $BS --verbose || ret=1 fi done exit $ret @@ -100,6 +108,9 @@ exit $ret %changelog +* Mon Aug 11 2020 Remi Collet - 3.0.2-2 +- switch to phpunit9 + * Mon Jun 29 2020 Remi Collet - 3.0.2-1 - update to 3.0.2 (no change) - sources from git snapshot -- cgit