summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--121.patch49
-rw-r--r--php-tarantool.spec18
2 files changed, 66 insertions, 1 deletions
diff --git a/121.patch b/121.patch
new file mode 100644
index 0000000..11a7b08
--- /dev/null
+++ b/121.patch
@@ -0,0 +1,49 @@
+From 953c723a59fb437fccea9aeaf4c7f69c112f6308 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Sat, 24 Jun 2017 10:59:29 +0200
+Subject: [PATCH 1/2] fix for 7.2
+
+---
+ .travis.yml | 2 ++
+ src/php_tarantool.h | 5 ++++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/php_tarantool.h b/src/php_tarantool.h
+index 1679eb7..7556671 100644
+--- a/src/php_tarantool.h
++++ b/src/php_tarantool.h
+@@ -17,7 +17,10 @@
+ # include "config.h"
+ #endif
+
+-#if PHP_VERSION_ID >= 70000
++#if PHP_VERSION_ID >= 70200
++# include <Zend/zend_smart_string.h>
++# define smart_string_alloc4(d, n, what, newlen) smart_string_alloc(d, n, what)
++#elif PHP_VERSION_ID >= 70000
+ # include <ext/standard/php_smart_string.h>
+ #else
+ # include <ext/standard/php_smart_str.h>
+
+From b8b1a2efdcf3ced046a5af19ea18f326bc9d7f49 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Sat, 24 Jun 2017 11:11:52 +0200
+Subject: [PATCH 2/2] improve previous
+
+---
+ src/php_tarantool.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/php_tarantool.h b/src/php_tarantool.h
+index 7556671..bab2a49 100644
+--- a/src/php_tarantool.h
++++ b/src/php_tarantool.h
+@@ -19,7 +19,7 @@
+
+ #if PHP_VERSION_ID >= 70200
+ # include <Zend/zend_smart_string.h>
+-# define smart_string_alloc4(d, n, what, newlen) smart_string_alloc(d, n, what)
++# define smart_string_alloc4(d, n, what, newlen) newlen = smart_string_alloc(d, n, what)
+ #elif PHP_VERSION_ID >= 70000
+ # include <ext/standard/php_smart_string.h>
+ #else
diff --git a/php-tarantool.spec b/php-tarantool.spec
index c6225c3..5c36f59 100644
--- a/php-tarantool.spec
+++ b/php-tarantool.spec
@@ -35,7 +35,7 @@ Version: 0.2.0
%if 0%{?github_date}
Release: 0.1.%{?github_date}git%{?github_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%else
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%endif
Summary: PHP driver for Tarantool/Box
@@ -45,6 +45,8 @@ License: BSD
URL: https://github.com/%{github_owner}/%{github_name}
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{pkg_name}-%{version}-%{github_short}.tar.gz
+Patch0: 121.patch
+
BuildRequires: %{?scl_prefix}php-devel >= 7
%if %{with_tests}
# For tests
@@ -75,6 +77,10 @@ Obsoletes: php70w-%{ext_name} <= %{version}
Obsoletes: php71u-%{ext_name} <= %{version}
Obsoletes: php71w-%{ext_name} <= %{version}
%endif
+%if "%{php_version}" > "7.2"
+Obsoletes: php72u-%{ext_name} <= %{version}
+Obsoletes: php72w-%{ext_name} <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -98,6 +104,8 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
mv %{github_name}-%{github_commit} NTS
cd NTS
+%patch0 -p1 -b .pr121
+
extver=$(sed -n '/#define PHP_TARANTOOL_VERSION/{s/.* "//;s/".*$//;p}' php_tarantool.h)
if test "x${extver}" != "x%{version}%{?pre}%{?github_date:-dev}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}%{?pre}%{?github_date:-dev}.
@@ -126,6 +134,8 @@ INI
%build
+%{?dtsenable}
+
: Ext -- NTS
pushd NTS
%{_bindir}/phpize
@@ -144,6 +154,8 @@ popd
%install
+%{?dtsenable}
+
: Ext -- NTS
make -C NTS install INSTALL_ROOT=%{buildroot}
install -D -m 0644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -183,6 +195,10 @@ install -D -m 0644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%changelog
+* Sat Jun 24 2017 Remi Collet <remi@fedoraproject.org> - 0.2.0-3
+- add patch for PHP 7.2 from
+ https://github.com/tarantool/tarantool-php/pull/121
+
* Thu Dec 1 2016 Remi Collet <remi@fedoraproject.org> - 0.2.0-2
- rebuild with PHP 7.1.0 GA