From 190a6a9995b27f188029db72d18350dcd3854209 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 17 Oct 2024 15:21:14 +0200 Subject: modernize --- php-pecl-ssdeep.spec | 61 +++++++++++----------------------------------------- 1 file changed, 12 insertions(+), 49 deletions(-) (limited to 'php-pecl-ssdeep.spec') diff --git a/php-pecl-ssdeep.spec b/php-pecl-ssdeep.spec index 82e874b..6e1155b 100644 --- a/php-pecl-ssdeep.spec +++ b/php-pecl-ssdeep.spec @@ -3,16 +3,13 @@ # # Fedora spec file for php-pecl-ssdeep # -# Copyright (c) 2014-2023 Remi Collet +# Copyright (c) 2014-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build - %if 0%{?scl:1} %scl_package php-pecl-ssdeep %else @@ -23,27 +20,17 @@ %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name ssdeep -%if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini -%else %global ini_name 40-%{pecl_name}.ini -%endif %global sources %{pecl_name}-%{version} %global _configure ../%{sources}/configure -# 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} - Summary: Wrapper for libfuzzy library Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 1.1.0 Release: 13%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD-2-Clause 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 Patch0: https://patch-diff.githubusercontent.com/raw/php/pecl-text-ssdeep/pull/2.patch @@ -86,7 +73,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 pushd %{sources} @@ -117,13 +104,16 @@ 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-ssdeep=%{_root_prefix} \ --with-php-config=%{__phpconfig} \ --with-libdir=%{_lib} -make %{?_smp_mflags} + +%make_build %if %{with_zts} cd ../ZTS @@ -131,14 +121,15 @@ cd ../ZTS --with-ssdeep=%{_root_prefix} \ --with-php-config=%{__ztsphpconfig} \ --with-libdir=%{_lib} -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} @@ -147,7 +138,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 @@ -159,26 +150,6 @@ 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} @@ -200,19 +171,11 @@ 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 -q --show-diff -%endif %endif %files -%{?_licensedir:%license %{sources}/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} -- cgit