From 2e95caa211561f56b209db0e1928f21c162459ed Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 13 Jul 2023 14:09:32 +0200 Subject: build out of sources tree --- php-pecl-event.spec | 89 ++++++++++++++++++++++------------------------------- 1 file changed, 37 insertions(+), 52 deletions(-) diff --git a/php-pecl-event.spec b/php-pecl-event.spec index 75ade5a..e1a094a 100644 --- a/php-pecl-event.spec +++ b/php-pecl-event.spec @@ -3,23 +3,25 @@ # # Fedora spec file for php-pecl-event # -# Copyright (c) 2013-2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2013-2023 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # 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-event %else %global _root_prefix %{_prefix} %endif +# For PHP < 5.6 and EPEL-9 +%{!?__phpize: %global __phpize %{_bindir}/phpize} +%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize} +%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config} +%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config} + %bcond_without tests %global pecl_name event @@ -34,12 +36,14 @@ %global upstream_version 3.0.8 #global upstream_prever RC1 #global upstream_postver r1 +%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure Summary: Provides interface to libevent library -Name: %{?sub_prefix}php-pecl-%{pecl_name} +Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}%{?upstream_postver:+%{upstream_postver}} -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: PHP +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +License: PHP-3.01 URL: https://pecl.php.net/package/event Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}%{?upstream_postver}.tgz @@ -59,31 +63,11 @@ BuildRequires: pkgconfig Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-sockets%{?_isa} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Provides: %{?scl_prefix}php-%{pecl_name} = %{version} 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 "%{?scl_prefix}" != "%{?sub_prefix}" -Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} -Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} -%endif - -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -%if "%{php_version}" > "7.3" -Obsoletes: php73-pecl-%{pecl_name} <= %{version} -%endif -%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 %description @@ -108,9 +92,7 @@ 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}%{?upstream_postver} NTS - -cd NTS +cd %{sources} # Sanity check, really often broken DIR=$(%{__php} -r 'echo "php" . PHP_MAJOR_VERSION;') #sed -e '/PHP_EVENT_VERSION/s/2.4.2/2.4.3/' -i $DIR/php_event.h @@ -122,9 +104,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?upstream_post fi cd .. -# duplicate for ZTS build +mkdir NTS %if %{with_zts} -cp -pr NTS ZTS +mkdir ZTS %endif # Drop in the bit of configuration @@ -137,8 +119,10 @@ EOF %build %{?dtsenable} -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} + +cd ../NTS %configure \ --with-event-libevent-dir=%{_event_prefix} \ --with-openssl-dir=%{_root_prefix} \ @@ -146,12 +130,11 @@ cd NTS --with-event-core \ --with-event-extra \ --with-event-openssl \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ --with-event-libevent-dir=%{_event_prefix} \ --with-openssl-dir=%{_root_prefix} \ @@ -160,7 +143,7 @@ cd ../ZTS --with-event-extra \ --with-event-openssl \ --with-event-pthreads \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -184,15 +167,16 @@ install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml : Documentation for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done %check +cd %{sources} %if "%{php_version}" < "7" -rm ?TS/tests/61-issue.phpt -rm ?TS/tests/10-event-data-dtor.phpt -rm ?TS/tests/27-event-util-create-socket.phpt +rm tests/61-issue.phpt +rm tests/10-event-data-dtor.phpt +rm tests/27-event-util-create-socket.phpt %endif if [ -f %{php_extdir}/sockets.so ]; then @@ -201,31 +185,29 @@ fi : Minimal load test for NTS extension %{__php} --no-php-ini $OPTS \ - --define extension=NTS/modules/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' %if %{with_zts} : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini $OPTS \ - --define extension=ZTS/modules/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' %endif %if %{with tests} -cd NTS : Upstream test suite for NTS extension SKIP_ONLINE_TESTS=1 \ TEST_PHP_EXECUTABLE=%{__php} \ -TEST_PHP_ARGS="-n $OPTS -d extension=$PWD/modules/%{pecl_name}.so" \ +TEST_PHP_ARGS="-n $OPTS -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ %{__php} -n run-tests.php -q --show-diff %if %{with_zts} -cd ../ZTS : Upstream test suite for ZTS extension SKIP_ONLINE_TESTS=1 \ TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n $OPTS -d extension=$PWD/modules/%{pecl_name}.so" \ +TEST_PHP_ARGS="-n $OPTS -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ %{__ztsphp} -n run-tests.php -q --show-diff %endif @@ -253,7 +235,7 @@ fi %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -267,6 +249,9 @@ fi %changelog +* Thu Jul 13 2023 Remi Collet - 3.0.8-2 +- build out of sources tree + * Wed Jun 1 2022 Remi Collet - 3.0.8-1 - update to 3.0.8 (no change) -- cgit