summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--689a0a89e03786d02718f96db269fc04b5d24d65.patch24
-rw-r--r--php-horde-Horde-History.spec29
3 files changed, 49 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9aa8c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/689a0a89e03786d02718f96db269fc04b5d24d65.patch b/689a0a89e03786d02718f96db269fc04b5d24d65.patch
new file mode 100644
index 0000000..d1806e9
--- /dev/null
+++ b/689a0a89e03786d02718f96db269fc04b5d24d65.patch
@@ -0,0 +1,24 @@
+From 689a0a89e03786d02718f96db269fc04b5d24d65 Mon Sep 17 00:00:00 2001
+From: Jan Schneider <jan@horde.org>
+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/History/Log.php | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/Horde/History/Log.php b/lib/Horde/History/Log.php
+index b60389f..4083fa7 100644
+--- a/lib/Horde/History/Log.php
++++ b/lib/Horde/History/Log.php
+@@ -36,8 +36,7 @@ public function __construct($uid, $data = array())
+ return;
+ }
+
+- reset($data);
+- while (list(,$row) = each($data)) {
++ foreach ($data as $row) {
+ $history = array(
+ 'action' => $row['history_action'],
+ 'desc' => $row['history_desc'],
diff --git a/php-horde-Horde-History.spec b/php-horde-Horde-History.spec
index 6e570b9..b9e4373 100644
--- a/php-horde-Horde-History.spec
+++ b/php-horde-Horde-History.spec
@@ -13,7 +13,7 @@
Name: php-horde-Horde-History
Version: 2.3.6
-Release: 1%{?dist}
+Release: 4%{?dist}
Summary: API for tracking the history of an object
Group: Development/Libraries
@@ -21,7 +21,8 @@ License: LGPLv2
URL: http://%{pear_channel}
Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+Patch0: https://github.com/horde/History/commit/689a0a89e03786d02718f96db269fc04b5d24d65.patch
+
BuildArch: noarch
BuildRequires: php(language) >= 5.3.0
BuildRequires: php-pear(PEAR) >= 1.7.0
@@ -57,7 +58,9 @@ of data in Horde applications.
%setup -q -c
cd %{pear_name}-%{version}
-mv ../package.xml %{name}.xml
+%patch0 -p1 -b .upstream
+
+sed -e 's/md5sum="[^"]*"//' ../package.xml >%{name}.xml
%build
@@ -66,7 +69,6 @@ cd %{pear_name}-%{version}
%install
-rm -rf %{buildroot}
cd %{pear_name}-%{version}
%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
@@ -78,17 +80,18 @@ mkdir -p %{buildroot}%{pear_xmldir}
install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
-%clean
-rm -rf %{buildroot}
%check
cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g)
-%{_bindir}/phpunit .
-if which php70; then
- php70 %{_bindir}/phpunit .
-fi
+ret=0
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit . || ret=1
+ fi
+done
+exit $ret
%post
@@ -103,16 +106,18 @@ fi
%files
-%defattr(-,root,root,-)
%doc %{pear_docdir}/%{pear_name}
%{pear_xmldir}/%{name}.xml
%{pear_phpdir}/Horde/History
%{pear_phpdir}/Horde/History.php
%{pear_datadir}/%{pear_name}
-%{pear_testdir}/%{pear_name}
+%doc %{pear_testdir}/%{pear_name}
%changelog
+* Tue Dec 19 2017 Remi Collet <remi@remirepo.net> - 2.3.6-4
+- Fix FTBFS from Koschei, add upstream patch for PHP 7.2
+
* Tue Feb 02 2016 Remi Collet <remi@fedoraproject.org> - 2.3.6-1
- Update to 2.3.6
- PHP 7 compatible version