From e359014c53d1b36a77f31f189a8d6ee1973b6c2d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 11 Jul 2023 17:28:43 +0200 Subject: build out of sources tree --- php-maxminddb.spec | 58 +++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/php-maxminddb.spec b/php-maxminddb.spec index d7a5ab8..7fae7be 100644 --- a/php-maxminddb.spec +++ b/php-maxminddb.spec @@ -1,7 +1,7 @@ # remirepo spec file for php-maxminddb # -# Copyright (c) 2018-2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2018-2023 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries @@ -26,12 +26,13 @@ # pure PHP library %global pk_vendor maxmind-db %global pk_project reader +%global _configure ../ext/configure Summary: MaxMind DB Reader extension Name: %{?scl_prefix}php-maxminddb Version: 1.11.0 -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: ASL 2.0 +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +License: Apache-2.0 URL: https://github.com/%{gh_owner}/%{gh_project} # keep using git snapshot to retrieve extension + library + test @@ -44,7 +45,6 @@ BuildRequires: pkgconfig(libmaxminddb) >= 1.0.0 Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} # Weak dependencie on databasess %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Recommends: geolite2-country @@ -57,18 +57,6 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{rele 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.3" -Obsoletes: php73-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.4" -Obsoletes: php74-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.0" -Obsoletes: php80-%{pecl_name} <= %{version} -%endif -%endif - %description MaxMind DB is a binary file format that stores data indexed by @@ -150,10 +138,7 @@ Autoloader: %{_datadir}/php/MaxMind/Db/Reader/autoload.php src/MaxMind/Db %endif -mv ext NTS - -cd NTS - +cd ext # Sanity check, really often broken extver=$(sed -n '/#define PHP_MAXMINDDB_VERSION/{s/.* "//;s/".*$//;p}' php_maxminddb.h) if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then @@ -162,9 +147,9 @@ if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then fi cd .. +mkdir NTS %if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif # Drop in the bit of configuration @@ -177,19 +162,20 @@ EOF %build %{?dtsenable} -cd NTS -%{_bindir}/phpize +cd ext +%{__phpize} + +cd ../NTS %configure \ - --with-php-config=%{_bindir}/php-config \ + --with-php-config=%{__phpconfig} \ --with-libdir=%{_lib} \ --with-maxminddb make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ - --with-php-config=%{_bindir}/zts-php-config \ + --with-php-config=%{__ztsphpconfig} \ --with-libdir=%{_lib} \ --with-maxminddb make %{?_smp_mflags} @@ -220,32 +206,29 @@ cp -pr src/MaxMind/Db %{buildroot}%{_datadir}/php/MaxMind/Db %check ret=0 -cd NTS +cd ext : 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}$' : Upstream test suite for NTS extension TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ -NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__php} -n run-tests.php --show-diff || ret=1 +%{__php} -n run-tests.php -q --show-diff || ret=1 %if %{with_zts} -cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --modules | grep '^%{pecl_name}$' : Upstream test suite for ZTS extension TEST_PHP_EXECUTABLE=%{__ztsphp} \ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ -NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php --show-diff || ret=1 +%{__ztsphp} -n run-tests.php -q --show-diff || ret=1 %endif %if %{with_lib} && %{with tests} @@ -315,6 +298,9 @@ fi # when using pkgup, CHECK Release! %changelog +* Tue Jul 11 2023 Remi Collet - 1.11.0-3 +- build out of sources tree + * Fri Aug 5 2022 Remi Collet - 1.11.0-2 - rebuild -- cgit