summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-04-16 10:09:22 +0200
committerRemi Collet <remi@remirepo.net>2018-04-16 10:09:22 +0200
commitceee9fdcb164c23401168caa4acec017724572e5 (patch)
tree001dbe14c8cbd25cebcfe8d84063804bb8842bc1
parent645f725d8d26c7565f4906803680888613a6c422 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-authentication.spec75
1 files changed, 45 insertions, 30 deletions
diff --git a/php-zendframework-zend-authentication.spec b/php-zendframework-zend-authentication.spec
index 056539d..06a4215 100644
--- a/php-zendframework-zend-authentication.spec
+++ b/php-zendframework-zend-authentication.spec
@@ -1,6 +1,6 @@
# remirepo/Fedora spec file for php-zendframework-zend-authentication
#
-# 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.5.3
-Release: 1%{?dist}
+Release: 4%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -39,7 +39,7 @@ BuildRequires: php-date
BuildRequires: php-hash
BuildRequires: php-pcre
BuildRequires: php-spl
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.5
# From composer, "require-dev": {
# "zendframework/zend-db": "^2.7",
# "zendframework/zend-crypt": "^2.6",
@@ -50,25 +50,25 @@ BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5
# "zendframework/zend-uri": "^2.5",
# "fabpot/php-cs-fixer": "1.7.*",
# "phpunit/PHPUnit": "~4.0"
-BuildRequires: php-composer(%{gh_owner}/zend-db) >= 2.7
-BuildRequires: php-composer(%{gh_owner}/zend-crypt) >= 2.6
-BuildRequires: php-composer(%{gh_owner}/zend-http) >= 2.5.4
-BuildRequires: php-composer(%{gh_owner}/zend-ldap) >= 2.6
-BuildRequires: php-composer(%{gh_owner}/zend-session) >= 2.6.2
-BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.6
-BuildRequires: php-composer(%{gh_owner}/zend-uri) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-db) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-crypt) >= 2.6
+BuildRequires: php-autoloader(%{gh_owner}/zend-http) >= 2.5.4
+BuildRequires: php-autoloader(%{gh_owner}/zend-ldap) >= 2.6
+BuildRequires: php-autoloader(%{gh_owner}/zend-session) >= 2.6.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.6
+BuildRequires: php-autoloader(%{gh_owner}/zend-uri) >= 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-db": "Zend\\Db component",
# "zendframework/zend-crypt": "Zend\\Crypt component",
@@ -78,15 +78,17 @@ Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
# "zendframework/zend-uri": "Zend\\Uri component",
# "zendframework/zend-validator": "Zend\\Validator component"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-db)
-Suggests: php-composer(%{gh_owner}/zend-crypt)
-Suggests: php-composer(%{gh_owner}/zend-http)
-Suggests: php-composer(%{gh_owner}/zend-ldap)
-Suggests: php-composer(%{gh_owner}/zend-session)
-Suggests: php-composer(%{gh_owner}/zend-uri)
-Suggests: php-composer(%{gh_owner}/zend-validator)
+Suggests: php-autoloader(%{gh_owner}/zend-db)
+Suggests: php-autoloader(%{gh_owner}/zend-crypt)
+Suggests: php-autoloader(%{gh_owner}/zend-http)
+Suggests: php-autoloader(%{gh_owner}/zend-ldap)
+Suggests: php-autoloader(%{gh_owner}/zend-session)
+Suggests: php-autoloader(%{gh_owner}/zend-uri)
+Suggests: php-autoloader(%{gh_owner}/zend-validator)
%endif
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.5.2
Requires: php-ctype
Requires: php-date
@@ -97,6 +99,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
@@ -113,7 +116,22 @@ mv LICENSE.md LICENSE
%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::required([
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Db/autoload.php',
+ '%{php_home}/Zend/Crypt/autoload.php',
+ '%{php_home}/Zend/Http/autoload.php',
+ '%{php_home}/Zend/Ldap/autoload.php',
+ '%{php_home}/Zend/Session/autoload.php',
+ '%{php_home}/Zend/Uri/autoload.php',
+ '%{php_home}/Zend/Validator/autoload.php',
+]);
+EOF
%install
@@ -126,14 +144,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
@@ -157,6 +169,9 @@ exit $ret
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 2.5.3-4
+- switch from zend-loader to fedora/autoloader
+
* Sun Feb 28 2016 Remi Collet <remi@fedoraproject.org> - 2.5.3-1
- update to 2.5.3
- raise dependency on zend-stdlib ~2.7