summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-13 17:42:03 +0100
committerRemi Collet <remi@remirepo.net>2017-11-13 17:42:03 +0100
commit21065b1ef16b2d361dfc16985560ec0c1866ceb7 (patch)
tree7a262a591e873a8d693d3b65665bc49d4e9d49e9
parenta25ba4a9739b02a29928d7a763248667812149b5 (diff)
fix erratic FTBFS from Koschei, add fix for big endian from https://github.com/horde/Mapi/pull/1
-rw-r--r--0001-fix-for-BigEndian.patch63
-rw-r--r--php-horde-Horde-Mapi.spec36
2 files changed, 85 insertions, 14 deletions
diff --git a/0001-fix-for-BigEndian.patch b/0001-fix-for-BigEndian.patch
new file mode 100644
index 0000000..edce6b1
--- /dev/null
+++ b/0001-fix-for-BigEndian.patch
@@ -0,0 +1,63 @@
+From c562b654bef2bae0ac5b06fa7f1234e35d03e42c Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 13 Nov 2017 17:11:21 +0100
+Subject: [PATCH] fix for BigEndian
+
+---
+ lib/Horde/Mapi/Timezone.php | 5 ++---
+ test/Horde/Mapi/TimezoneTest.php | 6 +++---
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/lib/Horde/Mapi/Timezone.php b/lib/Horde/Mapi/Timezone.php
+index f63cbd1..6ab8a42 100644
+--- a/lib/Horde/Mapi/Timezone.php
++++ b/lib/Horde/Mapi/Timezone.php
+@@ -80,14 +80,13 @@ class Horde_Mapi_Timezone
+ . 'ldstbias';
+ }
+ $tz = unpack($format, base64_decode($data));
+- $tz['timezone'] = $tz['bias'];
+- $tz['timezonedst'] = $tz['dstbias'];
+-
+ if (!Horde_Mapi::isLittleEndian()) {
+ $tz['bias'] = Horde_Mapi::chbo($tz['bias']);
+ $tz['stdbias'] = Horde_Mapi::chbo($tz['stdbias']);
+ $tz['dstbias'] = Horde_Mapi::chbo($tz['dstbias']);
+ }
++ $tz['timezone'] = $tz['bias'];
++ $tz['timezonedst'] = $tz['dstbias'];
+
+ return $tz;
+ }
+diff --git a/test/Horde/Mapi/TimezoneTest.php b/test/Horde/Mapi/TimezoneTest.php
+index 76794fe..52ef5a8 100644
+--- a/test/Horde/Mapi/TimezoneTest.php
++++ b/test/Horde/Mapi/TimezoneTest.php
+@@ -126,7 +126,7 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case
+ foreach ($this->_packed as $tz => $blob) {
+ $offsets = Horde_Mapi_Timezone::getOffsetsFromSyncTZ($blob);
+ foreach ($this->_offsets[$tz] as $key => $value) {
+- $this->assertEquals($value, $offsets[$key]);
++ $this->assertEquals($value, $offsets[$key], "Comparing '$key' for '$tz'");
+ }
+ }
+ }
+@@ -142,7 +142,7 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case
+ $date = new Horde_Date('2011-07-01', $tz);
+ $offsets = Horde_Mapi_Timezone::getOffsetsFromDate($date);
+ foreach ($offsets as $key => $value) {
+- $this->assertEquals($expected[$key], $value);
++ $this->assertEquals($expected[$key], $value, "Comparing '$key' for '$tz'");
+ }
+ }
+ }
+@@ -180,4 +180,4 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case
+ $this->assertEquals('Europe/Berlin', $guessed);
+ }
+
+-}
+\ No newline at end of file
++}
+--
+2.9.5
+
diff --git a/php-horde-Horde-Mapi.spec b/php-horde-Horde-Mapi.spec
index 70c49a4..ac2cb5e 100644
--- a/php-horde-Horde-Mapi.spec
+++ b/php-horde-Horde-Mapi.spec
@@ -12,7 +12,7 @@
Name: php-horde-Horde-Mapi
Version: 1.0.8
-Release: 2%{?dist}
+Release: 5%{?dist}
Summary: MAPI utility library
Group: Development/Libraries
@@ -20,7 +20,12 @@ 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: 0001-fix-for-BigEndian.patch
+
+# remirepo:3
+# For test build on all available arch
+#global debug_package %{nil}
+#global __debug_install_post /bin/true
BuildArch: noarch
BuildRequires: php(language) >= 5.3.0
BuildRequires: php-pear(PEAR) >= 1.7.0
@@ -67,7 +72,9 @@ data.
%setup -q -c
cd %{pear_name}-%{version}
-mv ../package.xml %{name}.xml
+%patch0 -p1 -b .temp
+
+sed -e 's/md5sum="[^"]*"//' ../package.xml >%{name}.xml
%build
@@ -76,7 +83,6 @@ cd %{pear_name}-%{version}
%install
-rm -rf %{buildroot}
cd %{pear_name}-%{version}
%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
@@ -90,15 +96,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
@@ -113,15 +118,18 @@ fi
%files
-%defattr(-,root,root,-)
%doc %{pear_docdir}/%{pear_name}
%{pear_xmldir}/%{name}.xml
%{pear_phpdir}/Horde/Mapi
%{pear_phpdir}/Horde/Mapi.php
-%{pear_testdir}/%{pear_name}
+%doc %{pear_testdir}/%{pear_name}
%changelog
+* Mon Nov 13 2017 Remi Collet <remi@fedoraproject.org> - 1.0.8-5
+- fix erratic FTBFS from Koschei, add fix for big endian from
+ https://github.com/horde/Mapi/pull/1
+
* Mon Dec 5 2016 Remi Collet <remi@fedoraproject.org> - 1.0.8-2
- switch to php-pear(Math_BigInteger) in F26+