summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-01-09 14:20:13 +0100
committerRemi Collet <remi@remirepo.net>2020-01-09 14:20:13 +0100
commitc1bed52831bf6ec9ce933dab813312154ee77a4a (patch)
tree631294a45a52bdbc036dc81eba1ab0931ed65b02
parent57c016dafece66473a3654c8b9ad94a34265d723 (diff)
switch to Laminas
-rw-r--r--8.patch28
-rw-r--r--composer.json52
-rw-r--r--dd2561ed82692212fca4d71ec94a58bae04a1524.patch29
-rw-r--r--php-laminas-uri.spec130
4 files changed, 168 insertions, 71 deletions
diff --git a/8.patch b/8.patch
new file mode 100644
index 0000000..23ffddc
--- /dev/null
+++ b/8.patch
@@ -0,0 +1,28 @@
+From 353a7eb58cb1d159979d8a5d181324ef4a8b91d8 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 9 Jan 2020 14:13:48 +0100
+Subject: [PATCH] rewrite testRegisteringNewScheme for 7.4
+
+---
+ test/UriFactoryTest.php | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/test/UriFactoryTest.php b/test/UriFactoryTest.php
+index 9828d1b..a9cbf7d 100644
+--- a/test/UriFactoryTest.php
++++ b/test/UriFactoryTest.php
+@@ -29,11 +29,11 @@ class UriFactoryTest extends TestCase
+ */
+ public function testRegisteringNewScheme($scheme, $class)
+ {
+- $this->assertAttributeNotContains($class, 'schemeClasses', '\Laminas\Uri\UriFactory');
++ $this->assertNull(UriFactory::getRegisteredSchemeClass($scheme));
+ UriFactory::registerScheme($scheme, $class);
+- $this->assertAttributeContains($class, 'schemeClasses', '\Laminas\Uri\UriFactory');
++ $this->assertEquals(UriFactory::getRegisteredSchemeClass($scheme), $class);
+ UriFactory::unregisterScheme($scheme);
+- $this->assertAttributeNotContains($class, 'schemeClasses', '\Laminas\Uri\UriFactory');
++ $this->assertNull(UriFactory::getRegisteredSchemeClass($scheme));
+ }
+
+ /**
diff --git a/composer.json b/composer.json
index 93b7461..4bc1c35 100644
--- a/composer.json
+++ b/composer.json
@@ -1,46 +1,47 @@
{
- "name": "zendframework/zend-uri",
+ "name": "laminas/laminas-uri",
"description": "A component that aids in manipulating and validating \u00bb Uniform Resource Identifiers (URIs)",
"license": "BSD-3-Clause",
"keywords": [
- "zf",
- "zendframework",
+ "laminas",
"uri"
],
+ "homepage": "https://laminas.dev",
"support": {
- "docs": "https://docs.zendframework.com/zend-uri/",
- "issues": "https://github.com/zendframework/zend-uri/issues",
- "source": "https://github.com/zendframework/zend-uri",
- "rss": "https://github.com/zendframework/zend-uri/releases.atom",
- "chat": "https://zendframework-slack.herokuapp.com",
- "forum": "https://discourse.zendframework.com/c/questions/components"
+ "docs": "https://docs.laminas.dev/laminas-uri/",
+ "issues": "https://github.com/laminas/laminas-uri/issues",
+ "source": "https://github.com/laminas/laminas-uri",
+ "rss": "https://github.com/laminas/laminas-uri/releases.atom",
+ "chat": "https://laminas.dev/chat",
+ "forum": "https://discourse.laminas.dev"
+ },
+ "config": {
+ "sort-packages": true
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.7.x-dev",
+ "dev-develop": "2.8.x-dev"
+ }
},
"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"
},
"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"
},
"autoload": {
"psr-4": {
- "Zend\\Uri\\": "src/"
+ "Laminas\\Uri\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
- "ZendTest\\Uri\\": "test/"
- }
- },
- "config": {
- "sort-packages": true
- },
- "extra": {
- "branch-alias": {
- "dev-master": "2.7.x-dev",
- "dev-develop": "2.8.x-dev"
+ "LaminasTest\\Uri\\": "test/"
}
},
"scripts": {
@@ -52,5 +53,8 @@
"cs-fix": "phpcbf",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
+ },
+ "replace": {
+ "zendframework/zend-uri": "self.version"
}
}
diff --git a/dd2561ed82692212fca4d71ec94a58bae04a1524.patch b/dd2561ed82692212fca4d71ec94a58bae04a1524.patch
new file mode 100644
index 0000000..2c52069
--- /dev/null
+++ b/dd2561ed82692212fca4d71ec94a58bae04a1524.patch
@@ -0,0 +1,29 @@
+From dd2561ed82692212fca4d71ec94a58bae04a1524 Mon Sep 17 00:00:00 2001
+From: Fahl-Design <Fahl-Design@users.noreply.github.com>
+Date: Fri, 3 Jan 2020 22:56:03 +0100
+Subject: [PATCH] Fix FileTest::testCanCreateUriObjectFromWindowsPath
+
+with data set #0 ('C:\Program Files\Laminas\README', 'C:/Program%20Files/Laminas%20...README')
+Failed asserting that two strings are equal.
+--- Expected
++++ Actual
+-'C:/Program%20Files/Laminas%20Framework/README'
++'C:/Program%20Files/Laminas/README'
+laminas/laminas-uri/test/FileTest.php:201
+---
+ test/FileTest.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/FileTest.php b/test/FileTest.php
+index b37d1dd..aca6f27 100644
+--- a/test/FileTest.php
++++ b/test/FileTest.php
+@@ -87,7 +87,7 @@ public static function unixUris()
+ public static function windowsUris()
+ {
+ return [
+- ['C:\Program Files\Laminas\README', 'C:/Program%20Files/Laminas%20Framework/README'],
++ ['C:\Program Files\Laminas\README', 'C:/Program%20Files/Laminas/README'],
+ ];
+ }
+
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
+<?php
+require_once '%{php_home}/Fedora/Autoloader/autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/%{namespace}/ZendFrameworkBridge/autoload.php',
+ dirname(dirname(__DIR__)) . '/%{namespace}/%{library}/autoload.php',
]);
EOF
%install
-mkdir -p %{buildroot}%{php_home}/Zend/
-cp -pr src %{buildroot}%{php_home}/Zend/%{library}
+: Laminas library
+mkdir -p %{buildroot}%{php_home}/%{namespace}/
+cp -pr src %{buildroot}%{php_home}/%{namespace}/%{library}
+
+: Zend equiv
+mkdir -p %{buildroot}%{php_home}/Zend/%{library}
+cp -pr zf.php %{buildroot}%{php_home}/Zend/%{library}/autoload.php
%check
@@ -122,12 +144,19 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
-require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
+require_once '%{buildroot}%{php_home}/%{namespace}/%{library}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('%{namespace}Test\\%{library}\\', dirname(__DIR__) . '/test');
EOF
+: check compat autoloader
+php -r '
+require "%{buildroot}%{php_home}/Zend/%{library}/autoload.php";
+return (class_exists("\\Zend\\%{library}\\StorageFactory") ? 0 : 1);
+'
+
+: upstream test suite
ret=0
-for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit6" php71 php72 php73 php74; do
+for cmdarg in "php %{phpunit}" php72 php73 php74; do
if which $cmdarg; then
set $cmdarg
$1 ${2:-%{_bindir}/phpunit7} --verbose || ret=1
@@ -140,14 +169,21 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc composer.json
%{php_home}/Zend/%{library}
+%{php_home}/%{namespace}/%{library}
%changelog
+* Thu Jan 9 2020 Remi Collet <remi@remirepo.net> - 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 <remi@remirepo.net> - 2.7.1-1
- update to 2.7.1