From c4ec4b391f70ebbca351de2731dab792ec3f1bb8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 9 Dec 2017 10:03:55 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-psr7bridge.spec | 44 ++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 18 deletions(-) (limited to 'php-zendframework-zend-psr7bridge.spec') diff --git a/php-zendframework-zend-psr7bridge.spec b/php-zendframework-zend-psr7bridge.spec index d7b6f39..7377005 100644 --- a/php-zendframework-zend-psr7bridge.spec +++ b/php-zendframework-zend-psr7bridge.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 0.2.2 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -38,16 +38,16 @@ BuildRequires: php-reflection BuildRequires: php-intl BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-http) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-http) >= 2.5 BuildRequires: php-composer(psr/http-message) >= 1.0 -BuildRequires: php-composer(%{gh_owner}/zend-diactoros) >= 1.1 +BuildRequires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.1 # From composer, "require-dev": { # "phpunit/phpunit": "^4.7", # "squizlabs/php_codesniffer": "^2.3" BuildRequires: php-composer(phpunit/phpunit) >= 4.7 -# Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": ">=5.5", @@ -56,16 +56,19 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-diactoros": "^1.1" Requires: php(language) >= 5.5 %if ! %{bootstrap} -Requires: php-composer(%{gh_owner}/zend-http) >= 2.5 -Requires: php-composer(%{gh_owner}/zend-http) < 3 +Requires: php-autoloader(%{gh_owner}/zend-http) >= 2.5 +Requires: php-autoloader(%{gh_owner}/zend-http) < 3 Requires: php-composer(psr/http-message) >= 1.0 Requires: php-composer(psr/http-message) < 2 -Requires: php-composer(%{gh_owner}/zend-diactoros) >= 1.1 -Requires: php-composer(%{gh_owner}/zend-diactoros) < 2 +Requires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.1 +Requires: php-autoloader(%{gh_owner}/zend-diactoros) < 2 %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 0.2.1 => Nothing Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -81,7 +84,15 @@ 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/Http/autoload.php', + '%{php_home}/Psr/Http/Message/autoload.php', + '%{php_home}/Zend/Diactoros/autoload.php', +]); +EOF %install @@ -94,14 +105,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 @@ -125,6 +130,9 @@ exit $ret %changelog +* Sat Dec 9 2017 Remi Collet - 0.2.2-4 +- switch from zend-loader to fedora/autoloader + * Wed May 11 2016 Remi Collet - 0.2.2-1 - update to 0.2.2 -- cgit