summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-05-30 11:36:39 +0200
committerRemi Collet <fedora@famillecollet.com>2014-05-30 11:36:39 +0200
commit66c9f47c3018a243767114cb8ec73b8f6860b9ed (patch)
tree38020d45ebba458a08100ea731fd82df7b4e7f2e
parente6cf34c8f0bd2ec717c92b220095cf824c503302 (diff)
php-pecl-swoole: add patch to fix EL-5 build
-rw-r--r--php-pecl-swoole.spec6
-rw-r--r--swoole-el5.patch26
2 files changed, 32 insertions, 0 deletions
diff --git a/php-pecl-swoole.spec b/php-pecl-swoole.spec
index 7be3a42..4ec1762 100644
--- a/php-pecl-swoole.spec
+++ b/php-pecl-swoole.spec
@@ -30,6 +30,9 @@ Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+# https://github.com/matyhtf/swoole/pull/67
+Patch0: %{pecl_name}-el5.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
@@ -91,6 +94,8 @@ mv %{pecl_name}-%{version} NTS
sed -e '/examples/s/role="src"/role="doc"/' -i package.xml
cd NTS
+%patch0 -p1 -b .el5
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_SWOOLE_VERSION/{s/.* "//;s/".*$//;p}' php_swoole.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
@@ -219,6 +224,7 @@ rm -rf %{buildroot}
%changelog
* Fri May 30 2014 Remi Collet <remi@fedoraproject.org> - 1.7.2-1
- Update to 1.7.2 (stable)
+- open https://github.com/matyhtf/swoole/pull/67 (fix EL5 build)
* Wed Apr 30 2014 Remi Collet <remi@fedoraproject.org> - 1.7.1-1
- Update to 1.7.1 (stable)
diff --git a/swoole-el5.patch b/swoole-el5.patch
new file mode 100644
index 0000000..ea36d74
--- /dev/null
+++ b/swoole-el5.patch
@@ -0,0 +1,26 @@
+diff -up swoole-1.7.2/config.m4.old swoole-1.7.2/config.m4
+--- swoole-1.7.2/config.m4.old 2014-05-30 11:19:35.000000000 +0200
++++ swoole-1.7.2/config.m4 2014-05-30 11:20:26.000000000 +0200
+@@ -245,6 +245,7 @@ if test "$PHP_SWOOLE" != "no"; then
+ AC_CHECK_LIB(c, accept4, AC_DEFINE(SW_USE_ACCEPT4, 1, [have accept4]))
+ AC_CHECK_LIB(c, signalfd, AC_DEFINE(HAVE_SIGNALFD, 1, [have signalfd]))
+ AC_CHECK_LIB(c, daemon, AC_DEFINE(HAVE_DAEMON, 1, [have daemon]))
++ AC_CHECK_LIB(c, mkostemp, AC_DEFINE(HAVE_MKOSTEMP, 1, [have mkostemp]))
+ AC_CHECK_LIB(pthread, pthread_spin_lock, AC_DEFINE(HAVE_SPINLOCK, 1, [have pthread_spin_lock]))
+ AC_CHECK_LIB(rt, clock_gettime, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [have clock_gettime]))
+
+diff -up swoole-1.7.2/src/network/TaskWorker.c.old swoole-1.7.2/src/network/TaskWorker.c
+--- swoole-1.7.2/src/network/TaskWorker.c.old 2014-05-30 11:21:10.000000000 +0200
++++ swoole-1.7.2/src/network/TaskWorker.c 2014-05-30 11:23:18.000000000 +0200
+@@ -43,7 +43,11 @@ int swTaskWorker_large_pack(swEventData
+ {
+ swPackage_task pkg;
+ memcpy(pkg.tmpfile, SW_TASK_TMP_FILE, sizeof(SW_TASK_TMP_FILE));
++#ifdef HAVE_MKOSTEMP
+ int tpm_fd = mkostemp(pkg.tmpfile, O_WRONLY);
++#else
++ int tpm_fd = mkstemp(pkg.tmpfile);
++#endif
+ if (tpm_fd < 0)
+ {
+ swWarn("mkdtemp() failed. Error: %s[%d]", strerror(errno), errno);