From 5a7e3703b3d4c0255f02abe5328c6178c59a2589 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 11 Dec 2017 09:16:57 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-session.spec | 79 ++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/php-zendframework-zend-session.spec b/php-zendframework-zend-session.spec index 132a387..12e3e28 100644 --- a/php-zendframework-zend-session.spec +++ b/php-zendframework-zend-session.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.8.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -39,8 +39,8 @@ BuildRequires: php-hash BuildRequires: php-pcre BuildRequires: php-session BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-eventmanager) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-eventmanager) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.5 # From composer, "require-dev": { # "container-interop/container-interop": "^1.1", # "mongodb/mongodb": "^1.0.1", @@ -59,14 +59,14 @@ BuildRequires: php-composer(container-interop/container-interop) >= 1.1 BuildRequires: php-composer(php-mock/php-mock-phpunit) < 2 BuildRequires: php-composer(php-mock/php-mock-phpunit) >= 1.1.2 BuildRequires: php-composer(phpunit/phpunit) >= 5.7.15 -BuildRequires: php-composer(%{gh_owner}/zend-cache) >= 2.6.1 -BuildRequires: php-composer(%{gh_owner}/zend-db) >= 2.7 -BuildRequires: php-composer(%{gh_owner}/zend-http) >= 2.5.4 -BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 -BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.6 -# Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-cache) >= 2.6.1 +BuildRequires: php-autoloader(%{gh_owner}/zend-db) >= 2.7 +BuildRequires: php-autoloader(%{gh_owner}/zend-http) >= 2.5.4 +BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.6 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "^5.6 || ^7.0", @@ -74,10 +74,10 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-stdlib": "^2.7 || ^3.0" Requires: php(language) >= 5.6 %if ! %{bootstrap} -Requires: php-composer(%{gh_owner}/zend-eventmanager) >= 2.6.2 -Requires: php-composer(%{gh_owner}/zend-eventmanager) < 4 -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-eventmanager) >= 2.6.2 +Requires: php-autoloader(%{gh_owner}/zend-eventmanager) < 4 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 # From composer, "suggest": { # "mongodb/mongodb": "If you want to use the MongoDB session save handler" # "zendframework/zend-cache": "Zend\\Cache component", @@ -87,13 +87,15 @@ Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 # "zendframework/zend-validator": "Zend\\Validator component" %if 0%{?fedora} >= 21 Suggests: php-composer(mongodb/mongodb) -Suggests: php-composer(%{gh_owner}/zend-cache) -Suggests: php-composer(%{gh_owner}/zend-db) -Suggests: php-composer(%{gh_owner}/zend-http) -Suggests: php-composer(%{gh_owner}/zend-servicemanager) -Suggests: php-composer(%{gh_owner}/zend-validator) +Suggests: php-autoloader(%{gh_owner}/zend-cache) +Suggests: php-autoloader(%{gh_owner}/zend-db) +Suggests: php-autoloader(%{gh_owner}/zend-http) +Suggests: php-autoloader(%{gh_owner}/zend-servicemanager) +Suggests: php-autoloader(%{gh_owner}/zend-validator) %endif %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.8.0 Requires: php-date Requires: php-hash @@ -104,6 +106,7 @@ Requires: php-spl Obsoletes: php-ZendFramework2-%{library} < 2.5 Provides: php-ZendFramework2-%{library} = %{version} Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -116,11 +119,26 @@ Documentation: https://zendframework.github.io/%{gh_project}/ %prep %setup -q -n %{gh_project}-%{gh_commit} +mv LICENSE.md LICENSE -%build -# Empty build section, nothing required -mv LICENSE.md LICENSE +%build +: Generate autoloader +phpab --template fedora --output src/autoload.php src +cat << 'EOF' | tee -a src/autoload.php +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/Zend/EventManager/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/MongoDB/autoload.php', + '%{php_home}/Zend/Cache/autoload.php', + '%{php_home}/Zend/Db/autoload.php', + '%{php_home}/Zend/Http/autoload.php', + '%{php_home}/Zend/ServiceManager/autoload.php', + '%{php_home}/Zend/Validator/autoload.php', +]); +EOF %install @@ -136,15 +154,11 @@ rm test/SaveHandler/MongoDBTest.php mkdir vendor cat << 'EOF' | tee vendor/autoload.php array( - 'namespaces' => array( - 'ZendTest\\%{library}' => dirname(__DIR__).'/test/', - 'Zend\\%{library}' => '%{buildroot}%{php_home}/Zend/%{library}' -)))); -require_once '%{php_home}/Zend/autoload.php'; +require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php'; +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/phpmock/autoload.php', +]); +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); require_once __DIR__ . '/../test/autoload.php'; EOF @@ -169,6 +183,9 @@ exit $ret %changelog +* Mon Dec 11 2017 Remi Collet - 2.8.3-2 +- switch from zend-loader to fedora/autoloader + * Mon Dec 4 2017 Remi Collet - 2.8.3-1 - Update to 2.8.3 -- cgit