From 834e935b68e85a672783a0e40df6c636afbd83b0 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 5 Dec 2017 16:04:23 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-server.spec | 43 ++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/php-zendframework-zend-server.spec b/php-zendframework-zend-server.spec index cc3f284..f83d5c4 100644 --- a/php-zendframework-zend-server.spec +++ b/php-zendframework-zend-server.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.7.0 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -37,15 +37,15 @@ BuildRequires: php(language) >= 5.6 BuildRequires: php-pcre BuildRequires: php-spl BuildRequires: php-reflection -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-code) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-code) >= 2.5 # From composer, "require-dev": { # "phpunit/phpUnit": "^4.8", # "squizlabs/php_codesniffer": "^2.3.1" BuildRequires: php-composer(phpunit/phpunit) >= 4.8 -# Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "^5.6 || ^7.0", @@ -53,11 +53,13 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-code": "^2.5 || ^3.0" Requires: php(language) >= 5.6 %if ! %{bootstrap} -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 -Requires: php-composer(%{gh_owner}/zend-code) >= 2.5 -Requires: php-composer(%{gh_owner}/zend-code) < 4 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.5 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-code) >= 2.5 +Requires: php-autoloader(%{gh_owner}/zend-code) < 4 %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.6.0 Requires: php-pcre Requires: php-reflection @@ -66,6 +68,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 @@ -85,7 +88,14 @@ 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', + '%{php_home}/Zend/Code/autoload.php', +]); +EOF %install @@ -98,14 +108,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'); require_once 'test/TestAsset/reflectionTestFunction.php'; EOF @@ -130,6 +134,9 @@ exit $ret %changelog +* Thu Nov 23 2017 Remi Collet - 2.7.0-4 +- switch from zend-loader to fedora/autoloader + * Tue Jun 21 2016 Remi Collet - 2.7.0-1 - update to 2.7.0 - raise dependency on PHP 5.6 -- cgit