From 8201344d7fcb634713b76d4cae38f6f38a923afb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 27 Sep 2021 16:23:13 +0200 Subject: more upstream patches --- php-pecl-stomp.spec | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'php-pecl-stomp.spec') diff --git a/php-pecl-stomp.spec b/php-pecl-stomp.spec index 5f16bb2..0584a75 100644 --- a/php-pecl-stomp.spec +++ b/php-pecl-stomp.spec @@ -9,6 +9,9 @@ %{?scl: %scl_package php-pecl-stomp} %{!?scl: %global _root_prefix %{_prefix}} +# to run full test suite using a rabbitmq server +%bcond_with tests + %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name stomp %global ini_name 40-%{pecl_name}.ini @@ -16,18 +19,21 @@ Summary: Stomp client extension Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 2.0.2 -Release: 6%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Release: 7%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: PHP URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz -Patch0: %{pecl_name}-php8.patch +Patch0: %{pecl_name}-upstream.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: make BuildRequires: %{?scl_prefix}php-devel > 7 BuildRequires: %{?scl_prefix}php-pear BuildRequires: openssl-devel +%if %{with tests} +BuildRequires: rabbitmq-server +%endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} @@ -79,7 +85,7 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .pr14 +%patch0 -p1 -b .upstream # Sanity check, really often broken extver=$(sed -n '/#define PHP_STOMP_VERSION/{s/.* "//;s/".*$//;p}' php_stomp.h) @@ -117,11 +123,7 @@ EOF peclbuild() { %configure \ --enable-stomp \ -%if "%{php_version}" > "7.4" - --with-openssl \ -%else --with-openssl-dir=%{_root_prefix} \ -%endif --with-libdir=%{_lib} \ --with-php-config=$1 @@ -198,11 +200,30 @@ fi %endif cd NTS -# need a server, such as rabbitmq-server +%if %{with tests} +mkdir log run base +: Launch the RabbitMQ service +export RABBITMQ_PID_FILE=$PWD/run/pid +export RABBITMQ_LOG_BASE=$PWD/log +export RABBITMQ_MNESIA_BASE=$PWD/base +/usr/lib/rabbitmq/bin/rabbitmq-server &>log/output & +/usr/lib/rabbitmq/bin/rabbitmqctl wait $RABBITMQ_PID_FILE +%endif + : Run upstream test suite +ret=0 TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ -%{__php} -n run-tests.php -q --show-diff +%{__php} -n run-tests.php -q --show-diff || ret=1 + +%if %{with tests} +if [ -s $RABBITMQ_PID_FILE ]; then + kill $(cat $RABBITMQ_PID_FILE) +fi +rm -rf log run base +%endif + +exit $ret %files @@ -220,6 +241,9 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ %changelog +* Mon Sep 27 2021 Remi Collet - 2.0.2-7 +- more upstream patches + * Mon Sep 27 2021 Remi Collet - 2.0.2-6 - add patch for PHP 8 from https://github.com/php/pecl-tools-stomp/pull/14 -- cgit