summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-05 11:03:39 +0100
committerRemi Collet <remi@remirepo.net>2017-12-05 11:03:39 +0100
commit8e8ec21028c3f7a7e8ad880fa881fce1e385b0d9 (patch)
tree0d6af35c83b452daaeb35ded15f739296d99bece
parente83616e348f814398b6a52d31146b305a824af54 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-di.spec50
1 files changed, 31 insertions, 19 deletions
diff --git a/php-zendframework-zend-di.spec b/php-zendframework-zend-di.spec
index efa85b9..0799453 100644
--- a/php-zendframework-zend-di.spec
+++ b/php-zendframework-zend-di.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.6.1
-Release: 1%{?dist}
+Release: 4%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -37,16 +37,17 @@ BuildRequires: php(language) >= 5.3.23
BuildRequires: php-reflection
BuildRequires: php-pcre
BuildRequires: php-spl
+BuildRequires: php-composer(container-interop/container-interop) < 2
BuildRequires: php-composer(container-interop/container-interop) >= 1.1
-BuildRequires: php-composer(%{gh_owner}/zend-code) >= 2.6
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-code) >= 2.6
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
# From composer, "require-dev": {
# "fabpot/php-cs-fixer": "1.7.*",
# "phpunit/PHPUnit": "~4.0"
BuildRequires: php-composer(phpunit/phpunit) >= 4.0
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.5 || ^7.0",
@@ -57,16 +58,18 @@ Requires: php(language) >= 5.3.23
%if ! %{bootstrap}
Requires: php-composer(container-interop/container-interop) >= 1.1
Requires: php-composer(container-interop/container-interop) < 2
-Requires: php-composer(%{gh_owner}/zend-code) >= 2.6
-Requires: php-composer(%{gh_owner}/zend-code) < 4
-Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
-Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
+Requires: php-autoloader(%{gh_owner}/zend-code) >= 2.6
+Requires: php-autoloader(%{gh_owner}/zend-code) < 4
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4
# From composer, "suggest": {
# "zendframework/zend-servicemanager": "Zend\\ServiceManager component"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-servicemanager)
+Suggests: php-autoloader(%{gh_owner}/zend-servicemanager)
%endif
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.5.2
Requires: php-reflection
Requires: php-pcre
@@ -75,6 +78,7 @@ Requires: php-spl
Obsoletes: php-ZendFramework2-%{library} < 2.5
Provides: php-ZendFramework2-%{library} = %{version}
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -93,7 +97,18 @@ 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}/Zend/Code/autoload.php',
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+]);
+EOF
%install
@@ -106,14 +121,8 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
-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 '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -137,6 +146,9 @@ exit $ret
%changelog
+* Tue Dec 5 2017 Remi Collet <remi@remirepo.net> - 2.6.1-4
+- switch from zend-loader to fedora/autoloader
+
* Tue Apr 26 2016 Remi Collet <remi@fedoraproject.org> - 2.6.1-1
- update to 2.6.1