From 02e15f903c54c9ced34c5c644285adadd0a12948 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 6 Dec 2017 12:14:37 +0100 Subject: use fedora/autoloader --- php-zendframework-zend-loader.spec | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/php-zendframework-zend-loader.spec b/php-zendframework-zend-loader.spec index d841a71..ed3842f 100644 --- a/php-zendframework-zend-loader.spec +++ b/php-zendframework-zend-loader.spec @@ -16,7 +16,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.5.1 -Release: 4%{?dist} +Release: 7%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -25,17 +25,20 @@ URL: https://zendframework.github.io/%{gh_project}/ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz Source1: %{name}-autoload.php -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch # Tests %if %{with_tests} BuildRequires: php(language) >= 5.3.23 BuildRequires: php-cli %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": ">=5.3.23" Requires: php(language) >= 5.3.23 +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.1 Requires: php-pcre Requires: php-spl @@ -43,6 +46,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 @@ -61,12 +65,11 @@ mv LICENSE.md LICENSE %build -# Empty build section, nothing required +: Create autoloader +phpab --template fedora --output src/autoload.php src %install -rm -rf %{buildroot} - mkdir -p %{buildroot}%{php_home}/Zend install -pm 644 %{SOURCE1} %{buildroot}%{php_home}/Zend/autoload.php @@ -75,21 +78,22 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library} %check %if %{with_tests} +: Deprecated autoloader %{_bindir}/php -r ' require "%{buildroot}%{php_home}/Zend/autoload.php"; exit (class_exists("Zend\\Loader\\PluginClassLoader" ? 0 : 1)); ' +: New autoloader +%{_bindir}/php -r ' + require "%{buildroot}%{php_home}/Zend/%{library}/autoload.php"; + exit (class_exists("Zend\\Loader\\PluginClassLoader" ? 0 : 1)); +' %else : Test suite disabled %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md @@ -100,6 +104,9 @@ rm -rf %{buildroot} %changelog +* Wed Dec 6 2017 Remi Collet - 2.5.1-7 +- use fedora/autoloader + * Sat Jul 2 2016 Remi Collet - 2.5.1-4 - load container-interop and psr/http-message when present -- cgit