From 4fda0bbd5d1410d57541791a350fc0a4d91f0fcc Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 18 Oct 2024 10:10:43 +0200 Subject: modernize --- php-pecl-fann.spec | 52 ++++++++-------------------------------------------- 1 file changed, 8 insertions(+), 44 deletions(-) diff --git a/php-pecl-fann.spec b/php-pecl-fann.spec index 18d4c10..3d98e83 100644 --- a/php-pecl-fann.spec +++ b/php-pecl-fann.spec @@ -12,21 +12,11 @@ %{?scl:%scl_package php-pecl-fann} -# 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} - %bcond_without tests %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name fann -%if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini -%else %global ini_name 40-%{pecl_name}.ini -%endif %global upstream_version 1.2.0 #global upstream_prever RC2 @@ -70,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"/' \ -i package.xml cd %{sources} @@ -99,24 +89,26 @@ 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 \ --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 -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS # install config file install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -125,7 +117,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 @@ -162,40 +154,12 @@ REPORT_EXIT_STATUS=1 \ %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' - -%if %{with tests} -: Upstream test suite for ZTS extension -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \ -REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php $OPTS -%endif -%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 %doc %{pecl_docdir}/%{pecl_name} -%{?_licensedir:%license %{sources}/LICENSE} +%license %{sources}/LICENSE %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} -- cgit