summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-11 09:03:35 +0100
committerRemi Collet <remi@remirepo.net>2017-12-11 09:03:35 +0100
commitf5a4fcc1b56bf05d320a4e3180db7cf19ec47aed (patch)
tree765cca40cc6f94b2f143d92e175a65eef57a0dd5
parentee9a8d416e45fbbdbb5aafdb5e6f48f69a87e376 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-feed.spec81
1 files changed, 46 insertions, 35 deletions
diff --git a/php-zendframework-zend-feed.spec b/php-zendframework-zend-feed.spec
index 83886ee..9ccec64 100644
--- a/php-zendframework-zend-feed.spec
+++ b/php-zendframework-zend-feed.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.9.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -42,8 +42,8 @@ BuildRequires: php-libxml
BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-tidy
-BuildRequires: php-composer(%{gh_owner}/zend-escaper) >= 2.5.2
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.5.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7.7
# From composer, "require-dev": {
# "phpunit/phpunit": "^5.7.23 || ^6.4.3",
# "psr/http-message": "^1.0.1",
@@ -55,22 +55,20 @@ BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.7
# "zendframework/zend-validator": "^2.10.1"
BuildRequires: php-composer(psr/http-message) < 2
BuildRequires: php-composer(psr/http-message) >= 1.0.1
-BuildRequires: php-composer(%{gh_owner}/zend-cache) >= 2.7.2
-BuildRequires: php-composer(%{gh_owner}/zend-db) >= 2.8.2
-BuildRequires: php-composer(%{gh_owner}/zend-http) >= 2.7
-BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.8
-BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.10.1
+BuildRequires: php-autoloader(%{gh_owner}/zend-cache) >= 2.7.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-db) >= 2.8.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-http) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.8
+BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.10.1
%if 0%{?fedora} >= 26
%global phpunit %{_bindir}/phpunit6
%else
%global phpunit %{_bindir}/phpunit
%endif
BuildRequires: %{phpunit}
-# Because of boostraped Db
-BuildRequires: php-composer(%{gh_owner}/zend-eventmanager) >= 2.5
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
@@ -78,10 +76,10 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
# "zendframework/zend-stdlib": "^2.7.7 || ^3.1"
Requires: php(language) >= 5.6
%if ! %{bootstrap}
-Requires: php-composer(%{gh_owner}/zend-escaper) >= 2.5.2
-Requires: php-composer(%{gh_owner}/zend-escaper) < 3
-Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.7
-Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
+Requires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.5.2
+Requires: php-autoloader(%{gh_owner}/zend-escaper) < 3
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7.7
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4
# From composer, "suggest": {
# "psr/http-message": "PSR-7 ^1.0.1, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator",
# "zendframework/zend-cache": "Zend\\Cache component, for optionally caching feeds between requests",
@@ -92,13 +90,15 @@ Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
Requires: php-composer(psr/http-message) < 2
Requires: php-composer(psr/http-message) >= 1.0.1
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-cache)
-Suggests: php-composer(%{gh_owner}/zend-db)
-Suggests: php-composer(%{gh_owner}/zend-http)
-Suggests: php-composer(%{gh_owner}/zend-servicemanager)
-Suggests: php-composer(%{gh_owner}/zend-validator)
+Suggests: php-autoloader(%{gh_owner}/zend-cache)
+Suggests: php-autoloader(%{gh_owner}/zend-db)
+Suggests: php-autoloader(%{gh_owner}/zend-http)
+Suggests: php-autoloader(%{gh_owner}/zend-servicemanager)
+Suggests: php-autoloader(%{gh_owner}/zend-validator)
%endif
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.6.0
Requires: php-ctype
Requires: php-date
@@ -112,6 +112,7 @@ Requires: php-tidy
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
@@ -129,15 +130,30 @@ Documentation: https://zendframework.github.io/%{gh_project}/
mv LICENSE.md LICENSE
-: Create dependency autoloader
+
+%build
+: Create dependency autoloader - deprecated
cat << 'EOF' | tee autoload.php
<?php
require_once '%{php_home}/Psr/Http/Message/autoload.php';
EOF
-
-%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/Escaper/autoload.php',
+ '%{php_home}/Zend/Stdlib/autoload.php',
+ '%{php_home}/Psr/Http/Message/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Cache/autoload.php',
+ '%{php_home}/Zend/Db/autoload.php',
+ '%{php_home}/Zend/Http/autoload.php',
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+ '%{php_home}/Zend/Validator/autoload.php',
+]);
+EOF
%install
@@ -152,16 +168,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
-define('RPM_BUILDROOT', '%{buildroot}%{php_home}/Zend');
-
-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
@@ -187,6 +195,9 @@ exit $ret
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 2.9.0-2
+- switch from zend-loader to fedora/autoloader
+
* Tue Dec 5 2017 Remi Collet <remi@remirepo.net> - 2.9.0-1
- Update to 2.9.0
- raise dependency on zend-escaper 2.5.2