From 866a582e4ef2f11590cfa9a8a67dc11cdd3c2f5f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 11 Jan 2016 13:25:36 +0100 Subject: librdkafka: add upstream patch for old glibc --- librdkafka-upstream.patch | 29 +++++++++++++++++++++++++++++ librdkafka.spec | 5 +++++ 2 files changed, 34 insertions(+) create mode 100644 librdkafka-upstream.patch diff --git a/librdkafka-upstream.patch b/librdkafka-upstream.patch new file mode 100644 index 0000000..062a9c3 --- /dev/null +++ b/librdkafka-upstream.patch @@ -0,0 +1,29 @@ +From ac916159a08ccb135a73891dc4e25b7be18223d2 Mon Sep 17 00:00:00 2001 +From: Magnus Edenhill +Date: Mon, 11 Jan 2016 10:22:29 +0100 +Subject: [PATCH] Snappy endian swapping for older glibc 2.9 (issue #505, #407) + +--- + src/snappy_compat.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/snappy_compat.h b/src/snappy_compat.h +index 5167a72..2c2375b 100644 +--- a/src/snappy_compat.h ++++ b/src/snappy_compat.h +@@ -136,10 +136,14 @@ typedef unsigned long long u64; + #define __LITTLE_ENDIAN__ 1 + #endif + +-#if __LITTLE_ENDIAN__ == 1 && (defined(__LSB_VERSION__) || defined(__WIN32__)) ++#if __LITTLE_ENDIAN__ == 1 || defined(__WIN32__) ++#ifndef htole16 + #define htole16(x) (x) ++#endif ++#ifndef le32toh + #define le32toh(x) (x) + #endif ++#endif + + + #if defined(_MSC_VER) diff --git a/librdkafka.spec b/librdkafka.spec index 6843786..778821f 100644 --- a/librdkafka.spec +++ b/librdkafka.spec @@ -23,6 +23,8 @@ License: BSD and MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz +Patch1: %{name}-upstream.patch + # i686 required ExcludeArch: i386 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -55,6 +57,8 @@ developing applications that use %{name}. %prep %setup -qn %{gh_project}-%{gh_commit} +%patch1 -p1 -b .upstream + mkdir rpmdocs cp -pr examples rpmdocs/examples @@ -106,6 +110,7 @@ fi %changelog * Sat Jan 9 2016 Remi Collet - 0.9.0-1 - update to 0.9.0 +- add upstream patch for old glibc (RHEL-5) * Thu May 14 2015 Remi Collet - 0.8.6-1 - initial package \ No newline at end of file -- cgit