From c54e94d87910e59bb5138293f19f9067103bd8fa Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 13 Dec 2017 11:09:19 +0100 Subject: switch from zend-loader to fedora/autoloader --- ...ndframework-zend-mvc-plugin-flashmessenger.spec | 56 +++++++++++----------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/php-zendframework-zend-mvc-plugin-flashmessenger.spec b/php-zendframework-zend-mvc-plugin-flashmessenger.spec index 8551534..d1c481c 100644 --- a/php-zendframework-zend-mvc-plugin-flashmessenger.spec +++ b/php-zendframework-zend-mvc-plugin-flashmessenger.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 1.0.0 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework Mvc-Plugin-%{library} component Group: Development/Libraries @@ -34,19 +34,17 @@ BuildArch: noarch # Tests %if %{with_tests} BuildRequires: php(language) >= 5.6 -BuildRequires: php-composer(%{gh_owner}/zend-mvc) >= 3.0 -BuildRequires: php-composer(%{gh_owner}/zend-session) >= 2.6.2 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-mvc) >= 3.0 +BuildRequires: php-autoloader(%{gh_owner}/zend-session) >= 2.6.2 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7.5 BuildRequires: php-spl # From composer, "require-dev": { # "phpunit/PHPUnit": "^4.5", # "squizlabs/php_codesniffer": "^2.3.1" BuildRequires: php-composer(phpunit/phpunit) >= 4.5 -BuildRequires: php-composer(%{gh_owner}/zend-filter) >= 2.6.1 -BuildRequires: php-composer(%{gh_owner}/zend-form) >= 2.7 -# 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", @@ -54,20 +52,19 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-session": "^2.6.2", # "zendframework/zend-stdlib": "^2.7 || ^3.0" Requires: php(language) >= 5.6 -Requires: php-composer(%{gh_owner}/zend-mvc) >= 3.0 -Requires: php-composer(%{gh_owner}/zend-mvc) < 4 -Requires: php-composer(%{gh_owner}/zend-session) >= 2.6.2 -Requires: php-composer(%{gh_owner}/zend-session) < 3 -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-mvc) >= 3.0 +Requires: php-autoloader(%{gh_owner}/zend-mvc) < 4 +Requires: php-autoloader(%{gh_owner}/zend-session) >= 2.6.2 +Requires: php-autoloader(%{gh_owner}/zend-session) < 3 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 1.0.0 Requires: php-spl -%if ! %{bootstrap} -# Autoloader -Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5 -%endif Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -90,7 +87,15 @@ 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/Mvc/autoload.php', + '%{php_home}/Zend/Session/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', +]); +EOF %install @@ -103,14 +108,8 @@ cp -pr src %{buildroot}%{php_home}/Zend/Mvc/Plugin/%{library} mkdir vendor cat << 'EOF' | tee vendor/autoload.php array( - 'namespaces' => array( - 'ZendTest\\Mvc\\Plugin\\%{library}' => dirname(__DIR__).'/test/', - 'Zend\\Mvc\\Plugin\\%{library}' => '%{buildroot}%{php_home}/Zend/Mvc/Plugin/%{library}' -)))); -require_once '%{php_home}/Zend/autoload.php'; +require_once '%{buildroot}%{php_home}/Zend/Mvc/Plugin/%{library}/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\Mvc\\Plugin\\%{library}\\', dirname(__DIR__) . '/test'); EOF ret=0 @@ -134,6 +133,9 @@ exit $ret %changelog +* Wed Dec 13 2017 Remi Collet - 1.0.0-4 +- switch from zend-loader to fedora/autoloader + * Wed Jun 29 2016 Remi Collet - 1.0.0-1 - initial package -- cgit