From f65108b70eb902edf662d910d23188abaa356122 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 11 Dec 2017 10:03:08 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-progressbar.spec | 48 ++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/php-zendframework-zend-progressbar.spec b/php-zendframework-zend-progressbar.spec index 758e0b1..96d32a0 100644 --- a/php-zendframework-zend-progressbar.spec +++ b/php-zendframework-zend-progressbar.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.5.2 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -37,34 +37,36 @@ BuildRequires: php(language) >= 5.5 BuildRequires: php-date 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": { # "zendframework/zend-json": "^2.6.1", # "zendframework/zend-session": "^2.6.2", # "fabpot/php-cs-fixer": "1.7.*", # "phpunit/PHPUnit": "~4.0" -BuildRequires: php-composer(%{gh_owner}/zend-json) >= 2.6.1 -BuildRequires: php-composer(%{gh_owner}/zend-session) >= 2.6.2 +BuildRequires: php-autoloader(%{gh_owner}/zend-json) >= 2.6.1 +BuildRequires: php-autoloader(%{gh_owner}/zend-session) >= 2.6.2 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", # "zendframework/zend-stdlib": "^2.7 || ^3.0" 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-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 # From composer, "suggest": { # "zendframework/zend-json": "Zend\\Json component", # "zendframework/zend-session": "To support progressbar persistent" %if 0%{?fedora} >= 21 -Suggests: php-composer(%{gh_owner}/zend-json) -Suggests: php-composer(%{gh_owner}/zend-session) +Suggests: php-autoloader(%{gh_owner}/zend-json) +Suggests: php-autoloader(%{gh_owner}/zend-session) %endif %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.1 Requires: php-date Requires: php-pcre @@ -74,6 +76,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 @@ -94,7 +97,17 @@ mv LICENSE.md LICENSE %build -# Empty build section, nothing required +: Generate 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/Json/autoload.php', + '%{php_home}/Zend/Session/autoload.php', +]); +EOF %install @@ -107,14 +120,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 @@ -138,6 +145,9 @@ exit $ret %changelog +* Mon Dec 11 2017 Remi Collet - 2.5.2-4 +- switch from zend-loader to fedora/autoloader + * Wed Mar 2 2016 Remi Collet - 2.5.2-1 - update to 2.5.2 - raise dependency on PHP >= 5.5 -- cgit