From 07dc7f314c4a8082145fcf452e8b1239815dd435 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 5 Nov 2015 08:15:52 +0100 Subject: php-pecl-couchbase2: 2.1.0 --- REFLECTION | 23 +++++++++++++--- couchbase-fastlz.patch | 69 ++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-couchbase2.spec | 28 +++++++++++++++----- 3 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 couchbase-fastlz.patch diff --git a/REFLECTION b/REFLECTION index 4983d80..6d44d00 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #181 couchbase version 2.0.7 ] { +Extension [ extension #186 couchbase version 2.1.0 ] { - Constants [57] { Constant [ integer COUCHBASE_PERSISTTO_MASTER ] { 1 } @@ -60,6 +60,17 @@ Extension [ extension #181 couchbase version 2.0.7 ] { Constant [ integer COUCHBASE_KEYNOTFOUND ] { 13 } } + - Functions { + Function [ function couchbase_fastlz_compress ] { + } + Function [ function couchbase_fastlz_decompress ] { + } + Function [ function couchbase_zlib_compress ] { + } + Function [ function couchbase_zlib_decompress ] { + } + } + - Classes [4] { Class [ class CouchbaseException extends Exception ] { @@ -79,7 +90,7 @@ Extension [ extension #181 couchbase version 2.0.7 ] { Property [ protected $line ] } - - Methods [9] { + - Methods [10] { Method [ method __construct ] { - Parameters [3] { @@ -89,6 +100,9 @@ Extension [ extension #181 couchbase version 2.0.7 ] { } } + Method [ public method __wakeup ] { + } + Method [ final public method getMessage ] { } @@ -177,7 +191,7 @@ Extension [ extension #181 couchbase version 2.0.7 ] { - Properties [0] { } - - Methods [17] { + - Methods [18] { Method [ public method __construct ] { } @@ -214,6 +228,9 @@ Extension [ extension #181 couchbase version 2.0.7 ] { Method [ public method unlock ] { } + Method [ public method n1ql_request ] { + } + Method [ public method http_request ] { } diff --git a/couchbase-fastlz.patch b/couchbase-fastlz.patch new file mode 100644 index 0000000..1cb86a6 --- /dev/null +++ b/couchbase-fastlz.patch @@ -0,0 +1,69 @@ +From 693266afdbef09db2fb09437a47d1662ab92d8c9 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 5 Nov 2015 07:58:17 +0100 +Subject: [PATCH] add --with-system-fastlz configure option + +--- + config.m4 | 23 +++++++++++++++++++++-- + couchbase.c | 2 +- + 2 files changed, 22 insertions(+), 3 deletions(-) + +diff --git a/config.m4 b/config.m4 +index c07db46..35db4c1 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -1,5 +1,9 @@ + PHP_ARG_ENABLE(couchbase, whether to enable Couchbase support, +-[ --with-couchbase Include Couchbase support]) ++[ --with-couchbase Include Couchbase support]) ++ ++PHP_ARG_WITH(system-fastlz, wheter to use system FastLZ bibrary, ++[ --with-system-fastlz Use system FastLZ bibrary], no, no) ++ + if test "$PHP_COUCHBASE" = "yes"; then + AC_DEFINE(HAVE_COUCHBASE, 1, [Whether you have Couchbase]) + +@@ -9,6 +13,16 @@ if test "$PHP_COUCHBASE" = "yes"; then + + PHP_ADD_LIBRARY(couchbase, 1, COUCHBASE_SHARED_LIBADD) + ++ if test "$PHP_SYSTEM_FASTLZ" != "no"; then ++ FASTLZ="" ++ AC_CHECK_HEADERS([fastlz.h]) ++ PHP_CHECK_LIBRARY(fastlz, fastlz_compress, ++ [PHP_ADD_LIBRARY(fastlz, 1, COUCHBASE_SHARED_LIBADD)], ++ [AC_MSG_ERROR(FastLZ library not found)]) ++ else ++ FASTLZ="fastlz/fastlz.c" ++ fi ++ + ifdef([PHP_ADD_EXTENDION_DEP], [ + PHP_ADD_EXTENSION_DEP(couchbase, json) + ]) +@@ -22,6 +36,11 @@ if test "$PHP_COUCHBASE" = "yes"; then + exception.c \ + metadoc.c \ + transcoding.c \ +- fastlz/fastlz.c \ ++ $FASTLZ \ + , $ext_shared) ++ ++ if test -n "$FASTLZ" ; then ++ PHP_ADD_BUILD_DIR($ext_builddir/fastlz, 1) ++ PHP_ADD_INCLUDE([$ext_srcdir/fastlz]) ++ fi + fi +\ No newline at end of file +diff --git a/couchbase.c b/couchbase.c +index 53da789..25baaee 100644 +--- a/couchbase.c ++++ b/couchbase.c +@@ -2,7 +2,7 @@ + #include "cas.h" + #include "metadoc.h" + #include "phpstubstr.h" +-#include "fastlz/fastlz.h" ++#include + + #if HAVE_ZLIB + #include diff --git a/php-pecl-couchbase2.spec b/php-pecl-couchbase2.spec index d64c82f..b6459d9 100644 --- a/php-pecl-couchbase2.spec +++ b/php-pecl-couchbase2.spec @@ -1,4 +1,4 @@ -# spec file for php-pecl-couchbase2 +# remirepo spec file for php-pecl-couchbase2 # # Copyright (c) 2013-2015 Remi Collet # License: CC-BY-SA @@ -25,16 +25,21 @@ Summary: Couchbase Server PHP extension Name: %{?scl_prefix}php-pecl-couchbase2 -Version: 2.0.7 -Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Version: 2.1.0 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP Group: Development/Languages URL: pecl.php.net/package/couchbase Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?svnrev:-dev}.tgz +# Build with system fastlz +Patch0: %{pecl_name}-fastlz.patch + BuildRequires: %{?scl_prefix}php-devel >= 5.3.0 BuildRequires: %{?scl_prefix}php-pear BuildRequires: libcouchbase-devel +BuildRequires: fastlz-devel +BuildRequires: zlib-devel # to ensure compatibility with XDebug BuildRequires: %{?scl_prefix}php-pecl-xdebug @@ -90,7 +95,7 @@ This package provides API version 2. Documentation: http://docs.couchbase.com/prebuilt/php-sdk-2.0/topics/overview.html -Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection}. +Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. %prep @@ -99,6 +104,11 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO mv %{pecl_name}-%{version} NTS cd NTS +# Drop bundled library +sed -e '/fastlz/d' -i ../package.xml +rm -r fastlz +%patch0 -p1 -b .sysfast + # Sanity check, really often broken extver=$(sed -n '/#define PHP_COUCHBASE_VERSION/{s/.* "//;s/".*$//;p}' php_couchbase.h) if test "x${extver}" != "x%{version}"; then @@ -123,6 +133,7 @@ cp -pr NTS ZTS %build peclconf() { %configure \ + --with-system-fastlz \ --with-php-config=$1 } @@ -162,13 +173,13 @@ done %check : minimal NTS load test -%{__php} \ +%{__php} -n \ -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ -m | grep %{pecl_name} %if %{with_zts} : minimal ZTS load test -%{__ztsphp} \ +%{__ztsphp} -n \ -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ -m | grep %{pecl_name} %endif @@ -208,6 +219,11 @@ fi %changelog +* Thu Nov 05 2015 Remi Collet - 2.1.0-1 +- Update to 2.1.0 +- add patch to use system fastlz library + from https://github.com/couchbase/php-couchbase/pull/10 + * Wed Apr 22 2015 Remi Collet - 2.0.7-1 - Update to 2.0.7 -- cgit