From 48952e08ec7f73387cf60b507ab9714905b3ff2c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 27 Jun 2018 15:28:44 +0200 Subject: wip --- .gitignore | 7 +++++++ 170.patch | 31 +++++++++++++++++++++++++++++++ php-pecl-zmq.spec | 50 +++++++++++++++++++++++++------------------------- zmq-build.patch | 31 ------------------------------- 4 files changed, 63 insertions(+), 56 deletions(-) create mode 100644 .gitignore create mode 100644 170.patch delete mode 100644 zmq-build.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/170.patch b/170.patch new file mode 100644 index 0000000..45cde0b --- /dev/null +++ b/170.patch @@ -0,0 +1,31 @@ +From 7c961507e24435680e445b90af0a465c98246d4d Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 1 Feb 2016 08:09:46 +0100 +Subject: [PATCH] Fix build with old GCC + +--- + zmq_pollset.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/zmq_pollset.c b/zmq_pollset.c +index 16dbdec..59f8c09 100644 +--- a/zmq_pollset.c ++++ b/zmq_pollset.c +@@ -38,7 +38,7 @@ + + /* {{{ typedef struct _php_zmq_pollset + */ +-typedef struct _php_zmq_pollset { ++struct _php_zmq_pollset { + + zmq_pollitem_t *items; + zend_string **keys; +@@ -49,7 +49,7 @@ typedef struct _php_zmq_pollset { + size_t alloc_size; + + zval errors; +-} php_zmq_pollset; ++}; + /* }}} */ + + static diff --git a/php-pecl-zmq.spec b/php-pecl-zmq.spec index 15004fd..4aaddc4 100644 --- a/php-pecl-zmq.spec +++ b/php-pecl-zmq.spec @@ -3,7 +3,7 @@ # # Fedora spec file for php-pecl-zmq # -# Copyright (c) 2013-2017 Remi Collet +# Copyright (c) 2013-2018 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -26,21 +26,20 @@ Summary: ZeroMQ messaging Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: 1.1.3 -Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 7%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD -Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -# https://github.com/mkoppanen/php-zmq/pull/170 -Patch0: %{pecl_name}-build.patch +Patch0: https://patch-diff.githubusercontent.com/raw/mkoppanen/php-zmq/pull/170.patch +Patch1: https://patch-diff.githubusercontent.com/raw/mkoppanen/php-zmq/pull/190.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: %{?scl_prefix}php-devel > 5.3 +BuildRequires: %{?dtsprefix}gcc +# see https://github.com/mkoppanen/php-zmq/pull/190 build ok bug segfaults +BuildRequires: %{?scl_prefix}php-devel < 7.3 BuildRequires: %{?scl_prefix}php-pear -%if 0%{?fedora} >= 22 || 0%{?rhel} == 5 || 0%{?rhel} == 7 +%if 0%{?fedora} >= 22 || 0%{?rhel} >= 7 # v4 in Fedora22+, EPEL-7 -# v2 in EPEL-5 BuildRequires: zeromq-devel >= 2.0.7 %else BuildRequires: zeromq3-devel @@ -65,14 +64,6 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{rele %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff -Obsoletes: php53-pecl-%{pecl_name} <= %{version} -Obsoletes: php53u-pecl-%{pecl_name} <= %{version} -Obsoletes: php54-pecl-%{pecl_name} <= %{version} -Obsoletes: php54w-pecl-%{pecl_name} <= %{version} -%if "%{php_version}" > "5.5" -Obsoletes: php55u-pecl-%{pecl_name} <= %{version} -Obsoletes: php55w-pecl-%{pecl_name} <= %{version} -%endif %if "%{php_version}" > "5.6" Obsoletes: php56u-pecl-%{pecl_name} <= %{version} Obsoletes: php56w-pecl-%{pecl_name} <= %{version} @@ -85,6 +76,10 @@ Obsoletes: php70w-pecl-%{pecl_name} <= %{version} Obsoletes: php71u-pecl-%{pecl_name} <= %{version} Obsoletes: php71w-pecl-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "7.2" +Obsoletes: php72u-pecl-%{pecl_name} <= %{version} +Obsoletes: php72w-pecl-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -112,7 +107,8 @@ sed -e 's/role="test"/role="src"/' \ mv %{pecl_name}-%{version} NTS cd NTS -%patch0 -p1 -b .build +%patch0 -p1 -b .pr170 +%patch1 -p1 -b .pr190 if pkg-config libzmq --atleast-version=4 then @@ -143,6 +139,8 @@ EOF %build +%{?dtsenable} + cd NTS %{_bindir}/phpize %configure \ @@ -163,7 +161,7 @@ make %{?_smp_mflags} %install -rm -rf %{buildroot} +%{?dtsenable} make -C NTS \ install INSTALL_ROOT=%{buildroot} @@ -187,7 +185,7 @@ do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done -%if 0%{?fedora} < 24 +%if 0%{?fedora} < 24 && 0%{?rhel} < 8 # when pear installed alone, after us %triggerin -- %{?scl_prefix}php-pear if [ -x %{__pecl} ] ; then @@ -243,12 +241,7 @@ export TEST_PHP_EXECUTABLE=%{__ztsphp} %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{?_licensedir:%license NTS/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -263,6 +256,13 @@ rm -rf %{buildroot} %changelog +* Wed Jun 27 2018 Remi Collet - 1.1.3-7 +- add patch for PHP 7.3 from + https://github.com/mkoppanen/php-zmq/pull/190 + +* Tue Jul 18 2017 Remi Collet - 1.1.3-6 +- rebuild for PHP 7.2.0beta1 new API + * Thu Dec 1 2016 Remi Collet - 1.1.3-5 - rebuild with PHP 7.1.0 GA diff --git a/zmq-build.patch b/zmq-build.patch deleted file mode 100644 index 45cde0b..0000000 --- a/zmq-build.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 7c961507e24435680e445b90af0a465c98246d4d Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 1 Feb 2016 08:09:46 +0100 -Subject: [PATCH] Fix build with old GCC - ---- - zmq_pollset.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/zmq_pollset.c b/zmq_pollset.c -index 16dbdec..59f8c09 100644 ---- a/zmq_pollset.c -+++ b/zmq_pollset.c -@@ -38,7 +38,7 @@ - - /* {{{ typedef struct _php_zmq_pollset - */ --typedef struct _php_zmq_pollset { -+struct _php_zmq_pollset { - - zmq_pollitem_t *items; - zend_string **keys; -@@ -49,7 +49,7 @@ typedef struct _php_zmq_pollset { - size_t alloc_size; - - zval errors; --} php_zmq_pollset; -+}; - /* }}} */ - - static -- cgit