summaryrefslogtreecommitdiffstats
path: root/php-pecl-amqp.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-07-12 09:24:01 +0200
committerRemi Collet <remi@php.net>2023-07-12 09:24:01 +0200
commite232d6aa9df3ce3c11b2910cd90c499c7cd00df2 (patch)
treef8384da35042e8a22366f265894dbd2b4b310de0 /php-pecl-amqp.spec
parent522166f3c362125750be456307748c80279319ca (diff)
build out of sources tree
Diffstat (limited to 'php-pecl-amqp.spec')
-rw-r--r--php-pecl-amqp.spec66
1 files changed, 25 insertions, 41 deletions
diff --git a/php-pecl-amqp.spec b/php-pecl-amqp.spec
index 243cb6a..2d8a915 100644
--- a/php-pecl-amqp.spec
+++ b/php-pecl-amqp.spec
@@ -10,13 +10,7 @@
# Please, preserve the changelog entries
#
-# we don't want -z defs linker flag
-%undefine _strict_symbol_defs_build
-
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-amqp
-%endif
+%{?scl:%scl_package php-pecl-amqp}
%bcond_with tests
@@ -26,14 +20,16 @@
%global upstream_version 1.11.0
#global upstream_prever RC1
#global upstream_lower rc1
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
%global buildver %(pkg-config --silence-errors --modversion librabbitmq 2>/dev/null || echo 65536)
Summary: Communicate with any AMQP compliant server
-Name: %{?sub_prefix}php-pecl-amqp
+Name: %{?scl_prefix}php-pecl-amqp
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-License: PHP
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: PHP-3.01
URL: https://pecl.php.net/package/amqp
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
@@ -59,7 +55,7 @@ Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
+%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7
# Other third party repo stuff
Obsoletes: php54-pecl-%{pecl_name} <= %{version}
%if "%{php_version}" > "5.6"
@@ -80,12 +76,6 @@ Obsoletes: php73-pecl-%{pecl_name} <= %{version}
%if "%{php_version}" > "7.4"
Obsoletes: php74-pecl-%{pecl_name} <= %{version}
%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-pecl-%{pecl_name} <= %{version}
-%endif
%endif
@@ -106,10 +96,8 @@ sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
-
-cd NTS
-%patch0 -p1 -b .php82
+cd %{sources}
+%patch -P0 -p1 -b .php82
sed -e 's/CFLAGS="-I/CFLAGS="-fPIC -I/' -i config.m4
@@ -172,23 +160,25 @@ extension = %{pecl_name}.so
;amqp.sasl_method = 0
EOF
+mkdir NTS
%if %{with_zts}
-cp -pr NTS ZTS
+mkdir ZTS
%endif
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+%configure --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-%configure --with-php-config=%{_bindir}/zts-php-config
+%configure --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -210,7 +200,7 @@ install -Dpm 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
-cd NTS
+cd %{sources}
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -240,22 +230,13 @@ export RABBITMQ_MNESIA_BASE=$PWD/base
/usr/lib/rabbitmq/bin/rabbitmqctl wait $RABBITMQ_PID_FILE
ret=0
-pushd NTS
+pushd %{sources}
: Run the upstream test Suite for NTS extension
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php -q -P --show-diff || ret=1
+%{__php} -n run-tests.php -q -x -P --show-diff || ret=1
popd
-%if %{with_zts}
-pushd ZTS
-: Run the upstream test Suite for ZTS extension
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
-REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php -q -P--show-diff || ret=1
-popd
-%endif
-
: Cleanup
if [ -s $RABBITMQ_PID_FILE ]; then
kill $(cat $RABBITMQ_PID_FILE)
@@ -287,7 +268,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -301,6 +282,9 @@ fi
%changelog
+* Wed Jul 12 2023 Remi Collet <remi@remirepo.net> - 1.11.0-3
+- build out of sources tree
+
* Fri Jun 17 2022 Remi Collet <remi@remirepo.net> - 1.11.0-2
- add patch for test suite with 8.2 from
https://github.com/php-amqp/php-amqp/pull/418