From 7e1a3c4ed3a221b68c8cc37d0c2c25b1e981bba7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 24 Nov 2017 07:22:53 +0100 Subject: switch from zend-loader to fedora/autoloader --- .gitignore | 8 +++++ php-zendframework-zend-math.spec | 73 +++++++++++++++------------------------- 2 files changed, 36 insertions(+), 45 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/php-zendframework-zend-math.spec b/php-zendframework-zend-math.spec index 08e12ee..791e883 100644 --- a/php-zendframework-zend-math.spec +++ b/php-zendframework-zend-math.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 3.0.0 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -30,7 +30,6 @@ URL: https://zendframework.github.io/%{gh_project}/ Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch # Tests %if %{with_tests} @@ -40,19 +39,17 @@ BuildRequires: php-gmp BuildRequires: php-openssl BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-composer(paragonie/random_compat) +BuildRequires: php-composer(paragonie/random_compat) < 3 +BuildRequires: php-composer(paragonie/random_compat) >= 2.0.2 # test suite hangs without (need investigation) BuildRequires: php-mcrypt # From composer, "require-dev": { # "fabpot/php-cs-fixer": "1.7.*", # "phpunit/PHPUnit": "~4.0", -# "zendframework/zend-servicemanager": "~2.5" BuildRequires: php-composer(ircmaxell/random-lib) >= 1.1 BuildRequires: php-composer(phpunit/phpunit) >= 4.0 # Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 -# For dependencies autoloader -BuildRequires: php-zendframework-zend-loader >= 2.5.1-3 +BuildRequires: php-fedora-autoloader-devel %endif # From composer, "require": { @@ -61,13 +58,12 @@ BuildRequires: php-zendframework-zend-loader >= 2.5.1-3 # "paragonie/random_compat": "^2.0.2" Requires: php(language) >= 5.5 Requires: php-mbstring -# ignore min version -Requires: php-composer(paragonie/random_compat) +Requires: php-composer(paragonie/random_compat) < 3 +Requires: php-composer(paragonie/random_compat) >= 2.0.2 # From phpcompatinfo report for version 2.5.2 Requires: php-openssl Requires: php-pcre Requires: php-spl -Requires: php-zendframework-zend-loader >= 2.5.1-3 %if ! %{bootstrap} # From composer, "suggest": { # "ext-bcmath": "If using the bcmath functionality", @@ -75,12 +71,13 @@ Requires: php-zendframework-zend-loader >= 2.5.1-3 Requires: php-bcmath Requires: php-gmp # Autoloader -Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5 +Requires: php-composer(fedora/autoloader) %endif 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 @@ -97,20 +94,24 @@ Documentation: https://zendframework.github.io/%{gh_project}/ mv LICENSE.md LICENSE -: Create dependency autoloader +%build +: Create dependency autoloader - deprecated cat << 'EOF' | tee 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 -# remirepo:11 -run=0 ret=0 -if which php56; then - php56 %{_bindir}/phpunit --include-path=%{buildroot}%{php_home} || ret=1 - run=1 -fi -if which php71; then - php71 %{_bindir}/phpunit --include-path=%{buildroot}%{php_home} || ret=1 - run=1 -fi -if [ $run -eq 0 ]; then -%{_bindir}/phpunit --include-path=%{buildroot}%{php_home} --verbose -# remirepo:2 -fi +for cmd in php php56 php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose || ret=1 + fi +done exit $ret %else : Test suite disabled %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md %doc composer.json +%dir %{php_home}/Zend %{php_home}/Zend/%{library} %{php_home}/Zend/%{library}-autoload.php %changelog +* Thu Nov 23 2017 Remi Collet - 3.0.0-4 +- switch from zend-loader to fedora/autoloader + * Wed Jun 29 2016 Remi Collet - 3.0.0-1 - update to 3.0.0 for ZendFramework 3 - add dependencies autoloader -- cgit