From c1bed52831bf6ec9ce933dab813312154ee77a4a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 9 Jan 2020 14:20:13 +0100 Subject: switch to Laminas --- php-laminas-uri.spec | 130 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 83 insertions(+), 47 deletions(-) (limited to 'php-laminas-uri.spec') diff --git a/php-laminas-uri.spec b/php-laminas-uri.spec index f2ad12c..2a3f4f3 100644 --- a/php-laminas-uri.spec +++ b/php-laminas-uri.spec @@ -1,4 +1,4 @@ -# remirepo/Fedora spec file for php-zendframework-zend-uri +# remirepo/Fedora spec file for php-laminas-uri # # Copyright (c) 2015-2020 Remi Collet # License: CC-BY-SA @@ -7,11 +7,14 @@ # Please, preserve the changelog entries # %global bootstrap 0 -%global gh_commit bfc4a5b9a309711e968d7c72afae4ac50c650083 +%global gh_commit 6be8ce19622f359b048ce4faebf1aa1bca73a7ff %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner zendframework -%global gh_project zend-uri +%global gh_owner laminas +%global gh_project laminas-uri +%global zf_name zend-uri +%global namespace Laminas %global php_home %{_datadir}/php + %global library Uri %if %{bootstrap} %global with_tests 0%{?_with_tests:1} @@ -19,16 +22,19 @@ %global with_tests 0%{!?_without_tests:1} %endif -Name: php-%{gh_owner}-%{gh_project} +Name: php-%{gh_project} Version: 2.7.1 -Release: 2%{?dist} -Summary: Zend Framework %{library} component +Release: 1%{?dist} +Summary: %{namespace} Framework %{library} component License: BSD -URL: https://zendframework.github.io/%{gh_project}/ +URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh +Patch0: https://github.com/laminas/laminas-uri/commit/dd2561ed82692212fca4d71ec94a58bae04a1524.patch +Patch1: https://patch-diff.githubusercontent.com/raw/laminas/laminas-uri/pull/8.patch + BuildArch: noarch # Tests %if %{with_tests} @@ -36,67 +42,69 @@ BuildRequires: php(language) >= 5.6 BuildRequires: php-pcre BuildRequires: php-spl # From composer, "require-dev": { -# "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4", -# "zendframework/zend-coding-standard": "~1.0.0" +# "laminas/laminas-coding-standard": "~1.0.0", +# "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4" # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires: (php-autoloader(%{gh_owner}/zend-escaper) >= 2.5 with php-autoloader(%{gh_owner}/zend-escaper) < 3) -BuildRequires: (php-autoloader(%{gh_owner}/zend-validator) >= 2.10 with php-autoloader(%{gh_owner}/zend-validator) < 3) -%global phpunit %{_bindir}/phpunit7 -BuildRequires: phpunit7 >= 7.1.4 -# remirepo:8 +BuildRequires: (php-autoloader(%{gh_owner}/laminas-escaper) >= 2.5 with php-autoloader(%{gh_owner}/laminas-escaper) < 3) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-validator) >= 2.10 with php-autoloader(%{gh_owner}/laminas-validator) < 3) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2) +# remirepo:5 %else -BuildRequires: php-autoloader(%{gh_owner}/zend-escaper) < 3 -BuildRequires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.5 -BuildRequires: php-autoloader(%{gh_owner}/zend-validator) < 3 -BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.10 -%global phpunit %{_bindir}/phpunit6 -BuildRequires: phpunit6 >= 6.5.8 +BuildRequires: php-laminas-escaper +BuildRequires: php-laminas-validator +BuildRequires: php-laminas-zendframework-bridge %endif +%global phpunit %{_bindir}/phpunit7 +BuildRequires: phpunit7 >= 7.1.4 %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": "^5.6 || ^7.0", -# "zendframework/zend-escaper": "^2.5", -# "zendframework/zend-validator": "^2.10" +# "laminas/laminas-escaper": "^2.5", +# "laminas/laminas-validator": "^2.10", +# "laminas/laminas-zendframework-bridge": "^1.0" Requires: php(language) >= 5.6 -%if ! %{bootstrap} # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-autoloader(%{gh_owner}/zend-escaper) >= 2.5 with php-autoloader(%{gh_owner}/zend-escaper) < 3) -Requires: (php-autoloader(%{gh_owner}/zend-validator) >= 2.10 with php-autoloader(%{gh_owner}/zend-validator) < 3) -# remirepo:6 +Requires: (php-autoloader(%{gh_owner}/laminas-escaper) >= 2.5 with php-autoloader(%{gh_owner}/laminas-escaper) < 3) +Requires: (php-autoloader(%{gh_owner}/laminas-validator) >= 2.10 with php-autoloader(%{gh_owner}/laminas-validator) < 3) +Requires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2) +# remirepo:5 %else -Requires: php-autoloader(%{gh_owner}/zend-escaper) < 3 -Requires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.5 -Requires: php-autoloader(%{gh_owner}/zend-validator) < 3 -Requires: php-autoloader(%{gh_owner}/zend-validator) >= 2.10 -%endif +Requires: php-laminas-escaper +Requires: php-laminas-validator +Requires: php-laminas-zendframework-bridge %endif # Autoloader Requires: php-composer(fedora/autoloader) -# From phpcompatinfo report for version 2.5.2 +# From phpcompatinfo report for version 2.7.1 Requires: php-pcre Requires: php-spl -Obsoletes: php-ZendFramework2-%{library} < 2.5 -Provides: php-ZendFramework2-%{library} = %{version} -Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +# Compatibily ensure by the bridge +Obsoletes: php-zendframework-%{zf_name} < 2.7.1-99 +Provides: php-zendframework-%{zf_name} = %{version}-99 +Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-composer(zendframework/%{zf_name}) = %{version} Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(zendframework/%{zf_name}) = %{version} %description -Zend\Uri is a component that aids in manipulating and validating Uniform -Resource Identifiers (URIs). Zend\Uri exists primarily to service other -components, such as Zend\Http, but is also useful as a standalone utility. +%{namespace}\Uri is a component that aids in manipulating and validating Uniform +Resource Identifiers (URIs). %{namespace}\Uri exists primarily to service other +components, such as %{namespace}\Http, but is also useful as a standalone utility. -Documentation: https://zendframework.github.io/%{gh_project}/ +Documentation: https://docs.laminas.dev/%{gh_project}/ %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 +%patch1 -p1 mv LICENSE.md LICENSE @@ -106,15 +114,29 @@ mv LICENSE.md LICENSE 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/Validator/autoload.php', + '%{php_home}/%{namespace}/Escaper/autoload.php', + '%{php_home}/%{namespace}/Validator/autoload.php', +]); +EOF + +cat << 'EOF' | tee zf.php + - 2.7.1-1 +- switch to Laminas +- add patches for PHP 7.4 from upstream and from + https://github.com/laminas/laminas-uri/pull/8 + * Tue Oct 8 2019 Remi Collet - 2.7.1-1 - update to 2.7.1 -- cgit