From 5a3fc65daa292b066dac5d9869ac8fb81d80bbfd Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 12 Oct 2017 18:15:48 +0200 Subject: add upstream patch for PHP 7.2, FTBFS from Koschei --- .gitignore | 8 ++++++ 5efb632b7a3a2fa76cf3ee76df650f1f2317a206.patch | 26 +++++++++++++++++++ php-horde-Horde-Kolab-Server.spec | 35 +++++++++++++++----------- 3 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 .gitignore create mode 100644 5efb632b7a3a2fa76cf3ee76df650f1f2317a206.patch 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/5efb632b7a3a2fa76cf3ee76df650f1f2317a206.patch b/5efb632b7a3a2fa76cf3ee76df650f1f2317a206.patch new file mode 100644 index 0000000..e85fe56 --- /dev/null +++ b/5efb632b7a3a2fa76cf3ee76df650f1f2317a206.patch @@ -0,0 +1,26 @@ +From 5efb632b7a3a2fa76cf3ee76df650f1f2317a206 Mon Sep 17 00:00:00 2001 +From: Jan Schneider +Date: Fri, 25 Nov 2016 09:40:34 +0100 +Subject: [PATCH] Fix count() usage. + +Detected by PHP 7.2. count() should only be passed arrays and Countables. +--- + lib/Horde/Kolab/Server/Ldap/Changes.php | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/lib/Horde/Kolab/Server/Ldap/Changes.php b/lib/Horde/Kolab/Server/Ldap/Changes.php +index 84a6ea0..348631f 100644 +--- a/lib/Horde/Kolab/Server/Ldap/Changes.php ++++ b/lib/Horde/Kolab/Server/Ldap/Changes.php +@@ -77,9 +77,8 @@ public function getChangeset() + $cs['delete'][] = $attribute; + continue; + } +- if (count($new[$attribute]) == 1 +- && count($old[$attribute]) == 1 +- ) { ++ if ((!is_array($new[$attribute]) || count($new[$attribute]) == 1) && ++ (!is_array($old[$attribute]) || count($old[$attribute]) == 1)) { + if ($new[$attribute][0] == $old[$attribute][0]) { + continue; + } else { diff --git a/php-horde-Horde-Kolab-Server.spec b/php-horde-Horde-Kolab-Server.spec index 92b0ff7..2d4bba7 100644 --- a/php-horde-Horde-Kolab-Server.spec +++ b/php-horde-Horde-Kolab-Server.spec @@ -12,7 +12,7 @@ Name: php-horde-Horde-Kolab-Server Version: 2.0.5 -Release: 1%{?dist} +Release: 4%{?dist} Summary: A package for manipulating the Kolab user database Group: Development/Libraries @@ -20,7 +20,8 @@ License: LGPLv2 URL: http://%{pear_channel}/ Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0: https://github.com/horde/Kolab_Server/commit/5efb632b7a3a2fa76cf3ee76df650f1f2317a206.patch + BuildArch: noarch BuildRequires: php-pear(PEAR) >= 1.7.0 BuildRequires: php-channel(%{pear_channel}) @@ -53,7 +54,11 @@ This package reads/writes entries in the Kolab user database stored in LDAP. %prep %setup -q -c cd %{pear_name}-%{version} -mv ../package.xml %{name}.xml +%patch0 -p1 -b .upstream + +sed -e '/Changes.php/s/md5sum=.*name=/name=/' \ + ../package.xml >%{name}.xml +touch -r ../package.xml %{name}.xml %build @@ -62,7 +67,6 @@ cd %{pear_name}-%{version} %install -rm -rf %{buildroot} cd %{pear_name}-%{version} %{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml @@ -76,15 +80,14 @@ install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} %check cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g) -%{_bindir}/phpunit . - -if which php70; then - php70 %{_bindir}/phpunit . -fi - -%clean -rm -rf %{buildroot} +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 @@ -99,15 +102,17 @@ fi %files -%defattr(-,root,root,-) %doc %{pear_docdir}/%{pear_name} %{pear_xmldir}/%{name}.xml %dir %{pear_phpdir}/Horde/Kolab %{pear_phpdir}/Horde/Kolab/Server -%{pear_testdir}/%{pear_name} +%doc %{pear_testdir}/%{pear_name} %changelog +* Thu Oct 12 2017 Remi Collet - 2.1.4-1 +- add upstream patch for PHP 7.2, FTBFS from Koschei + * Tue Feb 02 2016 Remi Collet - 2.0.5-1 - Update to 2.0.5 - PHP 7 compatible version @@ -123,4 +128,4 @@ fi - raise dependency on Horde_Test 2.4.0 * Thu Mar 28 2013 Remi Collet - 2.0.2-1 -- initial package \ No newline at end of file +- initial package -- cgit