summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-10-17 13:01:13 +0200
committerRemi Collet <remi@remirepo.net>2019-10-17 13:01:13 +0200
commit87b2b51093acc2c8f202fc2ce26c82602a1d0ff4 (patch)
treec4684d590cf3cec5d155c86ace007975e65b1735
parente1c6ea99720ec4f1f22eca2b28e3fc420ef26c68 (diff)
- add patch for PHP 7.4 from
https://github.com/horde/Date_Parser/pull/1 - use range dependencies
-rw-r--r--1.patch22
-rw-r--r--php-horde-Horde-Date-Parser.spec29
2 files changed, 47 insertions, 4 deletions
diff --git a/1.patch b/1.patch
new file mode 100644
index 0000000..8fc91ff
--- /dev/null
+++ b/1.patch
@@ -0,0 +1,22 @@
+From 7575d9125f00f03b3ca644f4be6d1857f4311dd2 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 17 Oct 2019 12:39:10 +0200
+Subject: [PATCH] Fix Trying to access array offset on value of type null
+
+---
+ lib/Horde/Date/Parser/Token.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Horde/Date/Parser/Token.php b/lib/Horde/Date/Parser/Token.php
+index fcb8537..0d59994 100644
+--- a/lib/Horde/Date/Parser/Token.php
++++ b/lib/Horde/Date/Parser/Token.php
+@@ -74,7 +74,7 @@ function ($t) use ($tagClass) {
+ }
+ );
+ $match = array_shift($matches);
+- return $match[1];
++ return (is_array($match) ? $match[1] : null);
+ }
+
+ /**
diff --git a/php-horde-Horde-Date-Parser.spec b/php-horde-Horde-Date-Parser.spec
index 6cba16f..1749261 100644
--- a/php-horde-Horde-Date-Parser.spec
+++ b/php-horde-Horde-Date-Parser.spec
@@ -1,6 +1,6 @@
# remirepo/fedora spec file for php-horde-Horde-Date-Parser
#
-# Copyright (c) 2013-2017 Remi Collet
+# Copyright (c) 2013-2019 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -12,22 +12,31 @@
Name: php-horde-Horde-Date-Parser
Version: 2.0.6
-Release: 4%{?dist}
+Release: 9%{?dist}
Summary: Horde Date Parser
-Group: Development/Libraries
License: LGPLv2
URL: http://pear.horde.org
Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
Patch0: https://github.com/horde/Date_Parser/commit/b452b5aa962b21316492c762639b6b4b659c8c6e.patch
+Patch1: https://patch-diff.githubusercontent.com/raw/horde/Date_Parser/pull/1.patch
BuildArch: noarch
BuildRequires: php(language) >= 5.3.0
BuildRequires: php-pear(PEAR) >= 1.7.0
BuildRequires: php-channel(%{pear_channel})
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-pear(%{pear_channel}/Horde_Test) >= 2.1.0 with php-pear(%{pear_channel}/Horde_Test) < 3)
+BuildRequires: (php-pear(%{pear_channel}/Horde_Date) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Date) < 3)
+BuildRequires: (php-pear(%{pear_channel}/Horde_Support) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Support) < 3)
+BuildRequires: (php-pear(%{pear_channel}/Horde_Util) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Util) < 3)
+%else
BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.1.0
BuildRequires: php-pear(%{pear_channel}/Horde_Date) >= 2.0.0
+BuildRequires: php-pear(%{pear_channel}/Horde_Support) >= 2.0.0
+BuildRequires: php-pear(%{pear_channel}/Horde_Util) >= 2.0.0
+%endif
Requires(post): %{__pear}
Requires(postun): %{__pear}
@@ -37,12 +46,18 @@ Requires: php-pcre
Requires: php-spl
Requires: php-pear(PEAR) >= 1.7.0
Requires: php-channel(%{pear_channel})
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-pear(%{pear_channel}/Horde_Date) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Date) < 3)
+Requires: (php-pear(%{pear_channel}/Horde_Support) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Support) < 3)
+Requires: (php-pear(%{pear_channel}/Horde_Util) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Util) < 3)
+%else
Requires: php-pear(%{pear_channel}/Horde_Date) >= 2.0.0
Requires: php-pear(%{pear_channel}/Horde_Date) < 3.0.0
Requires: php-pear(%{pear_channel}/Horde_Support) >= 2.0.0
Requires: php-pear(%{pear_channel}/Horde_Support) < 3.0.0
Requires: php-pear(%{pear_channel}/Horde_Util) >= 2.0.0
Requires: php-pear(%{pear_channel}/Horde_Util) < 3.0.0
+%endif
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
Provides: php-composer(horde/horde-date-parser) = %{version}
@@ -57,6 +72,7 @@ languages and locales
%setup -q -c
cd %{pear_name}-%{version}
%patch0 -p1 -b .upstream
+%patch1 -p1 -b .pr1
sed -e '/Parser/s/md5sum=.*name=/name=/' \
../package.xml >%{name}.xml
@@ -84,7 +100,7 @@ install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g)
ret=0
-for cmd in php php56 php70 php71 php72; do
+for cmd in php php56 php70 php71 php72 php73 php74; do
if which $cmd; then
$cmd %{_bindir}/phpunit . || ret=1
fi
@@ -112,6 +128,11 @@ fi
%changelog
+* Thu Oct 17 2019 Remi Collet <remi@remirepo.net> - 2.0.6-9
+- add patch for PHP 7.4 from
+ https://github.com/horde/Date_Parser/pull/1
+- use range dependencies
+
* Fri Oct 13 2017 Remi Collet <remi@remirepo.net> - 2.0.6-4
- add upstream patch for PHP 7.2, FTBFS from Koschei