diff options
author | Remi Collet <remi@remirepo.net> | 2017-12-09 15:53:00 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-12-09 15:53:00 +0100 |
commit | 9d1f60731de610987803d8f791638c98607d05af (patch) | |
tree | f0f08c4a7a42304219a364ac1902b13b39a5e2b5 | |
parent | 496a0e0b023c1e014b2773fc4c8c3623edf5796c (diff) |
switch from zend-loader to fedora/autoloader
-rw-r--r-- | php-zendframework-zend-router.spec | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/php-zendframework-zend-router.spec b/php-zendframework-zend-router.spec index 0ebc104..40d0adc 100644 --- a/php-zendframework-zend-router.spec +++ b/php-zendframework-zend-router.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 3.0.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -39,19 +39,19 @@ BuildRequires: php(language) >= 5.5 BuildRequires: php-pcre BuildRequires: php-spl BuildRequires: php-composer(container-interop/container-interop) >= 1.1 -BuildRequires: php-composer(%{gh_owner}/zend-http) >= 2.5 -BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-http) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7.5 # From composer, "require-dev": { # "zendframework/zend-i18n": "^2.6", # "squizlabs/php_codesniffer": "^2.3", # "phpunit/phpunit": "^4.5", # "sebastian/version": "^1.0.4" -BuildRequires: php-composer(%{gh_owner}/zend-i18n) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-i18n) >= 2.6 BuildRequires: php-composer(phpunit/phpunit) >= 4.0 -# 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,26 +63,29 @@ Requires: php(language) >= 5.5 %if ! %{bootstrap} Requires: php-composer(container-interop/container-interop) >= 1.1 Requires: php-composer(container-interop/container-interop) < 2 -Requires: php-composer(%{gh_owner}/zend-http) >= 2.5 -Requires: php-composer(%{gh_owner}/zend-http) < 3 -Requires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 -Requires: php-composer(%{gh_owner}/zend-servicemanager) < 4 -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.5 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-http) >= 2.5 +Requires: php-autoloader(%{gh_owner}/zend-http) < 3 +Requires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 +Requires: php-autoloader(%{gh_owner}/zend-servicemanager) < 4 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7.5 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 # From composer, "suggest": { # "zendframework/zend-i18n": "^2.6, if defining translatable HTTP path segments" %if 0%{?fedora} >= 21 -Suggests: php-composer(%{gh_owner}/zend-i18n) +Suggests: php-autoloader(%{gh_owner}/zend-i18n) %endif # From composer, "conflict": { # "zendframework/zend-mvc": "<3.0.0" Conflicts: php-composer(%{gh_owner}/zend-mvc) < 3 %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.1 Requires: php-pcre Requires: php-spl Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -113,7 +116,19 @@ 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}/Interop/Container/autoload.php', + '%{php_home}/Zend/Http/autoload.php', + '%{php_home}/Zend/ServiceManager/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Zend/I18n/autoload.php', +]); +EOF %install @@ -126,14 +141,8 @@ 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\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); EOF ret=0 @@ -157,6 +166,9 @@ exit $ret %changelog +* Sat Dec 9 2017 Remi Collet <remi@remirepo.net> - 3.0.2-5 +- switch from zend-loader to fedora/autoloader + * Tue Oct 24 2017 Remi Collet <remi@fedoraproject.org> - 3.0.2-4 - fix FTBFS from Koschei, add patch for PHP 7.2 from https://github.com/zendframework/zend-router/pull/39 |