summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-expressive.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-11 16:08:45 +0100
committerRemi Collet <remi@remirepo.net>2017-12-11 16:08:45 +0100
commitf2767da8537005df97d16f1eec2ab67141cc5b60 (patch)
tree3a3e2c9f981f286a3167d5fc095c8ffd5d3f4fd2 /php-zendframework-zend-expressive.spec
parent56711faafc5c083f63c19bd87ebbe7f6b50239ce (diff)
switch from zend-loader to fedora/autoloaderHEADmaster
Diffstat (limited to 'php-zendframework-zend-expressive.spec')
-rw-r--r--php-zendframework-zend-expressive.spec102
1 files changed, 59 insertions, 43 deletions
diff --git a/php-zendframework-zend-expressive.spec b/php-zendframework-zend-expressive.spec
index 5bd4f88..599e9cd 100644
--- a/php-zendframework-zend-expressive.spec
+++ b/php-zendframework-zend-expressive.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 1.1.1
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: PSR-7 Middleware Microframework based on Stratigility
Group: Development/Libraries
@@ -36,10 +36,10 @@ BuildArch: noarch
BuildRequires: php(language) >= 5.6
BuildRequires: php-composer(container-interop/container-interop) >= 1.1
BuildRequires: php-composer(psr/http-message) >= 1.0
-BuildRequires: php-composer(%{gh_owner}/zend-diactoros) >= 1.1
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.1
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-template) >= 1.0.1
-BuildRequires: php-composer(%{gh_owner}/zend-stratigility) >= 1.3.3
+BuildRequires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.1
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 1.1
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-template) >= 1.0.1
+BuildRequires: php-autoloader(%{gh_owner}/zend-stratigility) >= 1.3.3
BuildRequires: php-reflection
BuildRequires: php-spl
# From composer, "require-dev": {
@@ -52,17 +52,15 @@ BuildRequires: php-spl
# "zendframework/zend-servicemanager": "^2.6",
# "malukenho/docheader": "^0.1.5",
# "mockery/mockery": "^0.9.5"
-BuildRequires: php-composer(phpunit/phpunit) >= 4.7
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-aurarouter) >= 1.0
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-fastroute) >= 1.0
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-zendrouter) >= 1.0
-BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.6
-BuildRequires: php-composer(mockery/mockery) >= 0.9.5
-# For dependencies autoloader
-BuildRequires: php-zendframework-zend-loader >= 2.5.1-4
+BuildRequires: php-composer(phpunit/phpunit) >= 4.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-aurarouter) >= 1.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-fastroute) >= 1.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-zendrouter) >= 1.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.6
+BuildRequires: php-composer(mockery/mockery) >= 0.9.5
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
@@ -77,14 +75,16 @@ Requires: php-composer(container-interop/container-interop) >= 1.1
Requires: php-composer(container-interop/container-interop) < 2
Requires: php-composer(psr/http-message) >= 1.0
Requires: php-composer(psr/http-message) < 2
-Requires: php-composer(%{gh_owner}/zend-diactoros) >= 1.1
-Requires: php-composer(%{gh_owner}/zend-diactoros) < 2
-Requires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.1
-Requires: php-composer(%{gh_owner}/zend-expressive-router) < 3
-Requires: php-composer(%{gh_owner}/zend-expressive-template) >= 1.0.1
-Requires: php-composer(%{gh_owner}/zend-expressive-template) < 2
-Requires: php-composer(%{gh_owner}/zend-stratigility) >= 1.3.3
-Requires: php-composer(%{gh_owner}/zend-stratigility) < 2
+Requires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.1
+Requires: php-autoloader(%{gh_owner}/zend-diactoros) < 2
+Requires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 1.1
+Requires: php-autoloader(%{gh_owner}/zend-expressive-router) < 3
+Requires: php-autoloader(%{gh_owner}/zend-expressive-template) >= 1.0.1
+Requires: php-autoloader(%{gh_owner}/zend-expressive-template) < 2
+Requires: php-autoloader(%{gh_owner}/zend-stratigility) >= 1.3.3
+Requires: php-autoloader(%{gh_owner}/zend-stratigility) < 2
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 1.2.0
Requires: php-reflection
Requires: php-spl
@@ -96,18 +96,18 @@ Requires: php-spl
# "xtreamwayz/pimple-container-interop": "^1.0 to use Pimple for dependency injection",
# "zendframework/zend-servicemanager": "^2.5 to use zend-servicemanager for dependency injection"
%if 0%{?fedora} >= 21
-#Suggests: php-composer(filp/whoops)
+#Suggests: php-composer(filp/whoops)
Suggests: php-composer(%{gh_owner}/zend-expressive-helpers)
Suggests: php-composer(aura/di)
-#Suggests: php-composer(xtreamwayz/pimple-container-interop)
+#Suggests: php-composer(xtreamwayz/pimple-container-interop)
Suggests: php-composer(%{gh_owner}/zend-servicemanager)
%endif
-# Autoloader
-Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-Requires: php-zendframework-zend-loader >= 2.5.1-4
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -132,7 +132,9 @@ Documentation: http://zend-expressive.readthedocs.io/
mv LICENSE.md LICENSE
-: Create dependency autoloader
+
+%build
+: Create dependency autoloader - deprecated
cat << 'EOF' | tee autoload.php
<?php
if (file_exists('%{php_home}/Aura/Di/autoload.php')) {
@@ -140,9 +142,23 @@ if (file_exists('%{php_home}/Aura/Di/autoload.php')) {
}
EOF
-
-%build
-# Empty build section, nothing required
+: Generate autoloader
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Interop/Container/autoload.php',
+ '%{php_home}/Psr/Http/Message/autoload.php',
+ '%{php_home}/Zend/Diactoros/autoload.php',
+ '%{php_home}/Zend/Expressive/Router/autoload.php',
+ '%{php_home}/Zend/Expressive/Template/autoload.php',
+ '%{php_home}/Zend/Stratigility/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Expressive/Helper/autoload.php',
+ '%{php_home}/Aura/Di/autoload.php',
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+]);
+EOF
%install
@@ -161,17 +177,14 @@ rm test/Container/Whoops*
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}' => dirname(__DIR__).'/test/',
- 'Zend\\%{library}' => '%{buildroot}%{php_home}/Zend/%{library}'
-))));
-require_once '%{php_home}/Zend/autoload.php';
-require_once '%{php_home}/Mockery/autoload.php';
+require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Zend/Expressive/Router/aurarouter-autoload.php',
+ '%{php_home}/Zend/Expressive/Router/fastroute-autoload.php',
+ '%{php_home}/Zend/Expressive/Router/zendrouter-autoload.php',
+ '%{php_home}/Mockery/autoload.php',
+]);
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -196,6 +209,9 @@ exit $ret
%changelog
+* Thu Dec 7 2017 Remi Collet <remi@remirepo.net> - 1.1.1-3
+- switch from zend-loader to fedora/autoloader
+
* Tue Feb 14 2017 Remi Collet <remi@fedoraproject.org> - 1.1.1-1
- update to 1.1.1