diff options
Diffstat (limited to 'php-pecl-trie.spec')
-rw-r--r-- | php-pecl-trie.spec | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/php-pecl-trie.spec b/php-pecl-trie.spec index 593128b..461bee1 100644 --- a/php-pecl-trie.spec +++ b/php-pecl-trie.spec @@ -1,29 +1,27 @@ # remirepo spec file for php-pecl-trie # -# Copyright (c) 2020-2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2020-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-trie -%endif - -%global pecl_name php_trie -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global ini_name 40-%{pecl_name}.ini +%{?scl:%scl_package php-pecl-trie} -%global libver 0.6.0 +%global pecl_name php_trie +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global ini_name 40-%{pecl_name}.ini +%global libver 0.6.0 +%global sources %{pecl_name}-%{version} +%global _configure ../%{sources}/configure Summary: PHP Trie extension -Name: %{?sub_prefix}php-pecl-trie +Name: %{?scl_prefix}php-pecl-trie 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}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz # headers only library Source1: https://github.com/Tessil/hat-trie/archive/v%{libver}.tar.gz @@ -36,7 +34,6 @@ BuildRequires: %{?scl_prefix}php-json BuildRequires: %{?scl_prefix}php-json%{?_isa} 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} @@ -56,14 +53,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -a 1 -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 +cd %{sources} # Sanity check, really often broken extver=$(sed -n '/#define PHP_TRIE_EXT_EXTVER/{s/.* "//;s/".*$//;p}' php_trie_ext.h) if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then @@ -72,9 +68,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 @@ -89,24 +85,25 @@ EOF HATTRIE=$PWD/hat-trie-%{libver}/include/tsl -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} + +cd ../NTS %configure \ --enable-php_trie \ --with-hattrie=${HATTRIE} \ --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 \ --enable-php_trie \ --with-hattrie=${HATTRIE} \ --with-libdir=%{_lib} \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -131,7 +128,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 @@ -156,35 +153,34 @@ fi %check +cd %{sources} OPT="-n" [ -f %{php_extdir}/json.so ] && OPT="$OPT -d extension=json" : Minimal load test for NTS extension -cd NTS %{__php} $OPT \ - --define extension=modules/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --define extension=../NTS/modules/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' : Upstream test suite for NTS extension -TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \ +TEST_PHP_ARGS="$OPT -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \ %{__php} -n run-tests.php -q -P --show-diff %if %{with_zts} : Minimal load test for ZTS extension -cd ../ZTS %{__ztsphp} $OPT \ - --define extension=modules/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --define extension=../ZTS/modules/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' : Upstream test suite for ZTS extension -TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \ +TEST_PHP_ARGS="$OPT -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \ %{__ztsphp} -n run-tests.php -q -P --show-diff %endif %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -198,6 +194,9 @@ TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \ %changelog +* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 0.1.2-2 +- build out of sources tree + * Wed May 25 2022 Remi Collet <remi@remirepo.net> - 0.1.2-1 - update to 0.1.2 |