From acbdf6cd2d893a4541b8c245431f56fcb42ce16b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 26 May 2023 13:42:12 +0200 Subject: build out of sources tree remove SCL compatibility --- php-pecl-bitset.spec | 104 ++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 60 deletions(-) diff --git a/php-pecl-bitset.spec b/php-pecl-bitset.spec index 47a0e72..34f8f57 100644 --- a/php-pecl-bitset.spec +++ b/php-pecl-bitset.spec @@ -1,3 +1,6 @@ +# Fedora spec file for php-pecl-bitset +# without SCL compatibility, from: +# # remirepo spec file for php-pecl-bitset # # Copyright (c) 2014-2023 Remi Collet @@ -6,52 +9,57 @@ # # Please, preserve the changelog entries # -%{?scl: %scl_package php-pecl-bitset} - %bcond_without tests %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name bitset %global ini_name 40-%{pecl_name}.ini +%global sources %{pecl_name}-%{version} +%global _configure ../%{sources}/configure -Summary: BITSET library -Name: %{?scl_prefix}php-pecl-%{pecl_name} +# For EPEL-9 +%{!?__phpize: %global __phpize %{_bindir}/phpize} +%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize} +%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config} +%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config} + +Summary: BITSET extension +Name: php-pecl-%{pecl_name} Version: 3.2.0 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist} License: PHP-3.01 URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz BuildRequires: make -BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel >= 7.0 -BuildRequires: %{?scl_prefix}php-pear +BuildRequires: gcc +BuildRequires: php-devel +BuildRequires: 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}} +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} -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} +Provides: php-%{pecl_name} = %{version} +Provides: php-%{pecl_name}%{?_isa} = %{version} +Provides: php-pecl(%{pecl_name}) = %{version} +Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} %description -Bitsets manipulation library. +The BitSet extension assists by providing a mechanism to manage sets of bits. -Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. +This provides a similar API (object-based) to java.util.BitSet with some +PHP-specific flavoring. %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"/' } \ + -e '/LICENSE/s/role="doc"/role="src"/' \ -i package.xml -cd NTS +cd %{sources} # Sanity check, really often broken extver=$(sed -n '/#define PHP_BITSET_VERSION/{s/.* "//;s/".*$//;p}' php_bitset.h) if test "x${extver}" != "x%{version}"; then @@ -60,9 +68,10 @@ if test "x${extver}" != "x%{version}"; 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 @@ -71,28 +80,24 @@ cat > %{ini_name} << 'EOF' extension=%{pecl_name}.so EOF - %build -%{?dtsenable} +cd %{sources} +%{__phpize} -cd NTS -%{_bindir}/phpize +cd ../NTS %configure \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif %install -%{?dtsenable} - make -C NTS install INSTALL_ROOT=%{buildroot} # install config file @@ -109,32 +114,12 @@ 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 -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi -%endif - - %check -cd NTS +cd %{sources} : Minimal load test for NTS extension %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ @@ -142,14 +127,11 @@ cd NTS %if %{with tests} : Upstream test suite for NTS extension -TEST_PHP_EXECUTABLE=%{__php} \ -TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ -REPORT_EXIT_STATUS=1 \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ %{__php} -n run-tests.php -q --show-diff %endif %if %{with_zts} -cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ @@ -157,16 +139,14 @@ cd ../ZTS %if %{with tests} : Upstream test suite for ZTS extension -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ -REPORT_EXIT_STATUS=1 \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %{__ztsphp} -n run-tests.php -q --show-diff %endif %endif %files -%{?_licensedir:%license NTS/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -180,6 +160,10 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Fri May 26 2023 Remi Collet - 3.2.0-2 +- build out of sources tree +- remove SCL compatibility + * Fri May 26 2023 Remi Collet - 3.2.0-1 - update to 3.2.0 -- cgit