summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-11 13:16:59 +0100
committerRemi Collet <remi@remirepo.net>2017-12-11 13:16:59 +0100
commita7eaf58bdbcf6116c77849c03c48a2f3052010f6 (patch)
treebc32e372027d14216dc1dda6e0b2b1d953091cdc
parent8d3618204ecee0f5f1aa40b799304100267dcf9b (diff)
switch from zend-loader to fedora/autoloaderHEADmaster
-rw-r--r--php-zendframework-zend-expressive-router.spec56
1 files changed, 31 insertions, 25 deletions
diff --git a/php-zendframework-zend-expressive-router.spec b/php-zendframework-zend-expressive-router.spec
index 7534ca5..06c0d6e 100644
--- a/php-zendframework-zend-expressive-router.spec
+++ b/php-zendframework-zend-expressive-router.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.0.0
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: %{sublib} subcomponent for %{library}
Group: Development/Libraries
@@ -44,11 +44,9 @@ BuildRequires: php-spl
# "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",
@@ -59,6 +57,8 @@ Requires: php-composer(psr/http-message) >= 1.0
Requires: php-composer(psr/http-message) < 2
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.2.0
Requires: php-pcre
Requires: php-spl
@@ -68,16 +68,14 @@ Requires: php-spl
# "zendframework/zend-expressive-fastroute": "^1.2 to use the FastRoute routing adapter",
# "zendframework/zend-expressive-zendrouter": "^1.2 to use the zend-router routing adapter"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-expressive-aurarouter)
-Suggests: php-composer(%{gh_owner}/zend-expressive-fastroute)
-Suggests: php-composer(%{gh_owner}/zend-expressive-zendrouter)
+Suggests: php-autoloader(%{gh_owner}/zend-expressive-aurarouter)
+Suggests: php-autoloader(%{gh_owner}/zend-expressive-fastroute)
+Suggests: php-autoloader(%{gh_owner}/zend-expressive-zendrouter)
%endif
-# 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
@@ -104,15 +102,27 @@ 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}/Fig/Http/Message/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}/Psr/Http/Message/autoload.php',
+ '%{php_home}/Fig/Http/Message/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/%{library}/%{sublib}/aurarouter-autoload.php',
+ '%{php_home}/Zend/%{library}/%{sublib}/fastroute-autoload.php',
+ '%{php_home}/Zend/%{library}/%{sublib}/zendrouterautoload.php',
+]);
+EOF
%install
@@ -127,16 +137,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-%{sublib}-aut
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}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\%{sublib}', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -156,12 +158,16 @@ exit $ret
%license LICENSE
%doc *.md
%doc composer.json
+%dir %{php_home}/Zend
%dir %{php_home}/Zend/%{library}/
%{php_home}/Zend/%{library}/%{sublib}/
%{php_home}/Zend/%{library}-%{sublib}-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