summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch58
-rw-r--r--php-horde-Horde-Date-Parser.spec11
2 files changed, 67 insertions, 2 deletions
diff --git a/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch b/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
new file mode 100644
index 0000000..75c3672
--- /dev/null
+++ b/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
@@ -0,0 +1,58 @@
+From d197a50a3b6d8a74a9f690d75ef595d4b5b6fa27 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Mon, 27 Jun 2016 07:28:40 +0200
+Subject: [PATCH 2/2] drop ereg dep for php 7 in Date_Parser
+
+---
+ .../lib/Horde/Date/Parser/Locale/Pt.php | 28 +++++++++++-----------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Pt.php b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Pt.php
+index 53ab624..77bf7eb 100644
+--- a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Pt.php
++++ b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Pt.php
+@@ -130,14 +130,14 @@ class Horde_Date_Parser_Locale_Pt extends Horde_Date_Parser_Locale_Base
+ public function normalize_special_characters( $str )
+ {
+ # Quotes cleanup
+- $str = ereg_replace( chr(ord("`")), "'", $str ); # `
+- $str = ereg_replace( chr(ord("´")), "'", $str ); # ´
+- $str = ereg_replace( chr(ord("„")), ",", $str ); # „
+- $str = ereg_replace( chr(ord("`")), "'", $str ); # `
+- $str = ereg_replace( chr(ord("´")), "'", $str ); # ´
+- $str = ereg_replace( chr(ord("“")), "\"", $str ); # “
+- $str = ereg_replace( chr(ord("”")), "\"", $str ); # ”
+- $str = ereg_replace( chr(ord("´")), "'", $str ); # ´
++ $str = str_replace( chr(ord("`")), "'", $str ); # `
++ $str = str_replace( chr(ord("´")), "'", $str ); # ´
++ $str = str_replace( chr(ord("„")), ",", $str ); # „
++ $str = str_replace( chr(ord("`")), "'", $str ); # `
++ $str = str_replace( chr(ord("´")), "'", $str ); # ´
++ $str = str_replace( chr(ord("“")), "\"", $str ); # “
++ $str = str_replace( chr(ord("”")), "\"", $str ); # ”
++ $str = str_replace( chr(ord("´")), "'", $str ); # ´
+
+ $unwanted_array = array('Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
+ 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U',
+@@ -147,12 +147,12 @@ class Horde_Date_Parser_Locale_Pt extends Horde_Date_Parser_Locale_Base
+ $str = strtr( $str, $unwanted_array );
+
+ # Bullets, dashes, and trademarks
+- $str = ereg_replace( chr(149), "&#8226;", $str ); # bullet •
+- $str = ereg_replace( chr(150), "&ndash;", $str ); # en dash
+- $str = ereg_replace( chr(151), "&mdash;", $str ); # em dash
+- $str = ereg_replace( chr(153), "&#8482;", $str ); # trademark
+- $str = ereg_replace( chr(169), "&copy;", $str ); # copyright mark
+- $str = ereg_replace( chr(174), "&reg;", $str ); # registration mark
++ $str = str_replace( chr(149), "&#8226;", $str ); # bullet •
++ $str = str_replace( chr(150), "&ndash;", $str ); # en dash
++ $str = str_replace( chr(151), "&mdash;", $str ); # em dash
++ $str = str_replace( chr(153), "&#8482;", $str ); # trademark
++ $str = str_replace( chr(169), "&copy;", $str ); # copyright mark
++ $str = str_replace( chr(174), "&reg;", $str ); # registration mark
+
+ return $str;
+ }
+--
+2.5.5
+
diff --git a/php-horde-Horde-Date-Parser.spec b/php-horde-Horde-Date-Parser.spec
index 4ed18b5..854d057 100644
--- a/php-horde-Horde-Date-Parser.spec
+++ b/php-horde-Horde-Date-Parser.spec
@@ -12,7 +12,7 @@
Name: php-horde-Horde-Date-Parser
Version: 2.0.5
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Horde Date Parser
Group: Development/Libraries
@@ -20,6 +20,8 @@ License: LGPLv2
URL: http://pear.horde.org
Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
+Patch0: 0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php(language) >= 5.3.0
@@ -32,7 +34,6 @@ Requires(post): %{__pear}
Requires(postun): %{__pear}
Requires: php(language) >= 5.3.0
Requires: php-date
-Requires: php-ereg
Requires: php-pcre
Requires: php-spl
Requires: php-pear(PEAR) >= 1.7.0
@@ -58,6 +59,9 @@ languages and locales
cd %{pear_name}-%{version}
mv ../package.xml %{name}.xml
+%patch0 -p3 -b .ereg
+sed -e '/Pt.php/s/md5sum="[^"]*"//' \
+ -i %{name}.xml
%build
@@ -107,6 +111,9 @@ fi
%changelog
+* Mon Jun 27 2016 Remi Collet <remi@fedoraproject.org> - 2.0.5-2
+- add patch to drop dependency on ereg
+
* Tue Feb 02 2016 Remi Collet <remi@fedoraproject.org> - 2.0.5-1
- Update to 2.0.5
- PHP 7 compatible version