From 693de0ea4b17bc5b9f3881433e75e2d426ca34fe Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 1 Sep 2023 15:21:07 +0200 Subject: build out of sources tree --- php-pecl-simdjson.spec | 61 ++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/php-pecl-simdjson.spec b/php-pecl-simdjson.spec index 49360a2..23d3e7e 100644 --- a/php-pecl-simdjson.spec +++ b/php-pecl-simdjson.spec @@ -1,29 +1,30 @@ # remirepo spec file for php-pecl-simdjson # -# Copyright (c) 2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2022-2023 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%if 0%{?scl:1} -%scl_package php-pecl-simdjson -%endif -%bcond_without tests +%{?scl:%scl_package php-pecl-simdjson} + +%bcond_without tests -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global pecl_name simdjson -%global ini_name 50-%{pecl_name}.ini -#global prever RC2 +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global pecl_name simdjson +%global ini_name 50-%{pecl_name}.ini +#global prever RC2 +%global sources %{pecl_name}-%{version}%{?prever} +%global _configure ../%{sources}/configure Summary: Provides faster json decoding through simdjson bindings for PHP Name: %{?scl_prefix}php-pecl-simdjson Version: 4.0.0 -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/%{pecl_name} -Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz %if 0%{?rhel} == 7 && 0%{?dtsversion} < 7 BuildRequires: devtoolset-7-toolchain @@ -39,7 +40,6 @@ BuildRequires: %{?scl_prefix}php-pear Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-json%{?_isa} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Provides: %{?scl_prefix}php-%{pecl_name} = %{version} Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} @@ -66,11 +66,10 @@ These are the files needed to compile programs using %{name}. %prep %setup -q -c -mv %{pecl_name}-%{version}%{?prever} NTS %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} -cd NTS +cd %{sources} # Sanity check, really often broken extver=$(sed -n '/#define PHP_SIMDJSON_VERSION /{s/.* "//;s/".*$//;p}' php_simdjson.h) if test "x${extver}" != "x%{version}%{?prever}"; then @@ -79,9 +78,9 @@ if test "x${extver}" != "x%{version}%{?prever}"; then fi cd .. +mkdir NTS %if %{with_zts} -# Duplicate source tree for NTS / ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif # Create configuration file @@ -94,19 +93,20 @@ EOF %build %{?dtsenable} -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} + +cd ../NTS %configure \ --enable-simdjson \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ --enable-simdjson \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -130,11 +130,11 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} # 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 # Tests for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i +do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i done @@ -159,7 +159,8 @@ fi %check -cd NTS +cd %{sources} + : Minimal load test for NTS extension %{__php} -n \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ @@ -167,13 +168,12 @@ cd NTS %if %{with tests} : 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 -P -q --show-diff %endif %if %{with_zts} -cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} -n \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ @@ -183,7 +183,7 @@ cd ../ZTS %files %doc %{pecl_docdir}/%{pecl_name} -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} @@ -204,6 +204,9 @@ cd ../ZTS %changelog +* Fri Sep 1 2023 Remi Collet - 4.0.0-2 +- build out of sources tree + * Wed Oct 19 2022 Remi Collet - 4.0.0-1 - update to 4.0.0 -- cgit