summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-11 14:00:57 +0100
committerRemi Collet <remi@remirepo.net>2017-12-11 14:00:57 +0100
commit49011b9725aab44b0e00249528f03401b22ec4b0 (patch)
treec2b3744d5848fc37cec298e7aabac3c6b3fed59f
parent012f8ddf90cd6a09028916033143768b86715d5b (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-expressive-helpers.spec60
1 files changed, 34 insertions, 26 deletions
diff --git a/php-zendframework-zend-expressive-helpers.spec b/php-zendframework-zend-expressive-helpers.spec
index 3a26a34..3b3a057 100644
--- a/php-zendframework-zend-expressive-helpers.spec
+++ b/php-zendframework-zend-expressive-helpers.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 3.0.1
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: Helper/Utility classes for Expressive
Group: Development/Libraries
@@ -41,7 +41,7 @@ BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-composer(container-interop/container-interop) >= 1.1
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
# From composer, "require-dev": {
# "phpunit/phpunit": "^4.7",
# "zendframework/zend-diactoros": "^1.2",
@@ -49,13 +49,11 @@ BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 2.0
# "zendframework/zend-coding-standard": "~1.0.0",
# "malukenho/docheader": "^0.1.5"
BuildRequires: php-composer(phpunit/phpunit) >= 4.7
-BuildRequires: php-composer(%{gh_owner}/zend-diactoros) >= 1.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.2
BuildRequires: php-composer(mockery/mockery) >= 0.9.5
-# 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",
@@ -67,8 +65,10 @@ 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-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
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 1.4.0
Requires: php-json
Requires: php-pcre
@@ -79,16 +79,14 @@ Requires: php-spl
# "aura/di": "3.0.*@beta to make use of Aura.Di dependency injection container",
# "zendframework/zend-servicemanager": "^2.5 to use zend-servicemanager for dependency injection"
%if 0%{?fedora} >= 21
-Suggests: php-composer(mouf/pimple-interop)
+#Suggests: php-composer(mouf/pimple-interop)
Suggests: php-composer(aura/di)
-Suggests: php-composer(%{gh_owner}/zend-servicemanager)
+Suggests: php-autoloader(%{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
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -103,7 +101,19 @@ mv LICENSE.md LICENSE
%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}/Interop/Container/autoload.php',
+ '%{php_home}/Psr/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
@@ -116,17 +126,12 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library}/%{sublib}
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 '%{php_home}/Mockery/autoload.php';
+require_once '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}/autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Mockery/autoload.php',
+ '%{php_home}/Zend/Diactoros/autoload.php',
+]);
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\%{sublib}', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -150,6 +155,9 @@ exit $ret
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 3.0.1-3
+- switch from zend-loader to fedora/autoloader
+
* Tue Feb 14 2017 Remi Collet <remi@fedoraproject.org> - 3.0.1-1
- update to 3.0.1
- raise dependency on PHP 5.6