From 8e8ec21028c3f7a7e8ad880fa881fce1e385b0d9 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 5 Dec 2017 11:03:39 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-di.spec | 50 ++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 19 deletions(-) (limited to 'php-zendframework-zend-di.spec') diff --git a/php-zendframework-zend-di.spec b/php-zendframework-zend-di.spec index efa85b9..0799453 100644 --- a/php-zendframework-zend-di.spec +++ b/php-zendframework-zend-di.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.6.1 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -37,16 +37,17 @@ BuildRequires: php(language) >= 5.3.23 BuildRequires: php-reflection BuildRequires: php-pcre BuildRequires: php-spl +BuildRequires: php-composer(container-interop/container-interop) < 2 BuildRequires: php-composer(container-interop/container-interop) >= 1.1 -BuildRequires: php-composer(%{gh_owner}/zend-code) >= 2.6 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 +BuildRequires: php-autoloader(%{gh_owner}/zend-code) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 # From composer, "require-dev": { # "fabpot/php-cs-fixer": "1.7.*", # "phpunit/PHPUnit": "~4.0" BuildRequires: php-composer(phpunit/phpunit) >= 4.0 -# Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "^5.5 || ^7.0", @@ -57,16 +58,18 @@ Requires: php(language) >= 5.3.23 %if ! %{bootstrap} Requires: php-composer(container-interop/container-interop) >= 1.1 Requires: php-composer(container-interop/container-interop) < 2 -Requires: php-composer(%{gh_owner}/zend-code) >= 2.6 -Requires: php-composer(%{gh_owner}/zend-code) < 4 -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-code) >= 2.6 +Requires: php-autoloader(%{gh_owner}/zend-code) < 4 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 # From composer, "suggest": { # "zendframework/zend-servicemanager": "Zend\\ServiceManager component" %if 0%{?fedora} >= 21 -Suggests: php-composer(%{gh_owner}/zend-servicemanager) +Suggests: php-autoloader(%{gh_owner}/zend-servicemanager) %endif %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.2 Requires: php-reflection Requires: php-pcre @@ -75,6 +78,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 @@ -93,7 +97,18 @@ mv LICENSE.md LICENSE %build -# Empty build section, nothing required +: Create autoloader +phpab --template fedora --output src/autoload.php src +cat << 'EOF' | tee -a src/autoload.php +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/Interop/Container/autoload.php', + '%{php_home}/Zend/Code/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Zend/ServiceManager/autoload.php', +]); +EOF %install @@ -106,14 +121,8 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library} 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\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); EOF ret=0 @@ -137,6 +146,9 @@ exit $ret %changelog +* Tue Dec 5 2017 Remi Collet - 2.6.1-4 +- switch from zend-loader to fedora/autoloader + * Tue Apr 26 2016 Remi Collet - 2.6.1-1 - update to 2.6.1 -- cgit