summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-10-05 08:27:43 +0200
committerRemi Collet <fedora@famillecollet.com>2013-10-05 08:27:43 +0200
commit9a2679682a2eb4f654290126bd54574feae66df6 (patch)
treee21790a84117b575e767f092898bd48f1a9d8932
parent3d00609419327d3af48a8847796f0ca1db735b85 (diff)
php-pecl-couchbase: 1.2.1
-rw-r--r--couchbase-zts.patch50
-rw-r--r--php-pecl-couchbase.spec35
2 files changed, 75 insertions, 10 deletions
diff --git a/couchbase-zts.patch b/couchbase-zts.patch
new file mode 100644
index 0000000..8dc88a7
--- /dev/null
+++ b/couchbase-zts.patch
@@ -0,0 +1,50 @@
+From f4b319fe77e307d3d4e2a88a0c85a9c1c97fe458 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Sat, 5 Oct 2013 08:09:29 +0200
+Subject: [PATCH] Change too generic function name
+
+This breaks ZTS build on Linux
+
+/dev/shm/BUILD/php-pecl-couchbase-1.2.1/ZTS/replica.c:32:22: error: conflicting types for 'clone'
+ static struct entry *clone(lcb_error_t error, const lcb_get_resp_t *r) {
+ ^
+In file included from /usr/include/sched.h:42:0,
+ from /usr/include/pthread.h:23,
+ from /usr/include/php-zts/php/Zend/../TSRM/TSRM.h:55,
+ from /usr/include/php-zts/php/Zend/zend_alloc.h:27,
+ from /usr/include/php-zts/php/Zend/zend.h:252,
+ from /usr/include/php-zts/php/main/php.h:34,
+ from /dev/shm/BUILD/php-pecl-couchbase-1.2.1/ZTS/internal.h:49,
+ from /dev/shm/BUILD/php-pecl-couchbase-1.2.1/ZTS/replica.c:18:
+/usr/include/bits/sched.h:82:12: note: previous declaration of 'clone' was here
+ extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+ ^
+---
+ replica.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/replica.c b/replica.c
+index b13bcd6..f5a25f0 100644
+--- a/replica.c
++++ b/replica.c
+@@ -29,7 +29,7 @@ struct response {
+ struct entry *data;
+ };
+
+-static struct entry *clone(lcb_error_t error, const lcb_get_resp_t *r) {
++static struct entry *lcb_clone(lcb_error_t error, const lcb_get_resp_t *r) {
+ struct entry *ret = calloc(1, sizeof(struct entry));
+ if (ret != NULL) {
+ ret->error = error;
+@@ -55,7 +55,7 @@ static void get_replica_callback(lcb_t instance,
+ const lcb_get_resp_t *resp)
+ {
+ struct response *r = (void *)cookie;
+- struct entry *c = clone(error, resp);
++ struct entry *c = lcb_clone(error, resp);
+ if (c) {
+ r->entries++;
+ c->next = r->data;
+--
+1.8.4
+
diff --git a/php-pecl-couchbase.spec b/php-pecl-couchbase.spec
index aa90ad8..cf892a5 100644
--- a/php-pecl-couchbase.spec
+++ b/php-pecl-couchbase.spec
@@ -1,20 +1,31 @@
+# spec file for php-pecl-couchbase
+#
+# Copyright (c) 2013 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/3.0/
+#
+# Please, preserve the changelog entries
+#
+
%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}}
%{!?__php: %{expand: %%global __php %{_bindir}/php}}
%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
%global pecl_name couchbase
%global with_zts 0%{?__ztsphp:1}
-#global versuf dp1
Summary: Couchbase Server PHP extension
Name: php-pecl-couchbase
-Version: 1.1.5
-Release: 2%{?dist}.1
+Version: 1.2.1
+Release: 1%{?dist}%{!?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
+# https://github.com/couchbase/php-ext-couchbase/pull/9
+Patch0: %{pecl_name}-zts.patch
+
BuildRequires: php-devel >= 5.3.0
BuildRequires: php-pecl-igbinary-devel
BuildRequires: php-pear
@@ -49,20 +60,19 @@ in a Couchbase Server.
mv %{pecl_name}-%{version} NTS
+cd NTS
+%patch0 -p1 -b .ztsfix
+
# Fix version
-sed -e '/PHP_COUCHBASE_VERSION/s/1.1.4dp1/%{version}/' -i NTS/internal.h
+sed -e '/PHP_COUCHBASE_VERSION/s/1.2.0/%{version}/' -i php_couchbase.h
# Sanity check, really often broken
-extver=$(sed -n '/#define PHP_COUCHBASE_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_couchbase.h)
-if test "x${extver}" != "x%{version}"; then
- : Error: Upstream extension version is ${extver}, expecting %{version}..
- exit 1
-fi
-extver=$(sed -n '/#define PHP_COUCHBASE_VERSION/{s/.* "//;s/".*$//;p}' NTS/internal.h)
+extver=$(sed -n '/#define PHP_COUCHBASE_VERSION/{s/.* "//;s/".*$//;p}' php_couchbase.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}..
exit 1
fi
+cd ..
%if 0%{?__ztsphp:1}
# duplicate for ZTS build
@@ -151,6 +161,11 @@ fi
%changelog
+* Sat Oct 05 2013 Remi Collet <remi@fedoraproject.org> - 1.2.1-1
+- Update to 1.2.1
+- add patch to fix ZTS build
+ https://github.com/couchbase/php-ext-couchbase/pull/9
+
* Mon May 13 2013 Remi Collet <remi@fedoraproject.org> - 1.1.15-2
- fix dependency on php-pecl-igbinary