diff options
author | Remi Collet <remi@remirepo.net> | 2017-12-07 15:25:41 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-12-07 15:25:41 +0100 |
commit | 40958b853da0ad05226a2c605b714505cf0888db (patch) | |
tree | 5c36940d6c8816eca6df450c60e1c8a2692e0659 | |
parent | dc7f3de243563bf02ca8b2ecc6455c9157d04329 (diff) |
switch from zend-loader to fedora/autoloader
run PDF tests
-rw-r--r-- | php-zendframework-zend-barcode.spec | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/php-zendframework-zend-barcode.spec b/php-zendframework-zend-barcode.spec index e8fbe76..2cd21e2 100644 --- a/php-zendframework-zend-barcode.spec +++ b/php-zendframework-zend-barcode.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.6.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -41,20 +41,22 @@ BuildRequires: php-gd BuildRequires: php-iconv BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 -BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.5 # From composer, "require-dev": { # "zendframework/zend-config": "^2.6", # "zendframework/zendpdf": "*", # "fabpot/php-cs-fixer": "1.7.*", # "phpunit/PHPUnit": "~4.0" -BuildRequires: php-composer(%{gh_owner}/zend-config) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-config) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zendpdf) BuildRequires: php-composer(phpunit/phpunit) >= 4.0 -# Ommit zendpdf because of build order # Autoloader BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "^5.5 || ^7.0", @@ -63,18 +65,20 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" Requires: php(language) >= 5.5 %if ! %{bootstrap} -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-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 -Requires: php-composer(%{gh_owner}/zend-servicemanager) < 4 +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 +Requires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 +Requires: php-autoloader(%{gh_owner}/zend-servicemanager) < 4 # From composer, "suggest": { # "zendframework/zendpdf": "ZendPdf component" %if 0%{?fedora} >= 21 -Suggests: php-composer(%{gh_owner}/zendpdf) +Suggests: php-autoloader(%{gh_owner}/zendpdf) %endif %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.6.0 Requires: php-dom Requires: php-gd @@ -85,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 @@ -104,7 +109,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/Stdlib/autoload.php', + '%{php_home}/Zend/Validator/autoload.php', + '%{php_home}/Zend/ServiceManager/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/ZendPdf/autoload.php', +]); +EOF %install @@ -117,20 +132,18 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library} mkdir vendor cat << 'EOF' | tee vendor/autoload.php <?php -require_once '%{php_home}/Zend/Loader/AutoloaderFactory.php'; -Zend\Loader\AutoloaderFactory::factory(array( - 'Zend\Loader\StandardAutoloader' => 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\Dependencies::required([ + '%{php_home}/Zend/Config/autoload.php', +]); +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); EOF +export TESTS_ZEND_BARCODE_PDF_SUPPORT=1 ret=0 for cmd in php php56 php70 php71 php72; do if which $cmd; then - $cmd %{_bindir}/phpunit || ret=1 + $cmd %{_bindir}/phpunit --verbose || ret=1 fi done exit $ret @@ -148,6 +161,10 @@ exit $ret %changelog +* Thu Dec 7 2017 Remi Collet <remi@remirepo.net> - 2.6.0-5 +- switch from zend-loader to fedora/autoloader +- run PDF tests + * Fri Oct 20 2017 Remi Collet <remi@fedoraproject.org> - 2.6.0-4 - fix FTBFS from Koschei, add patch for PHP 7.2 from https://github.com/zendframework/zend-barcode/pull/36 |