From 4c75e50d8de345a1975f2248c3863395a00b99b8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 24 Nov 2017 09:30:57 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-i18n.spec | 53 +++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/php-zendframework-zend-i18n.spec b/php-zendframework-zend-i18n.spec index 0b275e8..3a931d3 100644 --- a/php-zendframework-zend-i18n.spec +++ b/php-zendframework-zend-i18n.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.7.4 -Release: 1%{?dist} +Release: 3%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -39,7 +39,7 @@ BuildRequires: php-date BuildRequires: php-intl BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 # From composer, "require-dev": { # "phpunit/PHPUnit": "^6.0.8 || ^5.7.15", # "zendframework/zend-cache": "^2.6.1", @@ -65,6 +65,7 @@ BuildRequires: php-composer(%{gh_owner}/zend-view) >= 2.6.3 BuildRequires: %{phpunit} # Autoloader BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 +BuildRequires: php-fedora-autoloader-devel %endif # From composer, "require": { @@ -72,8 +73,8 @@ 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-stdlib) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 # From composer, "suggest": { # "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", # "zendframework/zend-cache": "Zend\\Cache component", @@ -101,10 +102,13 @@ Requires: php-ctype Requires: php-date Requires: php-pcre Requires: php-spl +# Autoloader +Requires: php-composer(fedora/autoloader) 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 @@ -127,7 +131,23 @@ 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}/Zend/Stdlib/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Zend/Cache/autoload.php', + '%{php_home}/Zend/Config/autoload.php', + '%{php_home}/Zend/EventManager/autoload.php', + '%{php_home}/Zend/Filter/autoload.php', + '%{php_home}/Zend/ServiceManager/autoload.php', + '%{php_home}/Zend/Validator/autoload.php', + '%{php_home}/Zend/View/autoload.php', + '%{php_home}/Zend/I18n/Translator/Resources.php', +]); +EOF %install @@ -137,22 +157,18 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library} %check %if %{with_tests} -%if 0%{?fedora} >= 24 - # See https://github.com/zendframework/zend-i18n/issues/14 - sed -e '/de_AT/d' -i test/View/Helper/CurrencyFormatTest.php -%endif +# See https://github.com/zendframework/zend-i18n/issues/14 +sed -e '/de_AT/d' -i test/View/Helper/CurrencyFormatTest.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'; +# For BR without new autoloader +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/Zend/autoload.php', +]); +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); EOF ret=0 @@ -177,6 +193,9 @@ exit $ret %changelog +* Fri Nov 24 2017 Remi Collet - 2.7.4-3 +- switch from zend-loader to fedora/autoloader + * Mon May 22 2017 Remi Collet - 2.7.4-1 - Update to 2.7.4 - raise dependency on PHP 5.6 -- cgit