diff options
-rw-r--r-- | composer.json | 11 | ||||
-rw-r--r-- | php-laminas-servicemanager-rpm.patch | 21 | ||||
-rw-r--r-- | php-laminas-servicemanager.spec | 30 |
3 files changed, 46 insertions, 16 deletions
diff --git a/composer.json b/composer.json index 0582510..289670d 100644 --- a/composer.json +++ b/composer.json @@ -26,21 +26,18 @@ }, "sort-packages": true, "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true, - "composer/package-versions-deprecated": true, - "laminas/laminas-dependency-plugin": true + "dealerdirect/phpcodesniffer-composer-installer": true } }, "require": { "php": "~7.4.0 || ~8.0.0 || ~8.1.0", + "composer-plugin-api": "^2.0", "laminas/laminas-stdlib": "^3.2.1", - "psr/container": "^1.0" + "psr/container": "^1.1 || ^2.0.2" }, "require-dev": { - "composer/package-versions-deprecated": "^1.0", "laminas/laminas-coding-standard": "~2.3.0", "laminas/laminas-container-config-test": "^0.6", - "laminas/laminas-dependency-plugin": "^2.1.2", "mikey179/vfsstream": "^1.6.10@alpha", "ocramius/proxy-manager": "^2.11", "phpbench/phpbench": "^1.1", @@ -50,7 +47,7 @@ "vimeo/psalm": "^4.8" }, "provide": { - "psr/container-implementation": "^1.0" + "psr/container-implementation": "^1.1 || ^2.0" }, "conflict": { "ext-psr": "*", diff --git a/php-laminas-servicemanager-rpm.patch b/php-laminas-servicemanager-rpm.patch new file mode 100644 index 0000000..ec77e06 --- /dev/null +++ b/php-laminas-servicemanager-rpm.patch @@ -0,0 +1,21 @@ +diff -up ./src/autoload.php.rpm ./src/autoload.php +--- ./src/autoload.php.rpm 2022-07-19 07:14:45.761379036 +0200 ++++ ./src/autoload.php 2022-07-19 07:16:56.028221222 +0200 +@@ -5,7 +5,6 @@ declare(strict_types=1); + + namespace Laminas\ServiceManager; + +-use Composer\InstalledVersions; + use Interop\Container\Containerinterface as InteropContainerInterface; + use Interop\Container\Exception\ContainerException as InteropContainerException; + use Interop\Container\Exception\NotFoundException as InteropNotFoundException; +@@ -28,7 +27,8 @@ if (! interface_exists(InteropNotFoundEx + class_alias(NotFoundExceptionInterface::class, InteropNotFoundException::class); + } + +-$installedContainerVersion = InstalledVersions::getVersion('psr/container'); ++$a=new \ReflectionMethod('Psr\\Container\\ContainerInterface', 'has'); ++$installedContainerVersion = ($a->hasReturnType() ? '2' : '1'); + + assert( + $installedContainerVersion !== null, diff --git a/php-laminas-servicemanager.spec b/php-laminas-servicemanager.spec index ad0eb17..6e66814 100644 --- a/php-laminas-servicemanager.spec +++ b/php-laminas-servicemanager.spec @@ -7,7 +7,7 @@ # Please, preserve the changelog entries # %global bootstrap 0 -%global gh_commit 918de970b2c3d42acebff3d431d76db52b6a32a2 +%global gh_commit 65910ef6a8066b0369fab77fbec9e030be59c866 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner laminas %global gh_project laminas-servicemanager @@ -22,7 +22,7 @@ %endif Name: php-%{gh_project} -Version: 3.14.0 +Version: 3.15.0 Release: 1%{?dist} Summary: Laminas Framework %{library} component @@ -31,6 +31,9 @@ URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh +# drop Composer\InstalledVersions usage +Patch0: %{name}-rpm.patch + BuildArch: noarch # Tests %if %{with_tests} @@ -38,7 +41,7 @@ BuildRequires: php(language) >= 7. # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-composer(%{gh_owner}/laminas-zendframework-bridge) < 2) -BuildRequires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2) +BuildRequires: (php-composer(psr/container) >= 1.1 with php-composer(psr/container) < 3) BuildRequires: (php-autoloader(%{gh_owner}/laminas-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/laminas-stdlib) < 4) # remirepo:5 %else @@ -51,10 +54,8 @@ BuildRequires: php-date BuildRequires: php-json BuildRequires: php-spl # From composer, "require-dev": { -# "composer/package-versions-deprecated": "^1.0", # "laminas/laminas-coding-standard": "~2.3.0", # "laminas/laminas-container-config-test": "^0.6", -# "laminas/laminas-dependency-plugin": "^2.1.2", # "mikey179/vfsstream": "^1.6.10@alpha", # "ocramius/proxy-manager": "^2.11", # "phpbench/phpbench": "^1.1", @@ -83,14 +84,15 @@ BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "~7.4.0 || ~8.0.0 || ~8.1.0", +# "composer-plugin-api": "^2.0", # "laminas/laminas-stdlib": "^3.2.1", -# "psr/container": "^1.0" +# "psr/container": "^1.1 || ^2.0.2" Requires: php(language) >= 7.4 # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-autoloader(%{gh_owner}/laminas-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/laminas-stdlib) < 4) +Requires: (php-autoloader(%{gh_owner}/laminas-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/laminas-stdlib) < 4) Requires: (php-composer(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-composer(%{gh_owner}/laminas-zendframework-bridge) < 2) -Requires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2) +Requires: (php-composer(psr/container) >= 1.1 with php-composer(psr/container) < 3) # remirepo:5 %else Requires: php-laminas-stdlib >= 3.2.1 @@ -128,6 +130,7 @@ Provides: php-composer(zendframework/%{zf_name}) = %{version} Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} Provides: php-autoloader(zendframework/%{zf_name}) = %{version} Provides: php-composer(psr/container-implementation) = 1.0 +Provides: php-composer(psr/container-implementation) = 2.0 %description @@ -140,6 +143,8 @@ Documentation: https://docs.laminas.dev/%{gh_project}/ %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 + mv src/autoload.php src/_autoload.php mv LICENSE.md LICENSE @@ -149,7 +154,10 @@ mv LICENSE.md LICENSE phpab --template fedora --output src/autoload.php src cat << 'EOF' | tee -a src/autoload.php \Fedora\Autoloader\Dependencies::required([ - '%{php_home}/Psr/Container/autoload.php', + [ + '%{php_home}/Psr/Container2/autoload.php', + '%{php_home}/Psr/Container/autoload.php', + ], '%{php_home}/%{namespace}/Stdlib/autoload.php', __DIR__ . '/_autoload.php', ]); @@ -225,6 +233,10 @@ exit $ret %changelog +* Tue Jul 19 2022 Remi Collet <remi@remirepo.net> - 3.15.0-1 +- update to 3.15.0 +- raise dependency on psr/container 1.1 and allow version 2 + * Fri Jul 8 2022 Remi Collet <remi@remirepo.net> - 3.14.0-1 - update to 3.14.0 |