summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-expressive-zendrouter.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-zendframework-zend-expressive-zendrouter.spec')
-rw-r--r--php-zendframework-zend-expressive-zendrouter.spec71
1 files changed, 38 insertions, 33 deletions
diff --git a/php-zendframework-zend-expressive-zendrouter.spec b/php-zendframework-zend-expressive-zendrouter.spec
index 7673a45..a60af67 100644
--- a/php-zendframework-zend-expressive-zendrouter.spec
+++ b/php-zendframework-zend-expressive-zendrouter.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.0.1
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: zend-mvc router support for %{library}
Group: Development/Libraries
@@ -36,8 +36,8 @@ BuildArch: noarch
%if %{with_tests}
BuildRequires: php(language) >= 5.6
BuildRequires: php-composer(psr/http-message) >= 1.0
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 2.0
-BuildRequires: php-composer(%{gh_owner}/zend-router) >= 3.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 2.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-router) >= 3.0
BuildRequires: php-composer(%{gh_owner}/zend-psr7bridge) >= 0.2.2
BuildRequires: php-composer(fig/http-message-util) >= 1.1
BuildRequires: php-pcre
@@ -47,12 +47,10 @@ BuildRequires: php-pcre
# "malukenho/docheader": "^0.1.5",
# "zendframework/zend-i18n": "^2.7"
BuildRequires: php-composer(phpunit/phpunit) >= 4.8
-BuildRequires: php-composer(%{gh_owner}/zend-i18n) >= 2.7
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-# For dependencies autoloader
-BuildRequires: php-zendframework-zend-loader >= 2.5.1-4
+BuildRequires: php-autoloader(%{gh_owner}/zend-i18n) >= 2.7
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
@@ -64,22 +62,20 @@ BuildRequires: php-zendframework-zend-loader >= 2.5.1-4
Requires: php(language) >= 5.6
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-composer(%{gh_owner}/zend-router) >= 3.0
-Requires: php-composer(%{gh_owner}/zend-router) < 4
-Requires: php-composer(%{gh_owner}/zend-psr7bridge) >= 0.2.2
+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-router) >= 3.0
+Requires: php-autoloader(%{gh_owner}/zend-router) < 4
+Requires: php-autoloader(%{gh_owner}/zend-psr7bridge) >= 0.2.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
-%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
@@ -94,15 +90,25 @@ https://zendframework.github.io/zend-expressive/features/router/zf2/
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/zendrouter-autoload.php src
+cat << 'EOF' | tee -a src/zendrouter-autoload.php
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Psr/Http/Message/autoload.php',
+ '%{php_home}/Zend/Expressive/Router/autoload.php',
+ '%{php_home}/Zend/Router/autoload.php',
+ '%{php_home}/Zend/Psr7Bridge/autoload.php',
+ '%{php_home}/Fig/Http/Message/autoload.php',
+]);
+EOF
%install
@@ -117,16 +123,11 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-%{sublib}-zen
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}/zendrouter-autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Zend/I18n/autoload.php',
+]);
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\%{sublib}', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -146,11 +147,15 @@ exit $ret
%license LICENSE
%doc *.md
%doc composer.json
-%{php_home}/Zend/%{library}/%{sublib}/Zend*
+%{php_home}/Zend/%{library}/%{sublib}/ZendRouter*
+%{php_home}/Zend/%{library}/%{sublib}/zendrouter*
%{php_home}/Zend/%{library}-%{sublib}-zendrouter-autoload.php
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 2.0.1-3
+- switch from zend-loader to fedora/autoloader
+
* Thu Mar 2 2017 Remi Collet <remi@fedoraproject.org> - 2.0.1-1
- update to 2.0.1