From c8397e95db54ae256c345c8bfe479b343081e77b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 13 Dec 2017 11:05:44 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-mvc-plugin-fileprg.spec | 84 ++++++++++++++------------ 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/php-zendframework-zend-mvc-plugin-fileprg.spec b/php-zendframework-zend-mvc-plugin-fileprg.spec index 0c707c6..bce6df5 100644 --- a/php-zendframework-zend-mvc-plugin-fileprg.spec +++ b/php-zendframework-zend-mvc-plugin-fileprg.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,23 +34,21 @@ BuildArch: noarch # Tests %if %{with_tests} BuildRequires: php(language) >= 5.6 -BuildRequires: php-composer(%{gh_owner}/zend-filter) >= 2.6.1 -BuildRequires: php-composer(%{gh_owner}/zend-form) >= 2.7 -BuildRequires: php-composer(%{gh_owner}/zend-inputfilter) >= 2.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-composer(%{gh_owner}/zend-validator) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-filter) >= 2.6.1 +BuildRequires: php-autoloader(%{gh_owner}/zend-form) >= 2.7 +BuildRequires: php-autoloader(%{gh_owner}/zend-inputfilter) >= 2.6 +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-autoloader(%{gh_owner}/zend-validator) >= 2.6 BuildRequires: php-reflection # 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", @@ -62,28 +60,27 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-stdlib": "^2.7 || ^3.0", # "zendframework/zend-validator": "^2.6" Requires: php(language) >= 5.6 -Requires: php-composer(%{gh_owner}/zend-filter) >= 2.6.1 -Requires: php-composer(%{gh_owner}/zend-filter) < 3 -Requires: php-composer(%{gh_owner}/zend-form) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-form) < 3 -Requires: php-composer(%{gh_owner}/zend-inputfilter) >= 2.6 -Requires: php-composer(%{gh_owner}/zend-inputfilter) < 3 -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-composer(%{gh_owner}/zend-validator) >= 2.6 -Requires: php-composer(%{gh_owner}/zend-validator) < 3 +Requires: php-autoloader(%{gh_owner}/zend-filter) >= 2.6.1 +Requires: php-autoloader(%{gh_owner}/zend-filter) < 3 +Requires: php-autoloader(%{gh_owner}/zend-form) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-form) < 3 +Requires: php-autoloader(%{gh_owner}/zend-inputfilter) >= 2.6 +Requires: php-autoloader(%{gh_owner}/zend-inputfilter) < 3 +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 +Requires: php-autoloader(%{gh_owner}/zend-validator) >= 2.6 +Requires: php-autoloader(%{gh_owner}/zend-validator) < 3 +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 1.0.0 Requires: php-reflection -%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 @@ -103,7 +100,19 @@ 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/Filter/autoload.php', + '%{php_home}/Zend/Form/autoload.php', + '%{php_home}/Zend/InputFilter/autoload.php', + '%{php_home}/Zend/Mvc/autoload.php', + '%{php_home}/Zend/Session/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', + '%{php_home}/Zend/Validator/autoload.php', +]); +EOF %install @@ -116,14 +125,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 @@ -147,6 +150,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