From bdbaca27e51bcc36129cc42235df41d3e36422d4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 1 Sep 2023 08:49:37 +0200 Subject: build out of sources tree --- php-pecl-env.spec | 73 ++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/php-pecl-env.spec b/php-pecl-env.spec index b7ca81b..b20b53c 100644 --- a/php-pecl-env.spec +++ b/php-pecl-env.spec @@ -1,45 +1,45 @@ # remirepo spec file for php-pecl-env # -# Copyright (c) 2015-2020 Remi Collet +# Copyright (c) 2015-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%if 0%{?scl:1} -%global sub_prefix %{scl_prefix} -%scl_package php-pecl-env -%endif -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global pecl_name env +%{?scl:%scl_package php-pecl-env} + +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global pecl_name env %if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini +%global ini_name %{pecl_name}.ini %else -%global ini_name 40-%{pecl_name}.ini +%global ini_name 40-%{pecl_name}.ini %endif +%global sources %{pecl_name}-%{version} +%global _configure ../%{sources}/configure Summary: Load environment variables -Name: %{?sub_prefix}php-pecl-%{pecl_name} +Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 0.2.1 -Release: 11%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 12%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT URL: https://pecl.php.net/package/%{pecl_name} -Source: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Source: https://pecl.php.net/get/%{sources}.tgz Patch0: %{pecl_name}-pr4.patch Patch1: %{pecl_name}-pr8.patch Patch2: %{pecl_name}-pr10.patch -BuildRequires: %{?dtsprefix}gcc +BuildRequires: make +BuildRequires: %{?dtsprefix}gcc # ignore min PHP version 5.5 (as work with 5.4) BuildRequires: %{?scl_prefix}php-devel 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} @@ -59,12 +59,6 @@ Obsoletes: php80-pecl-%{pecl_name} <= %{version} %endif %endif -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter private shared -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup} -%endif - %description Based on 12Factor Application rules this extension allows @@ -77,17 +71,16 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -c -q -mv %{pecl_name}-%{version} NTS # Remove test file to avoid regsitration sed -e 's/role="test"/role="src"/' \ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ -i package.xml -cd NTS -%patch0 -p1 -b .pr4 -%patch1 -p1 -b .pr8 -%patch2 -p1 -b .pr10 +cd %{sources} +%patch -P0 -p1 -b .pr4 +%patch -P1 -p1 -b .pr8 +%patch -P2 -p1 -b .pr10 # Check upstream version (often broken) extver=$(sed -n '/#define PHP_ENV_VERSION/{s/.* "//;s/".*$//;p}' php_env.h) @@ -105,27 +98,28 @@ extension=%{pecl_name}.so ;env.file = '' EOF -cp -pr NTS ZTS +mkdir NTS ZTS %build %{?dtsenable} -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} + +cd ../NTS %configure \ --enable-env \ --with-libdir=%{_lib} \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ --enable-env \ --with-libdir=%{_lib} \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -147,14 +141,15 @@ install -Dpm644 %{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 %check -cd NTS +cd %{sources} + : Minimal load test for NTS extension %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ @@ -163,12 +158,10 @@ cd NTS : Upstream test suite for NTS extension TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ -NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__php} -n run-tests.php --show-diff +%{__php} -n run-tests.php -q --show-diff %if %{with_zts} -cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ @@ -177,9 +170,8 @@ cd ../ZTS : Upstream test suite for ZTS extension TEST_PHP_EXECUTABLE=%{__ztsphp} \ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ -NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php --show-diff +%{__ztsphp} -n run-tests.php -q --show-diff %endif @@ -205,7 +197,7 @@ fi %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -219,6 +211,9 @@ fi %changelog +* Fri Sep 1 2023 Remi Collet - 0.2.1-12 +- build out of sources tree + * Wed Sep 30 2020 Remi Collet - 0.2.1-11 - rebuild for PHP 8.0.0RC1 -- cgit