summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-04-26 06:53:35 +0200
committerRemi Collet <remi@remirepo.net>2018-04-26 06:53:35 +0200
commitb10d702d0e9fd0c56655d54fd07affeafa5c64c8 (patch)
tree19a5bd9539721dd8078c48d09c090c06d5ff0f02
parent698303bc675c9dfab4f9b33e0b57dd5fe63d1602 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-eventmanager.spec39
1 files changed, 23 insertions, 16 deletions
diff --git a/php-zendframework-zend-eventmanager.spec b/php-zendframework-zend-eventmanager.spec
index af42fab..0a717ef 100644
--- a/php-zendframework-zend-eventmanager.spec
+++ b/php-zendframework-zend-eventmanager.spec
@@ -1,6 +1,5 @@
-# remirepo/Fedora spec file for php-zendframework-zend-eventmanager
#
-# Copyright (c) 2015-2017 Remi Collet
+# Copyright (c) 2015-2018 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -21,7 +20,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 3.2.0
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: Trigger and listen to events within a PHP application
Group: Development/Libraries
@@ -34,15 +33,15 @@ BuildArch: noarch
# Tests
%if %{with_tests}
BuildRequires: php(language) >= 5.6
+BuildRequires: php-reflection
BuildRequires: php-spl
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5
# From composer, "require-dev": {
# "phpunit/PHPUnit": "^6.0.7 || ^5.7.14",
# "athletic/athletic": "^0.1",
# "zendframework/zend-stdlib": "^2.7.3 || ^3.0",
# "container-interop/container-interop": "^1.1.0",
# "zendframework/zend-coding-standard": "~1.0.0"
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.3
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7.3
BuildRequires: php-composer(container-interop/container-interop) >= 1.1.0
%if 0%{?fedora} >= 26
%global phpunit %{_bindir}/phpunit6
@@ -51,7 +50,7 @@ BuildRequires: php-composer(container-interop/container-interop) >= 1.1.0
%endif
BuildRequires: %{phpunit}
# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
+BuildRequires: php-fedora-autoloader-devel
%endif
# From composer, "require": {
@@ -66,12 +65,16 @@ Suggests: php-composer(container-interop/container-interop)
Suggests: php-composer(%{gh_owner}/zend-stdlib)
%endif
%endif
-# From phpcompatinfo report for version 2.5.2
+# From phpcompatinfo report for version 3.2.0
+Requires: php-reflection
Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
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
@@ -95,7 +98,13 @@ 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}/Interop/Container/autoload.php',
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+EOF
%install
@@ -108,14 +117,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');
require_once __DIR__ . '/../test/_autoload.php';
EOF
@@ -137,10 +140,14 @@ exit $ret
%license LICENSE
%doc *.md
%doc composer.json
+%dir %{php_home}/Zend
%{php_home}/Zend/%{library}
%changelog
+* Thu Nov 23 2017 Remi Collet <remi@fedoraproject.org> - 3.2.0-3
+- switch from zend-loader to fedora/autoloader
+
* Wed Jul 12 2017 Remi Collet <remi@remirepo.net> - 3.2.0-1
- Update to 3.2.0
- use phpunit6 on F26+