summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-12 12:55:31 +0100
committerRemi Collet <remi@remirepo.net>2017-12-12 12:55:31 +0100
commit9f73cf3a4f348b0a754a9904bc03bc22598b0832 (patch)
tree4df35cabc28cd61745af1325801e78947e551462
parent5b8c7b2b9d6d6d71cc83f51b2a73e94042d3b569 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-modulemanager.spec73
1 files changed, 45 insertions, 28 deletions
diff --git a/php-zendframework-zend-modulemanager.spec b/php-zendframework-zend-modulemanager.spec
index 216b589..8460b6b 100644
--- a/php-zendframework-zend-modulemanager.spec
+++ b/php-zendframework-zend-modulemanager.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.8.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -35,9 +35,9 @@ BuildArch: noarch
%if %{with_tests}
BuildRequires: php(language) >= 5.6
BuildRequires: php-spl
-BuildRequires: php-composer(%{gh_owner}/zend-config) >= 2.6
-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.6
+BuildRequires: php-autoloader(%{gh_owner}/zend-eventmanager) >= 2.6.3
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
# From composer, "require-dev": {
# "zendframework/zend-console": "^2.6",
# "zendframework/zend-di": "^2.6",
@@ -57,11 +57,8 @@ BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5
%global phpunit %{_bindir}/phpunit
%endif
BuildRequires: %{phpunit}
-# Because of bootstrap
-BuildRequires: php-composer(%{gh_owner}/zend-code) >= 2.5
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
@@ -70,12 +67,12 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
# "zendframework/zend-stdlib": "^3.1 || ^2.7"
Requires: php(language) >= 5.6
%if ! %{bootstrap}
-Requires: php-composer(%{gh_owner}/zend-config) >= 2.6
-Requires: php-composer(%{gh_owner}/zend-config) < 4
-Requires: php-composer(%{gh_owner}/zend-eventmanager) >= 2.6.3
-Requires: php-composer(%{gh_owner}/zend-eventmanager) < 4
-Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
-Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
+Requires: php-autoloader(%{gh_owner}/zend-config) >= 2.6
+Requires: php-autoloader(%{gh_owner}/zend-config) < 4
+Requires: php-autoloader(%{gh_owner}/zend-eventmanager) >= 2.6.3
+Requires: php-autoloader(%{gh_owner}/zend-eventmanager) < 4
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4
# From composer, "suggest": {
# "zendframework/zend-config": "Zend\\Config component",
# "zendframework/zend-console": "Zend\\Console component",
@@ -83,18 +80,21 @@ Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
# "zendframework/zend-mvc": "Zend\\Mvc component",
# "zendframework/zend-servicemanager": "Zend\\ServiceManager component"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-console)
-Suggests: php-composer(%{gh_owner}/zend-loader)
-Suggests: php-composer(%{gh_owner}/zend-mvc)
-Suggests: php-composer(%{gh_owner}/zend-servicemanager)
+Suggests: php-autoloader(%{gh_owner}/zend-console)
+Suggests: php-autoloader(%{gh_owner}/zend-loader)
+Suggests: php-autoloader(%{gh_owner}/zend-mvc)
+Suggests: php-autoloader(%{gh_owner}/zend-servicemanager)
%endif
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.6.1
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
@@ -117,7 +117,21 @@ 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/Config/autoload.php',
+ '%{php_home}/Zend/EventManager/autoload.php',
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Console/autoload.php',
+ '%{php_home}/Zend/Loader/autoload.php',
+ '%{php_home}/Zend/Mvc/autoload.php',
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+]);
+EOF
%install
@@ -130,15 +144,15 @@ 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(
- 'ListenerTestModule' => dirname(__DIR__).'/test/TestAsset/ListenerTestModule/',
- 'ModuleAsClass' => dirname(__DIR__).'/test/TestAsset/ModuleAsClass/',
- 'ZendTest\\%{library}' => dirname(__DIR__).'/test/',
- 'Zend\\%{library}' => '%{buildroot}%{php_home}/Zend/%{library}'
-))));
+require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
+# For BR without new autoloader
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Zend/Di/autoload.php',
+ '%{php_home}/Zend/autoload.php',
+]);
+\Fedora\Autoloader\Autoload::addPsr4('ListenerTestModule', dirname(__DIR__) . '/test/TestAsset/ListenerTestModule');
+\Fedora\Autoloader\Autoload::addPsr4('ModuleAsClass', dirname(__DIR__) . '/test/TestAsset/ModuleAsClass');
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
require_once '%{php_home}/Zend/autoload.php';
require_once __DIR__ . '/../test/autoload.php';
require_once __DIR__ . '/../test/TestAsset/ModuleAsClass.php';
@@ -166,6 +180,9 @@ exit $ret
%changelog
+* Tue Dec 12 2017 Remi Collet <remi@remirepo.net> - 2.8.2-2
+- switch from zend-loader to fedora/autoloader
+
* Mon Dec 4 2017 Remi Collet <remi@remirepo.net> - 2.8.2-1
- Update to 2.8.2