summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-01-26 06:53:47 +0100
committerRemi Collet <remi@remirepo.net>2018-01-26 06:53:47 +0100
commit6864979e5176cbae38c565b35dfb9dd58b434bc5 (patch)
treebafbde766943ea357bb8fa8a97440de748602b5b
parent6b9e043aee1826e49a40ce08934b64f2b2c9b0cf (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-console.spec54
1 files changed, 33 insertions, 21 deletions
diff --git a/php-zendframework-zend-console.spec b/php-zendframework-zend-console.spec
index 5defad2..ed8ffa1 100644
--- a/php-zendframework-zend-console.spec
+++ b/php-zendframework-zend-console.spec
@@ -1,6 +1,6 @@
# remirepo/Fedora spec file for php-zendframework-zend-console
#
-# Copyright (c) 2015-2017 Remi Collet
+# Copyright (c) 2015-2018 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.6.0
-Release: 1%{?dist}
+Release: 5%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -40,36 +40,38 @@ BuildRequires: php-pcre
BuildRequires: php-reflection
BuildRequires: php-spl
BuildRequires: php-xml
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
# From composer, "require-dev": {
# "fabpot/php-cs-fixer": "1.7.*",
# "phpunit/PHPUnit": "~4.0",
# "zendframework/zend-filter": "^2.6",
# "zendframework/zend-json": "^2.6",
# "zendframework/zend-validator": "^2.5"
-BuildRequires: php-composer(%{gh_owner}/zend-filter) >= 2.5
-BuildRequires: php-composer(%{gh_owner}/zend-json) >= 2.5
-BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-filter) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-json) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.5
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",
# "zendframework/zend-stdlib": "^2.7 || ^3.0"
Requires: php(language) >= 5.5
%if ! %{bootstrap}
-Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
-Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4
# From composer, "suggest": {
# "zendframework/zend-validator": "To support DefaultRouteMatcher usage",
# "zendframework/zend-filter": "To support DefaultRouteMatcher usage"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-validator)
-Suggests: php-composer(%{gh_owner}/zend-filter)
+Suggests: php-autoloader(%{gh_owner}/zend-validator)
+Suggests: php-autoloader(%{gh_owner}/zend-filter)
%endif
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.5.1
Requires: php-ctype
Requires: php-dom
@@ -81,6 +83,7 @@ Requires: php-xml
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
@@ -96,7 +99,16 @@ mv LICENSE.md LICENSE
%build
-# Empty build section, nothing required
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Validator/autoload.php',
+ '%{php_home}/Zend/Filter/autoload.php',
+]);
+EOF
%install
@@ -109,14 +121,11 @@ 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\Dependencies::required([
+ '%{php_home}/Zend/Json/autoload.php',
+]);
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -140,6 +149,9 @@ exit $ret
%changelog
+* Thu Dec 7 2017 Remi Collet <remi@remirepo.net> - 2.6.0-5
+- switch from zend-loader to fedora/autoloader
+
* Fri Feb 12 2016 Remi Collet <remi@fedoraproject.org> - 2.6.0-1
- update to 2.6.0
- raise dependency on PHP >= 5.5