summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-filter.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-07 13:40:13 +0100
committerRemi Collet <remi@remirepo.net>2017-12-07 13:40:13 +0100
commite0cb8478abb811837279c87ad5d9892b29ee06ee (patch)
tree478a4d0b193482989e23488ac79b171ba2b13262 /php-zendframework-zend-filter.spec
parent8b92511d14a18b1690774596c00a949bbeae5c03 (diff)
switch from zend-loader to fedora/autoloader
Diffstat (limited to 'php-zendframework-zend-filter.spec')
-rw-r--r--php-zendframework-zend-filter.spec57
1 files changed, 35 insertions, 22 deletions
diff --git a/php-zendframework-zend-filter.spec b/php-zendframework-zend-filter.spec
index a652e89..fc3abf5 100644
--- a/php-zendframework-zend-filter.spec
+++ b/php-zendframework-zend-filter.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.7.2
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -42,7 +42,7 @@ BuildRequires: php-mcrypt
BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-zip
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
# From composer, "require-dev": {
# "pear/archive_tar": "^1.4",
# "zendframework/zend-crypt": "^2.6 || ^3.0",
@@ -51,25 +51,25 @@ BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
# "phpunit/PHPUnit": "^6.0.10 || ^5.7.17",
# "zendframework/zend-coding-standard": "~1.0.0"
BuildRequires: php-composer(pear/archive_tar) >= 1.4
-BuildRequires: php-composer(%{gh_owner}/zend-crypt) >= 2.5
-BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.5
-BuildRequires: php-composer(%{gh_owner}/zend-uri) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-crypt) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-uri) >= 2.5
%if 0%{?fedora} >= 26
%global phpunit %{_bindir}/phpunit6
%else
%global phpunit %{_bindir}/phpunit
%endif
BuildRequires: %{phpunit}
-# 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
-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
%if ! %{bootstrap}
# From composer, "suggest": {
# "zendframework/zend-crypt": "Zend\\Crypt component",
@@ -77,12 +77,14 @@ Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
# "zendframework/zend-servicemanager": "Zend\\ServiceManager component",
# "zendframework/zend-uri": "Zend\\Uri component for UriNormalize filter"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-crypt)
-Suggests: php-composer(%{gh_owner}/zend-i18n)
-Suggests: php-composer(%{gh_owner}/zend-servicemanager)
-Suggests: php-composer(%{gh_owner}/zend-uri)
+Suggests: php-autoloader(%{gh_owner}/zend-crypt)
+Suggests: php-autoloader(%{gh_owner}/zend-i18n)
+Suggests: php-autoloader(%{gh_owner}/zend-servicemanager)
+Suggests: php-autoloader(%{gh_owner}/zend-uri)
%endif
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.5.2
Requires: php-date
Requires: php-iconv
@@ -94,6 +96,7 @@ Requires: php-zip
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
@@ -111,7 +114,20 @@ 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/Crypt/autoload.php',
+ '%{php_home}/Zend/I18n/autoload.php',
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+ '%{php_home}/Zend/Uri/autoload.php',
+]);
+// For Archive_Tar
+\Fedora\Autoloader\Autoload::addPsr0('', '%{_datadir}/pear');
+EOF
%install
@@ -124,14 +140,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
# Need investigation
@@ -159,6 +169,9 @@ exit $ret
%changelog
+* Thu Dec 7 2017 Remi Collet <remi@remirepo.net> - 2.7.2-3
+- switch from zend-loader to fedora/autoloader
+
* Mon May 22 2017 Remi Collet <remi@remirepo.net> - 2.7.2-1
- Update to 2.7.2
- use phpunit6 on F26+