From 168f846196a780eb039b625324fb1723501d326c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 20 Dec 2017 14:00:31 +0100 Subject: v2.8.4 from Fedora --- 0004-detect-snappy-version-for-cbc-version.patch | 85 ++++++++++++++++++++++++ libcouchbase.spec | 17 ++++- 2 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 0004-detect-snappy-version-for-cbc-version.patch diff --git a/0004-detect-snappy-version-for-cbc-version.patch b/0004-detect-snappy-version-for-cbc-version.patch new file mode 100644 index 0000000..3438409 --- /dev/null +++ b/0004-detect-snappy-version-for-cbc-version.patch @@ -0,0 +1,85 @@ +From 2f5e7ac51e13dd25b1ea4f40bcead3c90c03daa5 Mon Sep 17 00:00:00 2001 +From: Sergey Avseyev +Date: Wed, 20 Dec 2017 12:49:34 +0300 +Subject: [PATCH] Carefully detect snappy version for cbc-version + +Some snappy builds might not include version information into +snappy-stubs-public.h, display version from pkg-config in this +case + +Change-Id: I6c07d7ba98c98af8d7ac0264a6b775edc65355c4 +--- + cmake/Modules/FindCouchbaseSnappy.cmake | 15 +++++++++++---- + cmake/config-cmake.h.in | 1 + + tools/cbc.cc | 16 ++++++++++++---- + 3 files changed, 24 insertions(+), 8 deletions(-) + +diff --git a/cmake/Modules/FindCouchbaseSnappy.cmake b/cmake/Modules/FindCouchbaseSnappy.cmake +index d8cb3601..98c4a2cb 100644 +--- a/cmake/Modules/FindCouchbaseSnappy.cmake ++++ b/cmake/Modules/FindCouchbaseSnappy.cmake +@@ -1,11 +1,18 @@ +-FIND_PATH(SNAPPY_INCLUDES snappy-c.h ++INCLUDE(FindPkgConfig) ++PKG_CHECK_MODULES(SNAPPY snappy) ++IF(SNAPPY_FOUND) ++ SET(SNAPPY_INCLUDES ${SNAPPY_INCLUDE_DIRS}) ++ SET(LCB_SNAPPY_PKG_VERSION ${SNAPPY_VERSION}) ++ELSE() ++ FIND_PATH(SNAPPY_INCLUDES snappy-c.h + HINTS ENV SNAPPY_DIR ${SNAPPY_DIR} + PATH_SUFFIXES include) +-FIND_LIBRARY(SNAPPY_LIBRARIES NAMES snappy ++ FIND_LIBRARY(SNAPPY_LIBRARIES NAMES snappy + HINTS ENV SNAPPY_DIR ${SNAPPY_DIR} + PATH_SUFFIXES lib) +-IF(SNAPPY_LIBRARIES AND SNAPPY_INCLUDES) ++ IF(SNAPPY_LIBRARIES AND SNAPPY_INCLUDES) + SET(SNAPPY_FOUND TRUE) +-ELSE() ++ ELSE() + SET(SNAPPY_FOUND FALSE) ++ ENDIF() + ENDIF() +diff --git a/cmake/config-cmake.h.in b/cmake/config-cmake.h.in +index 70db880f..1c3728ad 100644 +--- a/cmake/config-cmake.h.in ++++ b/cmake/config-cmake.h.in +@@ -72,3 +72,4 @@ + + #define LCB_CLIENT_ID "libcouchbase/" LCB_VERSION_STRING " (" LCB_SYSTEM "; " LCB_SYSTEM_PROCESSOR "; " LCB_C_COMPILER ")" + #cmakedefine LCB_STATIC_SNAPPY ++#cmakedefine LCB_SNAPPY_PKG_VERSION "${LCB_SNAPPY_PKG_VERSION}" +diff --git a/tools/cbc.cc b/tools/cbc.cc +index bb7e11bc..a2f61402 100644 +--- a/tools/cbc.cc ++++ b/tools/cbc.cc +@@ -853,13 +853,21 @@ VersionHandler::run() + #ifdef LCB_NO_SNAPPY + printf(" Snappy: SUPPORTED\n"); + #else +- printf(" Snappy: %d.%d.%d (" + #ifdef LCB_STATIC_SNAPPY +- "static" ++#define LCB_SNAPPY_LINK "static" + #else +- "dynamic" ++#define LCB_SNAPPY_LINK "dynamic" ++#endif ++#define EXPAND(VAR) VAR ## 1 ++#define IS_EMPTY(VAR) EXPAND(VAR) ++ ++#if defined(SNAPPY_MAJOR) && (IS_EMPTY(SNAPPY_MAJOR) != 1) ++ printf(" Snappy: %d.%d.%d (%s)\n", SNAPPY_MAJOR, SNAPPY_MINOR, SNAPPY_PATCHLEVEL, LCB_SNAPPY_LINK); ++#elif defined(LCB_SNAPPY_PKG_VERSION) ++ printf(" Snappy: %s (%s)\n", LCB_SNAPPY_PKG_VERSION, LCB_SNAPPY_LINK); ++#else ++ printf(" Snappy: unknown (%s)\n", LCB_SNAPPY_LINK); + #endif +- ")\n", SNAPPY_MAJOR, SNAPPY_MINOR, SNAPPY_PATCHLEVEL); + #endif + } else { + printf(" Snappy: NOT SUPPORTED\n"); +-- +2.14.3 + diff --git a/libcouchbase.spec b/libcouchbase.spec index 3c8cc0d..333ed56 100644 --- a/libcouchbase.spec +++ b/libcouchbase.spec @@ -28,8 +28,8 @@ # hdrhistrogram suppoort seems broken, so not enabled Name: libcouchbase -Version: 2.8.3 -Release: 2%{?dist} +Version: 2.8.4 +Release: 1%{?dist} Summary: Couchbase client library Group: System Environment/Libraries License: ASL 2.0 @@ -39,6 +39,11 @@ Source0: http://packages.couchbase.com/clients/c/%{name}-%{version}.tar.gz Patch0: 0001-enforce-system-crypto-policies.patch Patch1: 0002-do-not-install-plugins-into-libdir.patch Patch2: 0003-fix-pkgconfig-paths.patch +# snappy-devel 1.1.7 in Rawhide (28) does not provide version info +# in snappy-stubs-public.h, so we pull it from pkg-config +# https://bugzilla.redhat.com/show_bug.cgi?id=1527850 +# https://github.com/couchbase/libcouchbase/commit/371502c8e516b466cef5e98567e71572b7093d96 +Patch3: 0004-detect-snappy-version-for-cbc-version.patch BuildRequires: libtool BuildRequires: openssl-devel @@ -51,6 +56,7 @@ BuildRequires: pkgconfig(libuv) >= 1 %if %{with_dtrace} BuildRequires: systemtap-sdt-devel >= 1.8 %endif +BuildRequires: pkgconfig(snappy) >= 1.1 %if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 Recommends: %{name}-libevent%{_isa} = %{version}-%{release} @@ -127,6 +133,7 @@ a Couchbase Server. %patch0 -p1 -b .crypto %patch1 -p1 -b .plug %patch2 -p1 -b .pkgc +%patch3 -p1 -b .snap %build @@ -143,7 +150,8 @@ a Couchbase Server. %else -DLCB_BUILD_DTRACE=OFF \ %endif - -DLCB_NO_MOCK=1 + -DLCB_NO_MOCK=1 \ + -DLCB_NO_SNAPPY=0 make %{?_smp_mflags} V=1 @@ -194,6 +202,9 @@ make %{_smp_mflags} alltests test ARGS=%{_smp_mflags} %changelog +* Wed Dec 20 2017 Sergey Avseyev - 2.8.4-1 +- Update to 2.8.4 + * Wed Nov 22 2017 Sergey Avseyev - 2.8.3-2 - Parallel tests -- cgit