From cdd0fe640ea980af36b788587a11af864fb17e00 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 1 Sep 2023 10:01:14 +0200 Subject: build out of sources tree --- php-pecl-ion.spec | 60 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/php-pecl-ion.spec b/php-pecl-ion.spec index 0df27b2..f479a60 100644 --- a/php-pecl-ion.spec +++ b/php-pecl-ion.spec @@ -1,7 +1,7 @@ # remirepo spec file for php-pecl-ion # -# 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 @@ -9,22 +9,22 @@ # TODO use system ion-c (not yet available) -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build - %if 0%{?scl:1} -%scl_package php-pecl-ion +%scl_package php-pecl-ion %else -%global _root_bindir %{_bindir} +%global _root_bindir %{_bindir} %endif -%bcond_without tests -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global pecl_name ion -%global ini_name 40-%{pecl_name}.ini +%bcond_without tests + +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global pecl_name ion +%global ini_name 40-%{pecl_name}.ini %global upstream_version 0.2.1 #global upstream_prever a1 +%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure # Bundled library https://github.com/amzn/ion-c/releases # see https://github.com/awesomized/ext-ion for used commit reference @@ -37,11 +37,11 @@ Summary: Amazon ION support Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: BSD +License: BSD-2-Clause URL: https://pecl.php.net/package/%{pecl_name} -Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz Source1: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{gh_version}-%{gh_short}.tar.gz Patch0: %{pecl_name}-php82.patch @@ -58,7 +58,6 @@ BuildRequires: %{?scl_prefix}php-pear Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Provides: %{?scl_prefix}php-%{pecl_name} = %{version} Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} @@ -83,15 +82,14 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc -a1 -mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS # Don't install/register tests sed -e 's/role="test"/role="src"/' \ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ -i package.xml -cd NTS -%patch0 -p1 -b .php82 +cd %{sources} +%patch -P0 -p1 -b .php82 # use bundled library ln -s ../%{gh_project}-%{gh_commit} ion-c @@ -110,9 +108,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:-dev} fi cd .. +mkdir NTS %if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif # Create configuration file @@ -135,15 +133,16 @@ peclconf() { --with-php-config=$1 } -cd NTS -%{_bindir}/phpize -peclconf %{_bindir}/php-config +cd %{sources} +%{__phpize} + +cd ../NTS +peclconf %{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize -peclconf %{_bindir}/zts-php-config +peclconf %{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -166,13 +165,13 @@ 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 [ -f NTS/$i ] && install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +do [ -f %{sources}/$i ] && install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done %check : Minimal load test for NTS extension -%{_bindir}/php --no-php-ini \ +%{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' @@ -185,7 +184,7 @@ done %endif %if %{with tests} -cd NTS +cd %{sources} : Run upstream test suite TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ %{__php} -n run-tests.php -q --show-diff %{?_smp_mflags} @@ -213,7 +212,7 @@ fi %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -227,6 +226,9 @@ fi %changelog +* Fri Sep 1 2023 Remi Collet - 0.2.1-3 +- build out of sources tree + * Fri Jun 17 2022 Remi Collet - 0.2.1-2 - add upstream patch for PHP 8.2 -- cgit