From 01ef0638f7a1eb98601701ae1d55343983a7f237 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 16 Dec 2019 09:14:12 +0100 Subject: v2.0.4 --- d64eb3a776eb017caa7a504ac4b4d9608bfcf1cc.patch | 46 -------------------------- php-horde-Horde-Text-Flowed.spec | 33 ++++++++++++------ 2 files changed, 22 insertions(+), 57 deletions(-) delete mode 100644 d64eb3a776eb017caa7a504ac4b4d9608bfcf1cc.patch diff --git a/d64eb3a776eb017caa7a504ac4b4d9608bfcf1cc.patch b/d64eb3a776eb017caa7a504ac4b4d9608bfcf1cc.patch deleted file mode 100644 index 19f3730..0000000 --- a/d64eb3a776eb017caa7a504ac4b4d9608bfcf1cc.patch +++ /dev/null @@ -1,46 +0,0 @@ -From d64eb3a776eb017caa7a504ac4b4d9608bfcf1cc Mon Sep 17 00:00:00 2001 -From: Jan Schneider -Date: Mon, 13 Feb 2017 14:57:35 +0100 -Subject: [PATCH] Don't use each(). - -For modern PHP versions there is no improved performance or memory usage compared to foreach() anymore. Beside that it's deprecated in PHP 7.2. ---- - lib/Horde/Text/Flowed.php | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/lib/Horde/Text/Flowed.php b/lib/Horde/Text/Flowed.php -index fb5befd..b5a6cfe 100644 ---- a/lib/Horde/Text/Flowed.php -+++ b/lib/Horde/Text/Flowed.php -@@ -127,9 +127,8 @@ public function toFixed($quote = false) - $txt = ''; - - $this->_reformat(false, $quote); -- reset($this->_output); - $lines = count($this->_output) - 1; -- while (list($no, $line) = each($this->_output)) { -+ foreach ($this->_output as $no => $line) { - $txt .= $line['text'] . (($lines == $no) ? '' : "\n"); - } - -@@ -172,8 +171,7 @@ public function toFlowed($quote = false, array $opts = array()) - $txt = ''; - - $this->_reformat(true, $quote, empty($opts['nowrap'])); -- reset($this->_output); -- while (list(,$line) = each($this->_output)) { -+ foreach ($this->_output as $line) { - $txt .= $line['text'] . "\n"; - } - -@@ -206,9 +204,8 @@ protected function _reformat($toflowed, $quote, $wrap = true) - $text = preg_split("/\r?\n/", $this->_text); - $text_count = count($text) - 1; - $skip = 0; -- reset($text); - -- while (list($no, $line) = each($text)) { -+ foreach ($text as $no => $line) { - if ($skip) { - --$skip; - continue; diff --git a/php-horde-Horde-Text-Flowed.spec b/php-horde-Horde-Text-Flowed.spec index 7fc2ea6..763739c 100644 --- a/php-horde-Horde-Text-Flowed.spec +++ b/php-horde-Horde-Text-Flowed.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for php-horde-Horde-Text-Flowed # -# Copyright (c) 2012-2017 Nick Bebout, Remi Collet +# Copyright (c) 2012-2019 Nick Bebout, Remi Collet # # License: MIT # https://fedoraproject.org/wiki/Licensing:MIT#Modern_Style_with_sublicense @@ -12,23 +12,26 @@ %global pear_channel pear.horde.org Name: php-horde-Horde-Text-Flowed -Version: 2.0.3 -Release: 4%{?dist} +Version: 2.0.4 +Release: 1%{?dist} Summary: Horde API for flowed text as per RFC 3676 -Group: Development/Libraries License: LGPLv2 URL: http://pear.horde.org Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz -Patch0: https://github.com/horde/Text_Flowed/commit/d64eb3a776eb017caa7a504ac4b4d9608bfcf1cc.patch - BuildArch: noarch BuildRequires: php-pear(PEAR) >= 1.7.0 BuildRequires: php(language) >= 5.3.0 BuildRequires: php-channel(%{pear_channel}) # To run unit tests +%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_Util) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Util) < 3) +%else BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.1.0 +Requires: php-pear(%{pear_channel}/Horde_Util) >= 2.0.0 +%endif Requires(post): %{__pear} Requires(postun): %{__pear} @@ -36,8 +39,12 @@ Requires: php(language) >= 5.3.0 Requires: php-pcre 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_Util) >= 2.0.0 with php-pear(%{pear_channel}/Horde_Util) < 3) +%else 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-text-flowed) = %{version} @@ -52,9 +59,7 @@ using the encoding described in RFC 3676 ('flowed' text). %setup -q -c cd %{pear_name}-%{version} -%patch0 -p1 -b .upstream - -sed -e 's/md5sum="[^"]*"//' ../package.xml >%{name}.xml +mv ../package.xml %{name}.xml %build @@ -78,9 +83,11 @@ 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 --verbose . || ret=1 + $cmd %{_bindir}/phpunit \ + --bootstrap=bootstrap.php \ + --verbose . || ret=1 fi done exit $ret @@ -105,6 +112,10 @@ fi %changelog +* Mon Dec 16 2019 Remi Collet - 2.0.4-1 +- update to 2.0.4 +- use range dependencies + * Tue Dec 19 2017 Remi Collet - 2.0.3-4 - Fix FTBFS from Koschei, add upstream patch for PHP 7.2 -- cgit