From 4ddbda1731988364cf40578b237f72581cb2df35 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 9 Dec 2017 09:10:24 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-text.spec | 47 ++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'php-zendframework-zend-text.spec') diff --git a/php-zendframework-zend-text.spec b/php-zendframework-zend-text.spec index 7810c1f..1d6913c 100644 --- a/php-zendframework-zend-text.spec +++ b/php-zendframework-zend-text.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.6.0 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -37,17 +37,17 @@ BuildRequires: php(language) >= 5.3.23 BuildRequires: php-ctype BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.5 # From composer, "require-dev": { # "fabpot/php-cs-fixer": "1.7.*", # "phpunit/PHPUnit": "~4.0", # "zendframework/zend-config": "^2.6" -BuildRequires: php-composer(%{gh_owner}/zend-config) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-config) >= 2.6 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", @@ -55,11 +55,13 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" Requires: php(language) >= 5.5 %if ! %{bootstrap} -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 -Requires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 -Requires: php-composer(%{gh_owner}/zend-servicemanager) < 4 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 +Requires: php-autoloader(%{gh_owner}/zend-servicemanager) < 4 %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.1 Requires: php-ctype Requires: php-pcre @@ -68,6 +70,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 @@ -95,7 +98,13 @@ mv LICENSE.md LICENSE %build -# Empty build section, nothing required +phpab --template fedora --output src/autoload.php src +cat << 'EOF' | tee -a src/autoload.php +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/Zend/Stdlib/autoload.php', + '%{php_home}/Zend/ServiceManager/autoload.php', +]); +EOF %install @@ -108,14 +117,11 @@ 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\Dependencies::required([ + '%{php_home}/Zend/Config/autoload.php', +]); +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); EOF ret=0 @@ -139,6 +145,9 @@ exit $ret %changelog +* Thu Dec 7 2017 Remi Collet - 2.6.0-4 +- switch from zend-loader to fedora/autoloader + * Fri Feb 12 2016 Remi Collet - 2.6.0-1 - update to 2.6.0 - raise dependency on PHP >= 5.5 -- cgit