From 2a652359a2338e205660c2b7bde8d9a4c95a95ee Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 23 Jan 2018 08:17:08 +0100 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-inputfilter.spec | 56 +++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/php-zendframework-zend-inputfilter.spec b/php-zendframework-zend-inputfilter.spec index b3c4a6a..fbc9322 100644 --- a/php-zendframework-zend-inputfilter.spec +++ b/php-zendframework-zend-inputfilter.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.8.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -35,23 +35,23 @@ BuildArch: noarch %if %{with_tests} BuildRequires: php(language) >= 5.6 BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-filter) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.10.1 +BuildRequires: php-autoloader(%{gh_owner}/zend-filter) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.10.1 # From composer, "require-dev": { # "phpunit/phpunit": "^5.7.23 || ^6.4.3", # "zendframework/zend-coding-standard": "~1.0.0", # "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" -BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 %if 0%{?fedora} >= 26 %global phpunit %{_bindir}/phpunit6 %else %global phpunit %{_bindir}/phpunit %endif BuildRequires: %{phpunit} -# 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", @@ -60,24 +60,27 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-validator": "^2.10.1", Requires: php(language) >= 5.6 %if ! %{bootstrap} -Requires: php-composer(%{gh_owner}/zend-filter) >= 2.6 -Requires: php-composer(%{gh_owner}/zend-filter) < 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.10.1 -Requires: php-composer(%{gh_owner}/zend-validator) < 3 +Requires: php-autoloader(%{gh_owner}/zend-filter) >= 2.6 +Requires: php-autoloader(%{gh_owner}/zend-filter) < 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.10.1 +Requires: php-autoloader(%{gh_owner}/zend-validator) < 3 # From composer, "suggest": { # "zendframework/zend-servicemanager": "To support plugin manager support" %if 0%{?fedora} >= 21 -Suggests: php-composer(%{gh_owner}/zend-servicemanager) +Suggests: php-autoloader(%{gh_owner}/zend-servicemanager) %endif %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.5 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 @@ -95,7 +98,17 @@ mv LICENSE.md LICENSE %build -# Empty build section, nothing required +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/Stdlib/autoload.php', + '%{php_home}/Zend/Validator/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Zend/ServiceManager/autoload.php', +]); +EOF %install @@ -108,14 +121,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 # https://github.com/zendframework/zend-inputfilter/pull/141 @@ -142,6 +149,9 @@ exit $ret %changelog +* Thu Dec 7 2017 Remi Collet - 2.8.0-2 +- switch from zend-loader to fedora/autoloader + * Tue Dec 5 2017 Remi Collet - 2.8.0-1 - Update to 2.8.0 - raise dependency on zend-validator 2.10.1 -- cgit