diff options
author | Remi Collet <remi@remirepo.net> | 2017-12-11 14:46:28 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-12-11 14:46:28 +0100 |
commit | 1104823abded7b49190e3ae2871ae3385bd3efce (patch) | |
tree | b5268e920196615e10f289edaaf64ed2a6d6dde0 | |
parent | da9ad19b36238b3a6efad2a2ef8d754413a42ad3 (diff) |
-rw-r--r-- | php-zendframework-zend-expressive-fastroute.spec | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/php-zendframework-zend-expressive-fastroute.spec b/php-zendframework-zend-expressive-fastroute.spec index a846ec9..0704446 100644 --- a/php-zendframework-zend-expressive-fastroute.spec +++ b/php-zendframework-zend-expressive-fastroute.spec @@ -22,7 +22,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: FastRoute integration for %{library} Group: Development/Libraries @@ -39,8 +39,8 @@ BuildRequires: php-composer(fig/http-message-util) >= 1.1.2 BuildRequires: php-composer(nikic/fast-route) >= 1.2 BuildRequires: php-composer(psr/container) >= 1.0 BuildRequires: php-composer(psr/http-message) >= 1.0.1 -BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 2.0 -BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 3.1 +BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 2.0 +BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 3.1 BuildRequires: php-pcre # From composer, "require-dev": { # "malukenho/docheader": "^0.1.5", @@ -52,11 +52,9 @@ BuildRequires: php-pcre %global phpunit %{_bindir}/phpunit %endif BuildRequires: %{phpunit} -# Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 -# For dependencies autoloader -BuildRequires: php-zendframework-zend-loader >= 2.5.1-4 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "^5.6 || ^7.0", @@ -75,19 +73,17 @@ Requires: php-composer(psr/container) >= 1.0 Requires: php-composer(psr/container) < 2 Requires: php-composer(psr/http-message) >= 1.0.1 Requires: php-composer(psr/http-message) < 2 -Requires: php-composer(%{gh_owner}/zend-expressive-router) >= 2.0 -Requires: php-composer(%{gh_owner}/zend-expressive-router) < 3 -Requires: php-composer(%{gh_owner}/zend-stdlib) >= 3.1 -Requires: php-composer(%{gh_owner}/zend-stdlib) < 4 +Requires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 2.0 +Requires: php-autoloader(%{gh_owner}/zend-expressive-router) < 3 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 3.1 +Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.1.0 Requires: php-pcre -%if ! %{bootstrap} -# Autoloader -Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5 -Requires: php-zendframework-zend-loader >= 2.5.1-4 -%endif Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -102,6 +98,8 @@ https://zendframework.github.io/zend-expressive/features/router/fast-route/ mv LICENSE.md LICENSE + +%build : Create dependency autoloader cat << 'EOF' | tee autoload.php <?php @@ -110,9 +108,18 @@ require_once '%{php_home}/Fig/Http/Message/autoload.php'; require_once '%{php_home}/Psr/Container/autoload.php'; EOF - -%build -# Empty build section, nothing required +: Create autoloader +phpab --template fedora --output src/fastroute-autoload.php src +cat << 'EOF' | tee -a src/fastroute-autoload.php +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/Fig/Http/Message/autoload.php', + '%{php_home}/FastRoute/bootstrap.php', + '%{php_home}/Psr/Container/autoload.php', + '%{php_home}/Psr/Http/Message/autoload.php', + '%{php_home}/Zend/Expressive/Router/autoload.php', + '%{php_home}/Zend/Stdlib/autoload.php', +]); +EOF %install @@ -127,16 +134,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-%{sublib}-fas 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\\%{library}\\%{sublib}' => dirname(__DIR__).'/test/', - 'Zend\\%{library}\\%{sublib}' => '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}' -)))); -require_once '%{php_home}/Zend/autoload.php'; +require_once '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}/fastroute-autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\%{sublib}', dirname(__DIR__) . '/test'); EOF ret=0 @@ -157,12 +156,16 @@ exit $ret %license LICENSE %doc *.md %doc composer.json -%{php_home}/Zend/%{library}/%{sublib}/Fast* +%{php_home}/Zend/%{library}/%{sublib}/FastRoute* +%{php_home}/Zend/%{library}/%{sublib}/fastroute* %{php_home}/Zend/%{library}-%{sublib}-fast-autoload.php %{php_home}/Zend/%{library}/%{sublib}/Exception/Invalid* %changelog +* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 2.1.2-2 +- switch from zend-loader to fedora/autoloader + * Thu Dec 7 2017 Remi Collet <remi@remirepo.net> - 2.1.2-1 - Update to 2.1.2 (no change) |