diff options
author | Remi Collet <remi@remirepo.net> | 2023-07-18 17:13:12 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-07-18 17:13:12 +0200 |
commit | ebd8ee35ca516f137f3c08cb82ae251ae1248ba0 (patch) | |
tree | db48ab39b9acf77aba326a036ebf0ad9c11cd3f9 | |
parent | e8b2d76741e1a90b6cb46c74ec5680420a3e12eb (diff) |
build out of sources tree
-rw-r--r-- | php-pecl-yac.spec | 94 |
1 files changed, 41 insertions, 53 deletions
diff --git a/php-pecl-yac.spec b/php-pecl-yac.spec index b8e8feb..ca7317e 100644 --- a/php-pecl-yac.spec +++ b/php-pecl-yac.spec @@ -3,16 +3,19 @@ # # Fedora spec file for php-pecl-yac (previously php-yac) # -# Copyright (c) 2013-2021 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 # -%if 0%{?scl:1} -%global sub_prefix %{scl_prefix} -%scl_package php-pecl-yac -%endif +%{?scl:%scl_package php-pecl-yac} + +# use system library by default +%bcond_without fastlz + +# run test suite by default +%bcond_without tests %global gh_commit 7e5a9edfcfb6ad064c165a0b6abf8d11218fe4b5 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) @@ -21,21 +24,25 @@ #global gh_date 20150908 %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name yac -%global with_tests %{!?_without_tests:1}%{?_without_tests:0} # after 20-json, 40-igbinary and 40-msgpack %global ini_name 50-%{pecl_name}.ini -%global with_fastlz 1 +%if 0%{?gh_date:1} +%global sources %{gh_project}-%{gh_commit} +%else +%global sources %{pecl_name}-%{version} +%endif +%global _configure ../%{sources}/configure Summary: Lockless user data cache -Name: %{?sub_prefix}php-pecl-%{pecl_name} +Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 2.3.1 -License: PHP +License: PHP-3.01 URL: https://pecl.php.net/package/%{pecl_name} %if 0%{?gh_date:1} Release: 0.14.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz %endif @@ -46,7 +53,7 @@ BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json BuildRequires: %{?scl_prefix}php-pecl-msgpack-devel BuildRequires: %{?scl_prefix}php-pecl-igbinary-devel -%if %{with_fastlz} +%if %{with fastlz} BuildRequires: fastlz-devel %endif @@ -55,7 +62,6 @@ Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-json%{?_isa} Requires: %{?scl_prefix}php-igbinary%{?_isa} Requires: %{?scl_prefix}php-msgpack%{?_isa} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} # Package have be renamed Obsoletes: %{?scl_prefix}php-%{pecl_name} < %{version} @@ -63,23 +69,6 @@ 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} -# Other third party repo stuff -%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 @@ -98,10 +87,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc %if 0%{?gh_date:1} -mv %{gh_project}-%{gh_commit} NTS -mv NTS/package.xml . -%else -mv %{pecl_name}-%{version} NTS +mv %{sources}/package.xml . %endif # Don't install (register) the tests @@ -109,8 +95,8 @@ sed -e 's/role="test"/role="src"/' \ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ -i package.xml -cd NTS -%if %{with_fastlz} +cd %{sources} +%if %{with fastlz} sed -e '\:name="compressor/fastlz:d' -i ../package.xml rm -r compressor/fastlz %endif @@ -138,9 +124,9 @@ extension = %{pecl_name}.so EOF +mkdir NTS %if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif @@ -149,24 +135,25 @@ cp -pr NTS ZTS peclconf() { %configure \ -%if %{with_fastlz} --enable-json \ --enable-msgpack \ --enable-igbinary \ +%if %{with fastlz} --with-system-fastlz \ %endif --with-php-config=$1 } -cd NTS +cd %{sources} %{_bindir}/phpize -peclconf %{_bindir}/php-config + +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 @@ -189,12 +176,12 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} # Documentation for i in README.md $(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 -cd NTS +cd %{sources} OPTS="-n" [ -f %{php_extdir}/json.so ] && OPTS="$OPTS -d extension=json.so" [ -f %{php_extdir}/igbinary.so ] && OPTS="$OPTS -d extension=igbinary.so" @@ -205,10 +192,10 @@ OPTS="-n" --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' -%if %{with_tests} +%if %{with tests} : Upstream test suite for NTS extension TEST_PHP_EXECUTABLE=%{__php} \ -TEST_PHP_ARGS="$OPTS -d extension=$PWD/modules/%{pecl_name}.so" \ +TEST_PHP_ARGS="$OPTS -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ %{__php} -n run-tests.php -q --show-diff %else @@ -216,17 +203,15 @@ REPORT_EXIT_STATUS=1 \ %endif %if %{with_zts} -cd ../ZTS - : Minimal load test for ZTS extension %{__ztsphp} $OPTS \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' -%if %{with_tests} +%if %{with tests} : Upstream test suite for ZTS extension TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="$OPTS -d extension=$PWD/modules/%{pecl_name}.so" \ +TEST_PHP_ARGS="$OPTS -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ %{__ztsphp} -n run-tests.php -q --show-diff %else @@ -256,7 +241,7 @@ fi %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -270,7 +255,10 @@ fi %changelog -* Mon Dec 20 2021 Remi Collet <remi@remirepo.net> - 2.3.1-1 +* Tue Jul 18 2023 Remi Collet <remi@remirepo.net> - 2.3.1-6 +- build out of sources tree + +* Mon Dec 20 2021 Remi Collet <remi@remirepo.net> - 2.3.1-5 - update to 2.3.1 - drop patch merged upstream |