From aac287cda6e99154375a757eb9629e3eda490e62 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 8 Aug 2020 07:47:26 +0200 Subject: update to 1.7.0 now available on pecl raise dependency on PHP 7.2 switch to phpunit8 --- php-maxminddb.spec | 75 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 23 deletions(-) (limited to 'php-maxminddb.spec') diff --git a/php-maxminddb.spec b/php-maxminddb.spec index 6b9f366..c7cf204 100644 --- a/php-maxminddb.spec +++ b/php-maxminddb.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-maxminddb # -# Copyright (c) 2018-2019 Remi Collet +# Copyright (c) 2018-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -17,7 +17,7 @@ %global with_tests 0%{!?_without_tests:1} -%global gh_commit febd4920bf17c1da84cef58e56a8227dfb37fbe4 +%global gh_commit 942553da239f12051275f9c666538b5dd09e2908 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner maxmind %global gh_project MaxMind-DB-Reader-php @@ -31,16 +31,18 @@ Summary: MaxMind DB Reader extension Name: %{?sub_prefix}php-maxminddb -Version: 1.6.0 +Version: 1.7.0 %global rpmrel 1 Release: %{rpmrel}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: ASL 2.0 URL: https://github.com/%{gh_owner}/%{gh_project} +# keep using git snapshot to retrieve extension + library + test Source0: %{pkg_name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh -BuildRequires: %{?scl_prefix}php-devel >= 5.6 +BuildRequires: %{?scl_prefix}php-devel >= 7.2 +BuildRequires: %{?scl_prefix}php-pear >= 1.10 BuildRequires: pkgconfig(libmaxminddb) >= 1.0.0 Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} @@ -52,19 +54,13 @@ Recommends: geolite2-country Suggests: geolite2-city %endif -%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -%if "%{php_version}" > "5.6" -Obsoletes: php56u-%{pecl_name} <= %{version} -Obsoletes: php56w-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.0" -Obsoletes: php70u-%{pecl_name} <= %{version} -Obsoletes: php70w-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.1" -Obsoletes: php71u-%{pecl_name} <= %{version} -Obsoletes: php71w-%{pecl_name} <= %{version} -%endif +# PECL +Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} +Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} + +%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} %if "%{php_version}" > "7.2" Obsoletes: php72u-%{pecl_name} <= %{version} Obsoletes: php72w-%{pecl_name} <= %{version} @@ -77,6 +73,9 @@ Obsoletes: php73w-%{pecl_name} <= %{version} Obsoletes: php74-%{pecl_name} <= %{version} Obsoletes: php74w-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "8.0" +Obsoletes: php80-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -110,10 +109,11 @@ BuildRequires: php-bcmath BuildRequires: php-gmp # from composer.json "require-dev": { # "friendsofphp/php-cs-fixer": "2.*", -# "phpunit/phpunit": "5.*", -# "satooshi/php-coveralls": "1.0.*", +# "phpunit/phpunit": ">=8.0.0,<10.0.0", +# "php-coveralls/php-coveralls": "^2.1", +# "phpunit/phpcov": ">=6.0.0", # "squizlabs/php_codesniffer": "3.*" -BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: phpunit8 %endif # from composer.json "require": { @@ -214,6 +214,8 @@ make %{?_smp_mflags} %install %{?dtsenable} +# Install XML package description +install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml # Install the NTS stuff make -C NTS install INSTALL_ROOT=%{buildroot} @@ -265,9 +267,9 @@ REPORT_EXIT_STATUS=1 \ %if %{with_lib} && %{with_tests} cd .. : Upstream test suite for the library -for cmd in php php56 php70 php71 php72 php73 php74; do +for cmd in php php72 php73 php74 php80; do if which $cmd; then - $cmd %{_bindir}/phpunit \ + $cmd %{_bindir}/phpunit8 \ --bootstrap %{buildroot}%{_datadir}/php/MaxMind/Db/Reader/autoload.php \ --verbose || ret=1 fi @@ -275,17 +277,38 @@ done : Upstream test suite for the library with the extension php --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - %{_bindir}/phpunit \ + %{_bindir}/phpunit8 \ --bootstrap %{buildroot}%{_datadir}/php/MaxMind/Db/Reader/autoload.php \ --verbose || ret=1 %endif exit $ret +%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:%global license %%doc} %license LICENSE %doc *.md +%{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -308,6 +331,12 @@ exit $ret # when using pkgup, CHECK Release! %changelog +* Sat Aug 8 2020 Remi Collet - 1.7.0-1 +- update to 1.7.0 +- now available on pecl +- raise dependency on PHP 7.2 +- switch to phpunit8 + * Fri Dec 20 2019 Remi Collet - 1.6.0-1 - update to 1.6.0 -- cgit