From aa00830565df58c4020557775e6e9edbb4817304 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 11 Dec 2017 14:53:36 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-expressive-zendrouter.spec | 71 ++++++++++++----------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/php-zendframework-zend-expressive-zendrouter.spec b/php-zendframework-zend-expressive-zendrouter.spec index 7673a45..a60af67 100644 --- a/php-zendframework-zend-expressive-zendrouter.spec +++ b/php-zendframework-zend-expressive-zendrouter.spec @@ -22,7 +22,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.0.1 -Release: 1%{?dist} +Release: 3%{?dist} Summary: zend-mvc router support for %{library} Group: Development/Libraries @@ -36,8 +36,8 @@ BuildArch: noarch %if %{with_tests} BuildRequires: php(language) >= 5.6 BuildRequires: php-composer(psr/http-message) >= 1.0 -BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 2.0 -BuildRequires: php-composer(%{gh_owner}/zend-router) >= 3.0 +BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 2.0 +BuildRequires: php-autoloader(%{gh_owner}/zend-router) >= 3.0 BuildRequires: php-composer(%{gh_owner}/zend-psr7bridge) >= 0.2.2 BuildRequires: php-composer(fig/http-message-util) >= 1.1 BuildRequires: php-pcre @@ -47,12 +47,10 @@ BuildRequires: php-pcre # "malukenho/docheader": "^0.1.5", # "zendframework/zend-i18n": "^2.7" BuildRequires: php-composer(phpunit/phpunit) >= 4.8 -BuildRequires: php-composer(%{gh_owner}/zend-i18n) >= 2.7 -# Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 -# For dependencies autoloader -BuildRequires: php-zendframework-zend-loader >= 2.5.1-4 +BuildRequires: php-autoloader(%{gh_owner}/zend-i18n) >= 2.7 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "^5.6 || ^7.0", @@ -64,22 +62,20 @@ BuildRequires: php-zendframework-zend-loader >= 2.5.1-4 Requires: php(language) >= 5.6 Requires: php-composer(psr/http-message) >= 1.0 Requires: php-composer(psr/http-message) < 2 -Requires: php-composer(%{gh_owner}/zend-expressive-router) >= 2.0 -Requires: php-composer(%{gh_owner}/zend-expressive-router) < 3 -Requires: php-composer(%{gh_owner}/zend-router) >= 3.0 -Requires: php-composer(%{gh_owner}/zend-router) < 4 -Requires: php-composer(%{gh_owner}/zend-psr7bridge) >= 0.2.2 +Requires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 2.0 +Requires: php-autoloader(%{gh_owner}/zend-expressive-router) < 3 +Requires: php-autoloader(%{gh_owner}/zend-router) >= 3.0 +Requires: php-autoloader(%{gh_owner}/zend-router) < 4 +Requires: php-autoloader(%{gh_owner}/zend-psr7bridge) >= 0.2.2 Requires: php-composer(fig/http-message-util) >= 1.1 Requires: php-composer(fig/http-message-util) < 2 +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 1.2.0 Requires: php-pcre -%if ! %{bootstrap} -# Autoloader -Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5 -Requires: php-zendframework-zend-loader >= 2.5.1-4 -%endif Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -94,15 +90,25 @@ https://zendframework.github.io/zend-expressive/features/router/zf2/ mv LICENSE.md LICENSE -: Create dependency autoloader + +%build +: Create dependency autoloader - deprecated cat << 'EOF' | tee autoload.php array( - 'namespaces' => array( - 'ZendTest\\%{library}\\%{sublib}' => dirname(__DIR__).'/test/', - 'Zend\\%{library}\\%{sublib}' => '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}' -)))); -require_once '%{php_home}/Zend/autoload.php'; +require_once '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}/zendrouter-autoload.php'; +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/Zend/I18n/autoload.php', +]); +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\%{sublib}', dirname(__DIR__) . '/test'); EOF ret=0 @@ -146,11 +147,15 @@ exit $ret %license LICENSE %doc *.md %doc composer.json -%{php_home}/Zend/%{library}/%{sublib}/Zend* +%{php_home}/Zend/%{library}/%{sublib}/ZendRouter* +%{php_home}/Zend/%{library}/%{sublib}/zendrouter* %{php_home}/Zend/%{library}-%{sublib}-zendrouter-autoload.php %changelog +* Mon Dec 11 2017 Remi Collet - 2.0.1-3 +- switch from zend-loader to fedora/autoloader + * Thu Mar 2 2017 Remi Collet - 2.0.1-1 - update to 2.0.1 -- cgit