diff options
-rw-r--r-- | php-pecl-bsdiff.spec | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/php-pecl-bsdiff.spec b/php-pecl-bsdiff.spec index b5fe6c1..4e2c276 100644 --- a/php-pecl-bsdiff.spec +++ b/php-pecl-bsdiff.spec @@ -1,29 +1,30 @@ # remirepo spec file for php-pecl-bsdiff # -# 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-bsdiff -%endif -%bcond_without tests +%{?scl:%scl_package php-pecl-bsdiff} + +%bcond_without tests -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global pecl_name bsdiff -%global ini_name 40-%{pecl_name}.ini -#global prever RC2 +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global pecl_name bsdiff +%global ini_name 40-%{pecl_name}.ini +#global prever RC2 +%global sources %{pecl_name}-%{version} +%global _configure ../%{sources}/configure Summary: The bsdiff extension for PHP Name: %{?scl_prefix}php-pecl-bsdiff Version: 0.1.2 -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}%{?prever}.tgz BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -34,7 +35,6 @@ BuildRequires: bzip2-devel 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} @@ -50,14 +50,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -mv %{pecl_name}-%{version}%{?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 +cd %{sources} # Sanity check, really often broken extver=$(sed -n '/#define PHP_BSDIFF_VERSION/{s/.* "//;s/".*$//;p}' php_bsdiff.h) if test "x${extver}" != "x%{version}%{?prever}"; then @@ -66,9 +65,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 @@ -81,19 +80,20 @@ EOF %build %{?dtsenable} -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} + +cd ../NTS %configure \ --enable-bsdiff \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ --enable-bsdiff \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -117,7 +117,7 @@ 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 @@ -142,7 +142,8 @@ fi %check -cd NTS +cd %{sources} + : Minimal load test for NTS extension %{__php} -n \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ @@ -150,13 +151,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 \ @@ -166,7 +166,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} @@ -179,6 +179,9 @@ cd ../ZTS %changelog +* Thu Aug 31 2023 Remi Collet <remi@remirepo.net> - 0.1.2-2 +- build out of sources tree + * Thu Oct 13 2022 Remi Collet <remi@remirepo.net> - 0.1.2-1 - update to 0.1.2 |