diff options
author | Remi Collet <remi@remirepo.net> | 2023-09-04 10:47:58 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-09-04 10:47:58 +0200 |
commit | 2b5704adfc2cd270f488969cf44e29b4cd80c094 (patch) | |
tree | e50b40cab9e555efa7858a6b1d223390d45c3102 | |
parent | 08f33602e82418a8d7661368740f1ddf5908959b (diff) |
build out of sources tree
-rw-r--r-- | php-pecl-var-representation.spec | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/php-pecl-var-representation.spec b/php-pecl-var-representation.spec index 9122f71..75f3f26 100644 --- a/php-pecl-var-representation.spec +++ b/php-pecl-var-representation.spec @@ -1,35 +1,33 @@ # remirepo spec file for php-pecl-var-representation # -# Copyright (c) 2021-2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2021-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} -%scl_package php-pecl-var-representation -%endif +%{?scl:%scl_package php-pecl-var-representation} %bcond_without tests + %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name var_representation %global ini_name 40-%{pecl_name}.ini %global upstream_version 0.1.4 #global upstream_prever RC1 +%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure Summary: A compact, more readable alternative to var_export Name: %{?scl_prefix}php-pecl-var-representation Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: BSD +License: BSD-3-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 BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -38,7 +36,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} @@ -58,15 +55,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc -mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS # Don't install/register tests sed -e 's/role="test"/role="src"/' \ %{?_licensedir:-e '/COPYING/s/role="doc"/role="src"/' } \ -i package.xml -cd NTS - +cd %{sources} # Check version as upstream often forget to update this extver=$(sed -n '/define PHP_VAR_REPRESENTATION_VERSION/{s/.* "//;s/".*$//;p}' php_var_representation.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then @@ -75,10 +70,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 @@ -97,15 +91,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 @@ -128,13 +123,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}$' @@ -147,7 +142,7 @@ done %endif %if %{with tests} -cd NTS +cd %{sources} : Run upstream test suite TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ @@ -177,7 +172,7 @@ fi %files -%{?_licensedir:%license NTS/COPYING} +%{?_licensedir:%license %{sources}/COPYING} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -191,6 +186,9 @@ fi %changelog +* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 0.1.4-2 +- build out of sources tree + * Mon Oct 17 2022 Remi Collet <remi@remirepo.net> - 0.1.4-1 - update to 0.1.4 |