diff options
author | Remi Collet <remi@remirepo.net> | 2023-09-04 12:02:36 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-09-04 12:02:36 +0200 |
commit | e349d92d34ae21199778801afbee394c200a680e (patch) | |
tree | 7304abd660404ee6a115a79849bedab04e614da2 /php-pecl-rar.spec | |
parent | 17d854cb73f61a09d3563c2dea84c083f48d90d8 (diff) |
https://github.com/cataphract/php-rar/pull/18
build out of sources tree
Diffstat (limited to 'php-pecl-rar.spec')
-rw-r--r-- | php-pecl-rar.spec | 112 |
1 files changed, 51 insertions, 61 deletions
diff --git a/php-pecl-rar.spec b/php-pecl-rar.spec index 669d5c7..ea22e2c 100644 --- a/php-pecl-rar.spec +++ b/php-pecl-rar.spec @@ -1,31 +1,37 @@ # spec file for php-pecl-rar # -# Copyright (c) 2013-2021 Remi Collet +# Copyright (c) 2013-2022 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%{?scl: %scl_package php-pecl-rar} +%{?scl:%scl_package php-pecl-rar} -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global pecl_name rar +%bcond_without tests + +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global pecl_name rar %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: PHP extension for reading RAR archives Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 4.2.0 -Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} -License: PHP and Freeware with further limitations +Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +License: PHP-3.01 and Freeware with further limitations Group: Development/Languages URL: https://pecl.php.net/package/%{pecl_name} -Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz Patch0: %{pecl_name}-php81.patch +Patch1: %{pecl_name}-php82.patch +Patch2: %{pecl_name}-php83.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -34,32 +40,11 @@ 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} 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.3" -Obsoletes: php73-pecl-%{pecl_name} <= %{version} -%endif -%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 @@ -72,15 +57,16 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -mv %{pecl_name}-%{version} 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 +cd %{sources} +%patch -P0 -p1 +%patch -P1 -p1 +%patch -P2 -p1 # Sanity check, really often broken extver=$(sed -n '/#define PHP_RAR_VERSION/{s/.* "//;s/".*$//;p}' php_rar.h) @@ -90,9 +76,9 @@ if test "x${extver}" != "x%{version}%{?prever:-%{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 @@ -105,20 +91,21 @@ EOF %build %{?dtsenable} -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} + +cd ../NTS %configure \ --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 \ --with-libdir=%{_lib} \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -144,7 +131,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 + install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done @@ -169,39 +156,33 @@ fi %check +cd %{sources} + : Minimal load test for NTS extension -cd NTS -%{_bindir}/php --no-php-ini \ - --define extension=modules/%{pecl_name}.so \ - --modules | grep %{pecl_name} +%{__php} --no-php-ini \ + --define extension=../NTS/modules/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' +%if %{with tests} : Upstream test suite for NTS extension -TEST_PHP_EXECUTABLE=%{_bindir}/php \ -TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ -NO_INTERACTION=1 \ +TEST_PHP_EXECUTABLE=%{__php} \ +TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ -%{_bindir}/php -n run-tests8.php --show-diff +%{__php} -n run-tests8.php -q --show-diff +%endif %if %{with_zts} : Minimal load test for ZTS extension -cd ../ZTS %{__ztsphp} --no-php-ini \ - --define extension=modules/%{pecl_name}.so \ - --modules | grep %{pecl_name} - -: Upstream test suite for ZTS extension -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ -NO_INTERACTION=1 \ -REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests8.php --show-diff + --define extension=../ZTS/modules/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' %endif %files -%{?_licensedir:%license NTS/LICENSE} -%{?_licensedir:%license NTS/unrar/LICENSE.txt} +%{?_licensedir:%license %{sources}/LICENSE} +%{?_licensedir:%license %{sources}/unrar/LICENSE.txt} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} @@ -214,6 +195,15 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 4.2.0-4 +- add patch for PHP 8.3 from ammended + https://github.com/cataphract/php-rar/pull/18 +- build out of sources tree + +* Thu Sep 15 2022 Remi Collet <remi@remirepo.net> - 4.2.0-3 +- add patch for PHP 8.2 from + https://github.com/cataphract/php-rar/pull/18 + * Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 4.2.0-2 - add upstream patch for PHP 8.1 |