From 9c349070cfd9ba396cd4c93f215e0cd66d810ea8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 3 May 2018 09:57:54 +0200 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-tag.spec | 51 ++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 21 deletions(-) (limited to 'php-zendframework-zend-tag.spec') diff --git a/php-zendframework-zend-tag.spec b/php-zendframework-zend-tag.spec index 1021b7f..ce3f8b5 100644 --- a/php-zendframework-zend-tag.spec +++ b/php-zendframework-zend-tag.spec @@ -1,6 +1,6 @@ # remirepo/Fedora spec file for php-zendframework-zend-tag # -# Copyright (c) 2015-2017 Remi Collet +# Copyright (c) 2015-2018 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -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 @@ -36,17 +36,17 @@ BuildArch: noarch BuildRequires: php(language) >= 5.5 BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-escaper) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 +BuildRequires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 # From composer, "require-dev": { # "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", # "fabpot/php-cs-fixer": "1.7.*", # "phpunit/PHPUnit": "~4.0" -BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 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", @@ -54,16 +54,18 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-stdlib": "^2.7 || ^3.0" Requires: php(language) >= 5.5 %if ! %{bootstrap} -Requires: php-composer(%{gh_owner}/zend-escaper) >= 2.5 -Requires: php-composer(%{gh_owner}/zend-escaper) < 3 -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.5 +Requires: php-autoloader(%{gh_owner}/zend-escaper) < 3 +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}/servicemanager) +Suggests: php-autoloader(%{gh_owner}/servicemanager) %endif %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.1 Requires: php-pcre Requires: php-spl @@ -71,6 +73,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 @@ -90,7 +93,16 @@ 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/Escaper/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Zend/ServiceManager/autoload.php', +]); +EOF %install @@ -103,14 +115,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 @@ -134,6 +140,9 @@ exit $ret %changelog +* Wed Dec 6 2017 Remi Collet - 2.6.1-4 +- switch from zend-loader to fedora/autoloader + * Thu Feb 4 2016 Remi Collet - 2.6.1-1 - update to 2.6.1 - raise dependency on PHP >= 5.5 -- cgit