summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-11 16:15:27 +0100
committerRemi Collet <remi@remirepo.net>2017-12-11 16:15:27 +0100
commit8462092f10c59f9060d873aac4bc0d3e9f5d8524 (patch)
tree40bca077bae73e2258510e6d75ca153b565665df
parent18b292eb9b5731204adc46fe65901f04c9fa3a97 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-mime.spec40
1 files changed, 27 insertions, 13 deletions
diff --git a/php-zendframework-zend-mime.spec b/php-zendframework-zend-mime.spec
index e04b951..4e3825b 100644
--- a/php-zendframework-zend-mime.spec
+++ b/php-zendframework-zend-mime.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.7.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -37,7 +37,7 @@ BuildRequires: php(language) >= 5.6
BuildRequires: php-iconv
BuildRequires: php-pcre
BuildRequires: php-spl
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
# From composer, "require-dev": {
# "zendframework/zend-mail": "^2.6"",
# "phpunit/PHPUnit": "^5.7.21 || ^6.3",
@@ -52,20 +52,23 @@ BuildRequires: %{phpunit}
# Autoloader
BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
# "zendframework/zend-stdlib": "^2.7 || ^3.0"
Requires: php(language) >= 5.6
%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-mail": "Zend\\Mail component"
%if 0%{?fedora} >= 21
Suggests: php-composer(%{gh_owner}/zend-mail)
%endif
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.5.1
Requires: php-iconv
Requires: php-pcre
@@ -74,6 +77,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
@@ -91,7 +95,16 @@ 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}/Zend/Stdlib/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Mail/autoload.php',
+]);
+EOF
%install
@@ -104,14 +117,12 @@ 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';
+# For BR without new autoloader
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Zend/autoload.php',
+]);
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -136,6 +147,9 @@ exit $ret
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 2.7.0-2
+- switch from zend-loader to fedora/autoloader
+
* Wed Nov 29 2017 Remi Collet <remi@remirepo.net> - 2.7.0-1
- Update to 2.7.0
- raise dependency on PHP 5.6