summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-03-23 08:53:40 +0100
committerRemi Collet <fedora@famillecollet.com>2014-03-23 08:53:40 +0100
commit9c33408333b813c15b47a517fc1ee88d2b049243 (patch)
tree44580e38a23fb93c1ccba06bdb11f99c94c02351
parent9f5669d76e47f3ab70d41833f93af9e90cccf1bf (diff)
php-pecl-event: fix for php 5.6
-rw-r--r--event-php56.patch13
-rw-r--r--php-pecl-event-dev.spec19
2 files changed, 31 insertions, 1 deletions
diff --git a/event-php56.patch b/event-php56.patch
new file mode 100644
index 0000000..6dd562d
--- /dev/null
+++ b/event-php56.patch
@@ -0,0 +1,13 @@
+diff --git a/src/util.h b/src/util.h
+index 57ef991..8c3b652 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -96,7 +96,7 @@ int _php_event_getsockname(evutil_socket_t fd, zval **ppzaddress, zval **ppzport
+
+ #define PHP_EVENT_REQUIRE_BASE_BY_REF(zbase) \
+ do { \
+- if (!Z_ISREF_P((zbase))) { \
++ if (!Z_ISREF_P((zbase)) || Z_REFCOUNT_P(zbase) < 2) { \
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, \
+ "EventBase must be passed by reference"); \
+ } \
diff --git a/php-pecl-event-dev.spec b/php-pecl-event-dev.spec
index d6ee6e4..9445354 100644
--- a/php-pecl-event-dev.spec
+++ b/php-pecl-event-dev.spec
@@ -18,12 +18,15 @@
Summary: Provides interface to libevent library
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 1.9.0
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/event
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+# https://bitbucket.org/osmanov/pecl-event/pull-request/7
+Patch0: %{pecl_name}-php56.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel > 5.4
BuildRequires: %{?scl_prefix}php-pear
@@ -80,6 +83,16 @@ Version 1.0.0 introduces:
%setup -q -c
mv %{pecl_name}-%{version} NTS
+cd NTS
+%patch0 -p1 -b .php56
+
+# Sanity check, really often broken
+extver=$(sed -n '/#define PHP_EVENT_VERSION/{s/.* "//;s/".*$//;p}' php_event.h)
+if test "x${extver}" != "x%{version}"; then
+ : Error: Upstream extension version is ${extver}, expecting %{version}.
+ exit 1
+fi
+cd ..
# duplicate for ZTS build
%if %{with_zts}
@@ -216,6 +229,10 @@ rm -rf %{buildroot}
%changelog
+* Sun Mar 23 2014 Remi Collet <remi@fedoraproject.org> - 1.9.0-2
+- add patch for php 5.6
+ https://bitbucket.org/osmanov/pecl-event/pull-request/7
+
* Fri Jan 17 2014 Remi Collet <remi@fedoraproject.org> - 1.9.0-1
- Update to 1.9.0 (stable)
- add option to disable tests during build