diff options
| author | Remi Collet <remi@remirepo.net> | 2017-12-12 09:58:28 +0100 | 
|---|---|---|
| committer | Remi Collet <remi@remirepo.net> | 2017-12-12 09:58:28 +0100 | 
| commit | 3d2442fd9d28399d76d785373d61c16a4d25c1d3 (patch) | |
| tree | 44c8aa20aaf2e45b66fef482d5829429c563134a | |
| parent | 51dad2e81e9395766a4d4281110a1ab8388d33f8 (diff) | |
switch from zend-loader to fedora/autoloader
fix FTBFS from Koschei, ignore 1 test, reported as https://github.com/zendframework/zend-mail/issues/183
| -rw-r--r-- | php-zendframework-zend-mail.spec | 79 | 
1 files changed, 49 insertions, 30 deletions
| diff --git a/php-zendframework-zend-mail.spec b/php-zendframework-zend-mail.spec index 4734ace..ea2c0ab 100644 --- a/php-zendframework-zend-mail.spec +++ b/php-zendframework-zend-mail.spec @@ -21,7 +21,7 @@  Name:           php-%{gh_owner}-%{gh_project}  Version:        2.8.0 -Release:        3%{?dist} +Release:        4%{?dist}  Summary:        Zend Framework %{library} component  Group:          Development/Libraries @@ -41,28 +41,27 @@ BuildRequires:  php-date  BuildRequires:  php-iconv  BuildRequires:  php-pcre  BuildRequires:  php-spl -BuildRequires:  php-composer(%{gh_owner}/zend-loader)           >= 2.5 -BuildRequires:  php-composer(%{gh_owner}/zend-mime)             >= 2.5 -BuildRequires:  php-composer(%{gh_owner}/zend-stdlib)           >= 2.7 -BuildRequires:  php-composer(%{gh_owner}/zend-validator)        >= 2.6 +BuildRequires:  php-autoloader(%{gh_owner}/zend-loader)         >= 2.5 +BuildRequires:  php-autoloader(%{gh_owner}/zend-mime)           >= 2.5 +BuildRequires:  php-autoloader(%{gh_owner}/zend-stdlib)         >= 2.7 +BuildRequires:  php-autoloader(%{gh_owner}/zend-validator)      >= 2.6  # From composer, "require-dev": {  #        "zendframework/zend-config": "^2.6",  #        "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",  #        "zendframework/zend-crypt": "^2.6",  #        "phpunit/phpunit": "^6.0.8 || ^5.7.15",  #        "zendframework/zend-coding-standard": "~1.0.0" -BuildRequires:  php-composer(%{gh_owner}/zend-config)           >= 2.6 -BuildRequires:  php-composer(%{gh_owner}/zend-servicemanager)   >= 2.7.5 -BuildRequires:  php-composer(%{gh_owner}/zend-crypt)            >= 2.6 +BuildRequires:  php-autoloader(%{gh_owner}/zend-config)         >= 2.6 +BuildRequires:  php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 +BuildRequires:  php-autoloader(%{gh_owner}/zend-crypt)          >= 2.6  %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 +BuildRequires:  php-fedora-autoloader-devel  # From composer, "require": {  #        "php": "^7.0 || ^5.6", @@ -74,24 +73,26 @@ BuildRequires:  php-composer(%{gh_owner}/zend-loader)           >= 2.5  Requires:       php(language) >= 5.6  Requires:       php-iconv  %if ! %{bootstrap} -Requires:       php-composer(%{gh_owner}/zend-loader)           >= 2.5 -Requires:       php-composer(%{gh_owner}/zend-loader)           <  3 -Requires:       php-composer(%{gh_owner}/zend-mime)             >= 2.5 -Requires:       php-composer(%{gh_owner}/zend-mime)             <  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.6 -Requires:       php-composer(%{gh_owner}/zend-validator)        <  3 +Requires:       php-autoloader(%{gh_owner}/zend-loader)         >= 2.5 +Requires:       php-autoloader(%{gh_owner}/zend-loader)         <  3 +Requires:       php-autoloader(%{gh_owner}/zend-mime)           >= 2.5 +Requires:       php-autoloader(%{gh_owner}/zend-mime)           <  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.6 +Requires:       php-autoloader(%{gh_owner}/zend-validator)      <  3  # From composer, "suggest": {  #        "ext-intl": "Handle IDN in AddressList hostnames",  #        "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3 when using SMTP to deliver messages"  #        "zendframework/zend-crypt": "^2.6",  %if 0%{?fedora} >= 21  Suggests:       php-intl -Suggests:       php-composer(%{gh_owner}/zend-servicemanager) -Suggests:       php-composer(%{gh_owner}/zend-crypt) +Suggests:       php-autoloader(%{gh_owner}/zend-servicemanager) +Suggests:       php-autoloader(%{gh_owner}/zend-crypt)  %endif  %endif +# Autoloader +Requires:       php-composer(fedora/autoloader)  # From phpcompatinfo report for version 2.8.0  Requires:       php-ctype  Requires:       php-date @@ -101,6 +102,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 @@ -121,7 +123,20 @@ mv LICENSE.md LICENSE  %build -# Empty build section, nothing required +: Create autoloader +phpab --template fedora --output src/autoload.php src +cat << 'EOF' | tee -a src/autoload.php +\Fedora\Autoloader\Dependencies::required([ +    '%{php_home}/Zend/Loader/autoload.php', +    '%{php_home}/Zend/Mime/autoload.php', +    '%{php_home}/Zend/Stdlib/autoload.php', +    '%{php_home}/Zend/Validator/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ +    '%{php_home}/Zend/ServiceManager/autoload.php', +    '%{php_home}/Zend/Crypt/autoload.php', +]); +EOF  %install @@ -134,21 +149,20 @@ 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  ret=0  for cmd in "php %{phpunit}" "php56 %{_bindir}/phpunit" php70 php71 php72; do    if which $cmd; then      set $cmd -    $1 ${2:-%{_bindir}/phpunit6} --verbose || ret=1 +    $1 ${2:-%{_bindir}/phpunit6} \ +      --filter '^((?!(testCanBeEncoded)).)*$' \ +      --verbose || ret=1    fi  done  exit $ret @@ -166,6 +180,11 @@ exit $ret  %changelog +* Tue Dec 12 2017 Remi Collet <remi@remirepo.net> - 2.8.0-4 +- switch from zend-loader to fedora/autoloader +- fix FTBFS from Koschei, ignore 1 test, reported as +  https://github.com/zendframework/zend-mail/issues/183 +  * Fri Oct 20 2017 Remi Collet <remi@remirepo.net> - 2.8.0-3  - fix FTBFS from Koschei  - add patch for latest PHPUnit from | 
