summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-08 09:24:58 +0100
committerRemi Collet <remi@remirepo.net>2017-12-08 09:24:58 +0100
commit8db9039d2e690472ee78ba920bd023b9f223ba54 (patch)
tree88c62c0938794f43d5713a3978ca514d63aedcb2
parent44bc45a142f2021940a01c3d536384b11024767c (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-ldap.spec51
1 files changed, 30 insertions, 21 deletions
diff --git a/php-zendframework-zend-ldap.spec b/php-zendframework-zend-ldap.spec
index e9ee6e4..83a2f50 100644
--- a/php-zendframework-zend-ldap.spec
+++ b/php-zendframework-zend-ldap.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.8.0
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -41,7 +41,6 @@ BuildRequires: php-json
BuildRequires: php-mbstring
BuildRequires: php-pcre
BuildRequires: php-spl
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5
# From composer, "require-dev": {
# "zendframework/zend-config": "^2.5",
# "zendframework/zend-eventmanager": "^2.6.3 || ^3.0.1",
@@ -50,14 +49,14 @@ BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5
# "php-mock/php-mock-phpunit": "~0.3",
# "zendframework/zend-coding-standard": "~1.0.0",
# "phpunit/phpunit": "^4.6"
-BuildRequires: php-composer(%{gh_owner}/zend-config) >= 2.5
-BuildRequires: php-composer(%{gh_owner}/zend-eventmanager) >= 2.6.3
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-config) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-eventmanager) >= 2.6.3
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
BuildRequires: php-composer(php-mock/php-mock-phpunit) >= 0.3
BuildRequires: php-composer(phpunit/phpunit) >= 4.6
-# 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",
@@ -70,11 +69,13 @@ Requires: php-ldap
# "zendframework/zend-eventmanager": "^2.6.3 || ^3.0.1",
# "zendframework/zend-stdlib": "^2.7 || ^3.0",
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-config) >= 2.5
-Suggests: php-composer(%{gh_owner}/zend-eventmanager) >= 2.6.3
-Suggests: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
+Suggests: php-autoloader(%{gh_owner}/zend-config) >= 2.5
+Suggests: php-autoloader(%{gh_owner}/zend-eventmanager) >= 2.6.3
+Suggests: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
%endif
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.5.2
Requires: php-date
Requires: php-iconv
@@ -86,6 +87,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
@@ -102,7 +104,14 @@ 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::optional([
+ '%{php_home}/Zend/Config/autoload.php',
+ '%{php_home}/Zend/EventManager/autoload.php',
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+EOF
%install
@@ -115,15 +124,11 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
-# TODO php-mock found by PSR-0 rules
-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}/phpmock/autoload.php',
+]);
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -143,10 +148,14 @@ exit $ret
%license LICENSE
%doc *.md
%doc composer.json
-%{php_home}/Zend/%{library}
+%dir %{php_home}/Zend
+ %{php_home}/Zend/%{library}
%changelog
+* Thu Dec 7 2017 Remi Collet <remi@remirepo.net> - 2.8.0-3
+- switch from zend-loader to fedora/autoloader
+
* Tue Mar 7 2017 Remi Collet <remi@remirepo.net> - 2.8.0-1
- Update to 2.8.0