diff options
author | Remi Collet <remi@remirepo.net> | 2024-10-16 08:35:28 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-10-16 08:35:28 +0200 |
commit | 34cab4e329438cb180bb3d18714ca7102fd2cb87 (patch) | |
tree | 3d5f8475e9763b8b721621f9c34a9e766a77ed34 | |
parent | 75a4e7f92e4e7b3f1536e19af21ad7a535895f38 (diff) |
-rw-r--r-- | php-pecl-ip2location.spec | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/php-pecl-ip2location.spec b/php-pecl-ip2location.spec index 5bbc2eb..ecf8590 100644 --- a/php-pecl-ip2location.spec +++ b/php-pecl-ip2location.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-ip2location # -# Copyright (c) 2017-2023 Remi Collet +# Copyright (c) 2017-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -8,19 +8,9 @@ # %{?scl:%scl_package php-pecl-ip2location} -# Defined in Fedora >= 37 and RHEL >= 10, in PHP >= 7.4 for remirepo -%{!?__phpize: %global __phpize %{_bindir}/phpize} -%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize} -%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config} -%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config} - %global pecl_name ip2location %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini -%else %global ini_name 40-%{pecl_name}.ini -%endif %global upstream_version 8.2.0 #global upstream_prever RC1 @@ -47,7 +37,6 @@ Requires: IP2Location-libs%{?_isa} >= %{libversion} 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} @@ -71,7 +60,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO # Don't install tests sed -e 's/role="test"/role="src"/' \ - %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ + -e '/LICENSE/s/role="doc"/role="src"/' \ -e '/README.TXT/s/role="doc"/role="test"/' \ -e '/AGREEMENT.PDF/s/role="doc"/role="test"/' \ -i package.xml @@ -102,23 +91,25 @@ EOF %{?dtsenable} cd %{sources} -%{_bindir}/phpize +%{__phpize} +[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global +sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL cd ../NTS %configure --with-php-config=%{__phpconfig} -make %{?_smp_mflags} +%make_build %if %{with_zts} cd ../ZTS %configure --with-php-config=%{__ztsphpconfig} -make %{?_smp_mflags} +%make_build %endif %install %{?dtsenable} -make install -C NTS INSTALL_ROOT=%{buildroot} +%make_install -C NTS install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml @@ -126,7 +117,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install the ZTS stuff %if %{with_zts} -make install -C ZTS INSTALL_ROOT=%{buildroot} +%make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -139,7 +130,7 @@ done %check cd %{sources} : simple NTS module load test -%{_bindir}/php --no-php-ini \ +%{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} @@ -154,37 +145,11 @@ REPORT_EXIT_STATUS=1 \ %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} - -: upstream test suite -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ -REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php -q --show-diff -%endif - - -%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 %files -%{?_licensedir:%license %{sources}/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %config(noreplace) %{php_inidir}/%{ini_name} |