diff options
-rw-r--r-- | php-zendframework-zend-mvc-i18n.spec | 84 |
1 files changed, 46 insertions, 38 deletions
diff --git a/php-zendframework-zend-mvc-i18n.spec b/php-zendframework-zend-mvc-i18n.spec index 092f8c1..a7be943 100644 --- a/php-zendframework-zend-mvc-i18n.spec +++ b/php-zendframework-zend-mvc-i18n.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 1.0.0 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework Mvc-%{library} component Group: Development/Libraries @@ -35,11 +35,11 @@ BuildArch: noarch %if %{with_tests} BuildRequires: php(language) >= 5.6 BuildRequires: php-composer(container-interop/container-interop) >= 1.1 -BuildRequires: php-composer(%{gh_owner}/zend-i18n) >= 2.7 -BuildRequires: php-composer(%{gh_owner}/zend-router) >= 3.0 -BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.6 -BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-i18n) >= 2.7 +BuildRequires: php-autoloader(%{gh_owner}/zend-router) >= 3.0 +BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7.6 +BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.6 BuildRequires: php-intl BuildRequires: php-spl # From composer, "require-dev": { @@ -47,12 +47,10 @@ BuildRequires: php-spl # "squizlabs/php_codesniffer": "^2.3.1", # "zendframework/zend-cache": "^2.6.1" BuildRequires: php-composer(phpunit/phpunit) >= 4.5 -BuildRequires: php-composer(%{gh_owner}/zend-cache) >= 2.6.1 -# Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 -# For dependencies autoloader -BuildRequires: php-zendframework-zend-loader >= 2.5.1-3 +BuildRequires: php-autoloader(%{gh_owner}/zend-cache) >= 2.6.1 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "^5.6 || ^7.0", @@ -65,16 +63,18 @@ BuildRequires: php-zendframework-zend-loader >= 2.5.1-3 Requires: php(language) >= 5.6 Requires: php-composer(container-interop/container-interop) >= 1.1 Requires: php-composer(container-interop/container-interop) < 2 -Requires: php-composer(%{gh_owner}/zend-i18n) >= 2.7 -Requires: php-composer(%{gh_owner}/zend-i18n) < 3 -Requires: php-composer(%{gh_owner}/zend-router) >= 3.0 -Requires: php-composer(%{gh_owner}/zend-router) < 4 -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.6 -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-i18n) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-i18n) < 3 +Requires: php-autoloader(%{gh_owner}/zend-router) >= 3.0 +Requires: php-autoloader(%{gh_owner}/zend-router) < 4 +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.6 +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 +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 1.0.0 Requires: php-intl Requires: php-spl @@ -82,14 +82,12 @@ Requires: php-spl # From composer, "suggest": { # "zendframework/zend-cache": "To enable caching of translation strings" %if 0%{?fedora} >= 21 -Suggests: php-composer(%{gh_owner}/zend-cache) +Suggests: php-autoloader(%{gh_owner}/zend-cache) %endif -# Autoloader -Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5 -Requires: php-zendframework-zend-loader >= 2.5.1-3 %endif Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -111,15 +109,30 @@ two components. mv LICENSE.md LICENSE -: Create dependency autoloader + +%build +: Create dependency autoloader - deprecated cat << 'EOF' | tee autoload.php <?php require_once '%{php_home}/Interop/Container/autoload.php'; EOF -%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/I18n/autoload.php', + '%{php_home}/Zend/Router/autoload.php', + '%{php_home}/Zend/ServiceManager/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', + '%{php_home}/Zend/Validator/autoload.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Zend/Cache/autoload.php', +]); +EOF %install @@ -134,16 +147,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/Mvc-%{library}-autoload. mkdir vendor cat << 'EOF' | tee vendor/autoload.php <?php -define('RPM_BUILDROOT', '%{buildroot}%{php_home}/Zend'); - -require_once '%{php_home}/Zend/Loader/AutoloaderFactory.php'; -Zend\Loader\AutoloaderFactory::factory(array( - 'Zend\Loader\StandardAutoloader' => array( - 'namespaces' => array( - 'ZendTest\\Mvc\\%{library}' => dirname(__DIR__).'/test/', - 'Zend\\Mvc\\%{library}' => '%{buildroot}%{php_home}/Zend/Mvc/%{library}' -)))); -require_once '%{php_home}/Zend/autoload.php'; +require_once '%{buildroot}%{php_home}/Zend/Mvc/%{library}/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\Mvc\\%{library}\\', dirname(__DIR__) . '/test'); EOF ret=0 @@ -168,6 +173,9 @@ exit $ret %changelog +* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 1.1.10-4 +- switch from zend-loader to fedora/autoloader + * Wed Jun 29 2016 Remi Collet <remi@fedoraproject.org> - 1.1.10-1 - initial package |