summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-11 14:38:52 +0100
committerRemi Collet <remi@remirepo.net>2017-12-11 14:38:52 +0100
commit8ad2f083f88aa177b4b982d86c320a58ea7b9c65 (patch)
tree01169095dde32cde92013e896f2d1ddca0e9aa0a
parent417fe2416980441d7a693bd21961685076b6dfd5 (diff)
switch from zend-loader to fedora/autoloaderHEADmaster
-rw-r--r--php-zendframework-zend-expressive-aurarouter.spec58
1 files changed, 32 insertions, 26 deletions
diff --git a/php-zendframework-zend-expressive-aurarouter.spec b/php-zendframework-zend-expressive-aurarouter.spec
index 9cc965a..12d3119 100644
--- a/php-zendframework-zend-expressive-aurarouter.spec
+++ b/php-zendframework-zend-expressive-aurarouter.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.0.0
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: Aura.Router integration for %{library}
Group: Development/Libraries
@@ -37,18 +37,16 @@ BuildArch: noarch
BuildRequires: php(language) >= 5.6
BuildRequires: php-composer(aura/router) >= 3.0
BuildRequires: php-composer(psr/http-message) >= 1.0
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 2.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 2.0
BuildRequires: php-composer(fig/http-message-util) >= 1.1
# From composer, "require-dev": {
# "phpunit/phpunit": "^4.7 || ^5.6",
# "zendframework/zend-coding-standard": "~1.0.0",
# "malukenho/docheader": "^0.1.5"
BuildRequires: php-composer(phpunit/phpunit) >= 4.7
-# 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",
@@ -61,19 +59,19 @@ Requires: php-composer(aura/router) >= 3.0
Requires: php-composer(aura/router) < 4
Requires: php-composer(psr/http-message) >= 1.0
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-autoloader(%{gh_owner}/zend-expressive-router) >= 2.0
+Requires: php-autoloader(%{gh_owner}/zend-expressive-router) < 3
Requires: php-composer(fig/http-message-util) >= 1.1
Requires: php-composer(fig/http-message-util) < 2
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 1.0.0
# Nothing
%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
@@ -87,16 +85,29 @@ Documentation: http://zend-expressive.readthedocs.io/
mv LICENSE.md LICENSE
-: Create dependency autoloader
+
+%build
+: Create dependency autoloader - deprecated
cat << 'EOF' | tee autoload.php
<?php
require_once '%{php_home}/Aura/Router/autoload.php';
require_once '%{php_home}/Fig/Http/Message/autoload.php';
EOF
-
-%build
-# Empty build section, nothing required
+: Create autoloader
+phpab --template fedora --output src/aurarouter-autoload.php src
+cat << 'EOF' | tee -a src/aurarouter-autoload.php
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Aura/Router/autoload.php',
+ '%{php_home}/Psr/Http/Message/autoload.php',
+ '%{php_home}/Fig/Http/Message/autoload.php',
+ '%{php_home}/Zend/Expressive/Router/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+ '%{php_home}/Aura/Di/autoload.php',
+]);
+EOF
%install
@@ -111,16 +122,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-%{sublib}-aur
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}/aurarouter-autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\%{sublib}', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -140,11 +143,14 @@ exit $ret
%license LICENSE
%doc *.md
%doc composer.json
-%{php_home}/Zend/%{library}/%{sublib}/Aura*
+%{php_home}/Zend/%{library}/%{sublib}/*
%{php_home}/Zend/%{library}-%{sublib}-aura-autoload.php
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 2.0.0-3
+- switch from zend-loader to fedora/autoloader
+
* Tue Feb 14 2017 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
- update to 2.0.0
- raise dependency on zend-expressive-router 2.0