From e7df0e981fcb1e4280b1c39191cc636984aca451 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 11 Dec 2017 09:57:31 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-captcha.spec | 71 +++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/php-zendframework-zend-captcha.spec b/php-zendframework-zend-captcha.spec index ac6416a..a1705ea 100644 --- a/php-zendframework-zend-captcha.spec +++ b/php-zendframework-zend-captcha.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.7.1 -Release: 1%{?dist} +Release: 3%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -37,8 +37,8 @@ BuildRequires: php(language) >= 5.6 BuildRequires: php-date BuildRequires: php-gd BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-math) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-math) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.5 # From composer, "require-dev": { # "zendframework/zend-session": "^2.6", # "zendframework/zend-text": "^2.6", @@ -46,15 +46,14 @@ BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5 # "zendframework/zendservice-recaptcha": "^3.0", # "zendframework/zend-coding-standard": "~1.0.0", # "phpunit/PHPUnit": "~4.8" -BuildRequires: php-composer(%{gh_owner}/zend-session) >= 2.6 -BuildRequires: php-composer(%{gh_owner}/zend-text) >= 2.6 -BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.6 -# remirepo:1 -BuildRequires: php-composer(%{gh_owner}/zendservice-recaptcha) >= 3.0 +BuildRequires: php-autoloader(%{gh_owner}/zend-session) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-text) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zendservice-recaptcha) >= 3.0 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", @@ -62,10 +61,10 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-stdlib": "^2.7 || ^3.0" Requires: php(language) >= 5.6 %if ! %{bootstrap} -Requires: php-composer(%{gh_owner}/zend-math) >= 2.6 -Requires: php-composer(%{gh_owner}/zend-math) < 4 -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-math) >= 2.6 +Requires: php-autoloader(%{gh_owner}/zend-math) < 4 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 # From composer, "suggest": { # "zendframework/zend-i18n-resources": "Translations of captcha messages", # "zendframework/zend-session": "Zend\\Session component", @@ -73,13 +72,15 @@ Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 # "zendframework/zend-validator": "Zend\\Validator component", # "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha component" %if 0%{?fedora} >= 21 -Suggests: php-composer(%{gh_owner}/zend-i18n-resources) -Suggests: php-composer(%{gh_owner}/zend-session) -Suggests: php-composer(%{gh_owner}/zend-text) -Suggests: php-composer(%{gh_owner}/zend-validator) -Suggests: php-composer(%{gh_owner}/zendservice-recaptcha) +Suggests: php-autoloader(%{gh_owner}/zend-i18n-resources) +Suggests: php-autoloader(%{gh_owner}/zend-session) +Suggests: php-autoloader(%{gh_owner}/zend-text) +Suggests: php-autoloader(%{gh_owner}/zend-validator) +Suggests: php-autoloader(%{gh_owner}/zendservice-recaptcha) %endif %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.2 Requires: php-date Requires: php-gd @@ -88,6 +89,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 @@ -108,7 +110,21 @@ 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/Math/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Zend/I18n/Translator/autoload.php', + '%{php_home}/Zend/Session/autoload.php', + '%{php_home}/Zend/Text/autoload.php', + '%{php_home}/Zend/Validator/autoload.php', + '%{php_home}/ZendService/ReCaptcha/autoload.php', +]); +EOF %install @@ -121,16 +137,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'; -# remirepo:1 -require_once '%{php_home}/ZendService/ReCaptcha/autoload.php'; +require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); EOF ret=0 @@ -154,6 +162,9 @@ exit $ret %changelog +* Mon Dec 11 2017 Remi Collet - 2.7.1-3 +- switch from zend-loader to fedora/autoloader + * Thu Feb 23 2017 Remi Collet - 2.7.1-1 - update to 2.7.1 -- cgit