From 6daa25cc6f59eb11eeb0bfb6b40e912fdd3ae873 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 1 Sep 2023 14:26:37 +0200 Subject: build out of sources tree --- php-pecl-quickhash.spec | 52 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/php-pecl-quickhash.spec b/php-pecl-quickhash.spec index 60c5a45..12a691e 100644 --- a/php-pecl-quickhash.spec +++ b/php-pecl-quickhash.spec @@ -1,25 +1,27 @@ # spec file for php-pecl-quickhash # -# Copyright (c) 2013-2022 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 # -%{?scl: %scl_package php-pecl-quickhash} +%{?scl:%scl_package php-pecl-quickhash} -%global pecl_name quickhash -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global ini_name 40-%{pecl_name}.ini +%global pecl_name quickhash +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global ini_name 40-%{pecl_name}.ini +%global sources %{pecl_name}-%{version} +%global _configure ../%{sources}/configure Summary: Set of specific strongly-typed classes for sets and hashing Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 1.1.1 -Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} -License: PHP +Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +License: PHP-3.01 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 BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -28,7 +30,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} @@ -49,18 +50,17 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -mv %{pecl_name}-%{version} NTS %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} -cd NTS +cd %{sources} # Sanity check, really often broken grep %{version} quickhash.c cd .. +mkdir NTS %if %{with_zts} -# Duplicate source tree for NTS / ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif # Create configuration file @@ -71,20 +71,21 @@ EOF %build -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 @@ -107,7 +108,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} # Test & 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 @@ -133,22 +134,20 @@ fi %check : Minimal load test for NTS extension -cd NTS %{__php} --no-php-ini \ - --define extension=modules/%{pecl_name}.so \ + --define extension=../NTS/modules/%{pecl_name}.so \ --modules | grep %{pecl_name} %if %{with_zts} : Minimal load test for ZTS extension -cd ../ZTS %{__ztsphp} --no-php-ini \ - --define extension=modules/%{pecl_name}.so \ + --define extension=../ZTS/modules/%{pecl_name}.so \ --modules | grep %{pecl_name} %endif %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -162,6 +161,9 @@ cd ../ZTS %changelog +* Fri Sep 1 2023 Remi Collet - 1.1.1-2 +- build out of sources tree + * Tue Jul 19 2022 Remi Collet - 1.1.1-1 - update to 1.1.1 - raise dependency on PHP 7 -- cgit