diff options
Diffstat (limited to 'php-league-container4.spec')
-rw-r--r-- | php-league-container4.spec | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/php-league-container4.spec b/php-league-container4.spec index 6b94cd6..e4bf24e 100644 --- a/php-league-container4.spec +++ b/php-league-container4.spec @@ -12,27 +12,29 @@ %global github_owner thephpleague %global github_name container -%global github_version 3.4.1 -%global github_commit 84ecbc2dbecc31bd23faf759a0e329ee49abddbd +%global github_version 4.1.2 +%global github_commit 82a57588c630663d2600f046753b23ab6dcda9b5 + +%global major 4 %global composer_vendor league %global composer_project container -# "php": "^7.0" -%global php_min_ver 7.0 -# "psr/container": "^1.0.0" -%global psr_container_min_ver 1.0 -%global psr_container_max_ver 2 +# "php": "^7.2 || ^8.0" +%global php_min_ver 7.2 +# "psr/container": "^2.0.0" +%global psr_container_min_ver 2.0.0 +%global psr_container_max_ver 3 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} %{!?phpdir: %global phpdir %{_datadir}/php} -Name: php-%{composer_vendor}-%{composer_project} +Name: php-%{composer_vendor}-%{composer_project}%{major} Version: %{github_version} Release: 1%{?github_release}%{?dist} -Summary: A fast and intuitive dependency injection container +Summary: A fast and intuitive dependency injection container version %{major} License: MIT URL: http://container.thephpleague.com/ @@ -47,7 +49,7 @@ BuildArch: noarch %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: phpunit8 +BuildRequires: phpunit8 >= 8.5.17 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(psr/container) >= %{psr_container_min_ver} with php-composer(psr/container) < %{psr_container_max_ver}) %else @@ -83,7 +85,7 @@ Provides: php-composer(psr/container-implementation) = 1.0 A small but powerful dependency injection container that allows you to decouple components in your application in order to write clean and testable code. -Autoloader: %{phpdir}/League/Container/autoload.php +Autoloader: %{phpdir}/League/Container%{major}/autoload.php %prep @@ -103,14 +105,14 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('League\\Container\\', __DIR__); \Fedora\Autoloader\Dependencies::required([ - '%{phpdir}/Psr/Container/autoload.php', + '%{phpdir}/Psr/Container2/autoload.php', ]); AUTOLOAD %install mkdir -p %{buildroot}%{phpdir}/League -cp -rp src %{buildroot}%{phpdir}/League/Container +cp -rp src %{buildroot}%{phpdir}/League/Container%{major} %check @@ -118,8 +120,9 @@ cp -rp src %{buildroot}%{phpdir}/League/Container : Create tests bootstrap cat <<'BOOTSTRAP' | tee bootstrap.php <?php -require '%{buildroot}%{phpdir}/League/Container/autoload.php'; +require '%{buildroot}%{phpdir}/League/Container%{major}/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('League\\Container\\Test\\', __DIR__.'/tests'); +require __DIR__ . '/tests/Asset/function.php'; BOOTSTRAP : cleanup for phpunit8/9 @@ -127,10 +130,18 @@ sed -e '/log/d' -i phpunit.xml : Upstream tests RETURN_CODE=0 +# TODO PHP 8.1, Call to undefined method ReflectionUnionType::getName() PHPUNIT=$(which phpunit8) -for PHP_EXEC in php php73 php74 php80; do - if [ "php" = "$PHP_EXEC" ] || which $PHP_EXEC; then - $PHP_EXEC $PHPUNIT --bootstrap bootstrap.php --verbose || RETURN_CODE=1 +for PHP_EXEC in php php73 php74 php80 php81; do + if which $PHP_EXEC; then + FILTER="" + VER=$($PHP_EXEC -r 'echo PHP_VERSION_ID;') + if [ $VER -ge 80100 ]; then + FILTER="--filter '^((?!(testResolverResolvesArgumentsViaReflection|testResolverThrowsExceptionWhenReflectionDoesNotResolve)).)*\$'" + fi + $PHP_EXEC $PHPUNIT $FILTER \ + --bootstrap bootstrap.php \ + --verbose || RETURN_CODE=1 fi done exit $RETURN_CODE @@ -147,11 +158,18 @@ exit $RETURN_CODE %doc CONTRIBUTING.md %doc README.md %dir %{phpdir}/League - %{phpdir}/League/Container + %{phpdir}/League/Container%{major} %changelog * Fri Jul 9 2021 Remi Collet <remi@remirepo.net> - 3.4.1-1 +- update to 4.1.2 +- rename to php-league-container4 +- install in /usr/share/php/League/Container4 +- raise dependency on PHP 7.2 +- raise dependency on psr/container 2.0.0 + +* Fri Jul 9 2021 Remi Collet <remi@remirepo.net> - 3.4.1-1 - update to 3.4.1 - revert allow psr/container v2 |