diff options
author | Remi Collet <remi@remirepo.net> | 2024-10-15 15:53:05 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-10-15 15:53:05 +0200 |
commit | 50b4d4481ef1cf7593540db2b93e0b0c2ca5f3b9 (patch) | |
tree | 37b5b5b5ba62989691ceb8b1e75df869524e26a0 | |
parent | 850639e33950b7b3e99451efd0923ae5457cd88f (diff) |
-rw-r--r-- | php-pecl-apfd.spec | 56 |
1 files changed, 13 insertions, 43 deletions
diff --git a/php-pecl-apfd.spec b/php-pecl-apfd.spec index 3d5a6c6..5572f15 100644 --- a/php-pecl-apfd.spec +++ b/php-pecl-apfd.spec @@ -3,7 +3,7 @@ # # Fedora spec file for php-pecl-apfd # -# Copyright (c) 2015-2023 Remi Collet +# Copyright (c) 2015-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -14,19 +14,9 @@ %bcond_without tests -# For PHP < 5.6 and 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} - %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name apfd -%if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini -%else %global ini_name 40-%{pecl_name}.ini -%endif #global prever RC1 %global sources %{pecl_name}-%{version} %global _configure ../%{sources}/configure @@ -73,7 +63,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO # 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 %{sources} @@ -102,26 +92,30 @@ EOF cd %{sources} %{__phpize} +[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global +sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL cd ../NTS %configure \ --enable-apfd \ --with-php-config=%{__phpconfig} -make %{?_smp_mflags} + +%make_build %if %{with_zts} cd ../ZTS %configure \ --enable-apfd \ --with-php-config=%{__ztsphpconfig} -make %{?_smp_mflags} + +%make_build %endif %install %{?dtsenable} -make -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS # install config file install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -130,7 +124,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %if %{with_zts} -make -C ZTS install INSTALL_ROOT=%{buildroot} +%make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -141,33 +135,13 @@ 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 %{sources} : Minimal load test for NTS extension %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --modules | grep '^%{pecl_name}$' %if %{with tests} : Upstream test suite for NTS extension @@ -186,17 +160,13 @@ cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} - -%if %{with tests} -: Upstream test suite skipped as zts-php-cgi not available -%endif + --modules | grep '^%{pecl_name}$' %endif %files +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} -%{?_licensedir:%license %{sources}/LICENSE} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} |