diff --git a/.gitignore b/.gitignore index 4634a21..4bf7bcf 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,7 @@ clog /php-phpspec-prophecy-1.10.3-451c3cd.tgz /php-phpspec-prophecy-1.11.0-8ff0384.tgz /php-phpspec-prophecy-1.11.1-b20034b.tgz +/php-phpspec-prophecy-1.12.0-765cd5d.tgz +/php-phpspec-prophecy-1.12.1-8ce8751.tgz +/php-phpspec-prophecy-1.12.2-245710e.tgz +/php-phpspec-prophecy-1.13.0-be1996e.tgz diff --git a/php-phpspec-prophecy-autoload.php b/php-phpspec-prophecy-autoload.php deleted file mode 100644 index dfb7e08..0000000 --- a/php-phpspec-prophecy-autoload.php +++ /dev/null @@ -1,27 +0,0 @@ -= 7.2 %if %{with tests} -BuildRequires: (php-composer(phpdocumentor/reflection-docblock) >= 5.0 with php-composer(phpdocumentor/reflection-docblock) < 6) +BuildRequires: (php-composer(phpdocumentor/reflection-docblock) >= 5.2 with php-composer(phpdocumentor/reflection-docblock) < 6) BuildRequires: (php-composer(sebastian/comparator) >= 3.0 with php-composer(sebastian/comparator) < 5) BuildRequires: (php-composer(sebastian/recursion-context) >= 3.0 with php-composer(sebastian/recursion-context) < 5) BuildRequires: (php-composer(doctrine/instantiator) >= 1.2 with php-composer(doctrine/instantiator) < 2) # from composer.json, "require-dev": { # "phpspec/phpspec": "^6.0" -# "phpunit/phpunit": "^8.0" +# "phpunit/phpunit": "^8.0 || ^9.0" BuildRequires: php-composer(phpspec/phpspec) >= 6.0 -BuildRequires: phpunit8 +%if 0%{?fedora} >= 32 || 0%{?rhel} >=9 +%global phpunit %{_bindir}/phpunit9 +%else +%global phpunit %{_bindir}/phpunit8 +%endif +BuildRequires: %{phpunit} %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # from composer.json, "requires": { -# "php": "^5.3|^7.0", -# "phpdocumentor/reflection-docblock": "^5.0", +# "php": "^7.2 || ~8.0, <8.1", +# "phpdocumentor/reflection-docblock": "^5.2", # "sebastian/comparator": "^3.0|^4.0", # "doctrine/instantiator": "^1.2", # "sebastian/recursion-context": "^3.0|^4.0" Requires: php(language) >= 7.2 -Requires: (php-composer(phpdocumentor/reflection-docblock) >= 5.0 with php-composer(phpdocumentor/reflection-docblock) < 6) +Requires: (php-composer(phpdocumentor/reflection-docblock) >= 5.2 with php-composer(phpdocumentor/reflection-docblock) < 6) Requires: (php-composer(sebastian/comparator) >= 3.0 with php-composer(sebastian/comparator) < 5) Requires: (php-composer(sebastian/recursion-context) >= 3.0 with php-composer(sebastian/recursion-context) < 5) Requires: (php-composer(doctrine/instantiator) >= 1.2 with php-composer(doctrine/instantiator) < 2) @@ -79,11 +76,32 @@ to be used inside any testing framework out there with minimal effort. %prep %setup -q -n %{gh_project}-%{gh_commit} -cp %{SOURCE1} src/Prophecy/autoload.php - %build -# Nothing +phpab --template fedora --output src/Prophecy/autoload.php src +cat << 'EOF' | tee -a src/Prophecy/autoload.php + +\Fedora\Autoloader\Dependencies::required([ + '%{_datadir}/php/Doctrine/Instantiator/autoload.php', + '%{_datadir}/php/phpDocumentor/Reflection/DocBlock5/autoload.php', +]); +if (!class_exists('SebastianBergmann\\Comparator\\Comparator')) { // v2 from phpunit, v1 from phpspec + \Fedora\Autoloader\Dependencies::required([ + [ + '%{_datadir}/php/SebastianBergmann/Comparator4/autoload.php', + '%{_datadir}/php/SebastianBergmann/Comparator3/autoload.php', + ], + ]); +} +if (!class_exists('SebastianBergmann\\RecursionContext\\Context')) { // v2 from phpunit, v1 from phpspec + \Fedora\Autoloader\Dependencies::required([ + [ + '%{_datadir}/php/SebastianBergmann/RecursionContext4/autoload.php', + '%{_datadir}/php/SebastianBergmann/RecursionContext3/autoload.php', + ], + ]); +} +EOF %install @@ -108,15 +126,14 @@ php %{buildroot}%{_datadir}/php/Prophecy/autoload.php phpspec --version ret=0 -for cmd in php php72 php73 php74; do - if which $cmd; then - $cmd -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ - -d auto_prepend_file=vendor/autoload.php \ +for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do + if which $cmdarg; then + set $cmdarg + $1 -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpspec run --format pretty --verbose --no-ansi || ret=1 - $cmd -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ - -d auto_prepend_file=vendor/autoload.php \ - %{_bindir}/phpunit8 || ret=1 + $1 -d auto_prepend_file=vendor/autoload.php \ + ${2:-%{_bindir}/phpunit9}|| ret=1 fi done exit $ret @@ -133,6 +150,23 @@ exit $ret %changelog +* Thu Mar 18 2021 Remi Collet - 1.13.0-1 +- update to 1.13.0 + +* Mon Dec 21 2020 Remi Collet - 1.12.2-1 +- update to 1.12.2 +- switch to phpunit9 + +* Tue Sep 29 2020 Remi Collet - 1.12.1-1 +- update to 1.12.1 + +* Mon Sep 28 2020 Remi Collet - 1.12.0-2 +- switch to classmap autoloader + +* Mon Sep 28 2020 Remi Collet - 1.12.0-1 +- update to 1.12.0 +- raise dependency on phpdocumentor/reflection-docblock 5.2 + * Wed Jul 8 2020 Remi Collet - 1.11.1-1 - update to 1.11.1 diff --git a/sources b/sources index 6c9e620..b1188a8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-phpspec-prophecy-1.11.1-b20034b.tgz) = 934ae0ae780651d31434118601610b6030b40a5d871a950601946fa4610273e9faf3dd955670fe79e7be86f6ab1636fe7ee08c51915455edb4322607cf4f87d9 +SHA512 (php-phpspec-prophecy-1.13.0-be1996e.tgz) = 12b80dbfe9bdbe54935eb25ad039d698ac1538dd5a6c30a3799df1aa3c761bdfcf2d8e8091a7c88eb8233af403d62e082373b3bbec19951b1432e0305aa5f037