diff options
-rw-r--r-- | php-zendframework-zend-cache.spec | 64 |
1 files changed, 40 insertions, 24 deletions
diff --git a/php-zendframework-zend-cache.spec b/php-zendframework-zend-cache.spec index ae2dfcc..0116b98 100644 --- a/php-zendframework-zend-cache.spec +++ b/php-zendframework-zend-cache.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.7.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -40,9 +40,9 @@ BuildRequires: php-reflection BuildRequires: php-date BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7 -BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5 -BuildRequires: php-composer(%{gh_owner}/zend-eventmanager) >= 2.6.2 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-eventmanager) >= 2.6.2 # From composer, "require-dev": { # "zendframework/zend-serializer": "^2.6", # "zendframework/zend-session": "^2.6.2", @@ -54,6 +54,7 @@ BuildRequires: php-composer(%{gh_owner}/zend-session) >= 2.6.2 BuildRequires: php-composer(phpunit/phpunit) >= 4.8 # Autoloader BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 +BuildRequires: php-fedora-autoloader-devel %endif # From composer, "require": { @@ -63,12 +64,12 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-eventmanager": "^2.6.2 || ^3.0" 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-servicemanager) >= 2.7.5 -Requires: php-composer(%{gh_owner}/zend-servicemanager) < 4 -Requires: php-composer(%{gh_owner}/zend-eventmanager) >= 2.6.2 -Requires: php-composer(%{gh_owner}/zend-eventmanager) < 4 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 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-eventmanager) >= 2.6.2 +Requires: php-autoloader(%{gh_owner}/zend-eventmanager) < 4 # From composer, "suggest": { # "zendframework/zend-serializer": "Zend\\Serializer component", # "zendframework/zend-session": "Zend\\Session component", @@ -101,6 +102,8 @@ Requires: php-date Requires: php-pcre Requires: php-pcre Requires: php-spl +# Autoloader +Requires: php-composer(fedora/autoloader) Obsoletes: php-ZendFramework2-%{library} < 2.5 Obsoletes: php-ZendFramework2-%{library}-apc < 2.5 @@ -109,6 +112,7 @@ Provides: php-ZendFramework2-%{library} = %{version} Provides: php-ZendFramework2-%{library}-apc = %{version} Provides: php-ZendFramework2-%{library}-memcached = %{version} Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -129,17 +133,30 @@ mv src/PatternPluginManager.php src/PatternPluginManager/PatternPluginManager mv LICENSE.md LICENSE -: Create dependency autoloader mv autoload/*.php src +%build +: Create dependency autoloader - deprecated cat << 'EOF' | tee autoload.php <?php require_once __DIR__ . '/%{library}/patternPluginManagerPolyfill.php'; EOF +: Create autoloader +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/ServiceManager/autoload.php', + '%{php_home}/Zend/EventManager/autoload.php', + __DIR__ . '/patternPluginManagerPolyfill.php', +]); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Zend/Serializer/autoload.php', + '%{php_home}/Zend/Session/autoload.php', +]); +EOF -%build -# Empty build section, nothing required %install @@ -152,18 +169,14 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php %check %if %{with_tests} mkdir vendor -cat << EOF | tee vendor/autoload.php +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\\%{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'; +# For BR without new autoloader +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/Zend/autoload.php', +]); +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); EOF # Try to slowdown tests with erratic results @@ -193,6 +206,9 @@ exit $ret %changelog +* Fri Nov 24 2017 Remi Collet <remi@remirepo.net> - 2.7.2-6 +- switch from zend-loader to fedora/autoloader + * Tue Nov 14 2017 Remi Collet <remi@fedoraproject.org> - 2.7.2-5 - try to slowdown tests with erratic result (FTBFS) |