From b10d702d0e9fd0c56655d54fd07affeafa5c64c8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 26 Apr 2018 06:53:35 +0200 Subject: switch from zend-loader to fedora/autoloader --- php-zendframework-zend-eventmanager.spec | 39 +++++++++++++++++++------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'php-zendframework-zend-eventmanager.spec') 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 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 - 3.2.0-3 +- switch from zend-loader to fedora/autoloader + * Wed Jul 12 2017 Remi Collet - 3.2.0-1 - Update to 3.2.0 - use phpunit6 on F26+ -- cgit