diff options
Diffstat (limited to 'php-geos.spec')
-rw-r--r-- | php-geos.spec | 71 |
1 files changed, 45 insertions, 26 deletions
diff --git a/php-geos.spec b/php-geos.spec index 441bd04..c11eea5 100644 --- a/php-geos.spec +++ b/php-geos.spec @@ -10,9 +10,9 @@ %bcond_without tests %if 0%{?scl:1} -%scl_package php-geos +%scl_package php-geos %else -%global pkg_name php-geos +%global pkg_name php-geos %endif #global prever rc3 %global pecl_name geos @@ -22,10 +22,18 @@ %else %global ini_name 40-%{pecl_name}.ini %endif +%global sources %{pkg_name} +%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} Name: %{?scl_prefix}php-%{pecl_name} Version: 1.0.0 -Release: 24%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 25%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Summary: PHP module for GEOS @@ -54,7 +62,6 @@ BuildRequires: geos-devel >= 3.4 Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} # Dropped from geos Obsoletes: %{?scl_prefix}geos-php <= 3.5.0 @@ -70,9 +77,8 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -mv %{pkg_name} NTS -cd NTS +cd %{sources} chmod -x *.c %patch -P0 -p1 -b .test %patch -P1 -p1 -b .wformat @@ -96,25 +102,26 @@ cat << 'EOF' | tee %{ini_name} extension=%{pecl_name}.so EOF - +mkdir NTS %if %{with_zts} # Duplicate source tree for NTS / ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif %build %{?dtsenable} -cd NTS -%{_bindir}/phpize -%configure --with-php-config=%{_bindir}/php-config +cd %{sources} +%{__phpize} + +cd ../NTS +%configure --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize -%configure --with-php-config=%{_bindir}/zts-php-config +%configure --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -137,38 +144,48 @@ install -Dpm 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} : 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_zts} : Minimal load test for NTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --modules | grep '^%{pecl_name}$' %endif %if %{with tests} -%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8 +cd %{sources} +if pkg-config geos --atleast-version 3.12; then +# See https://git.osgeo.org/gitea/geos/php-geos/issues/31 +# ignore failing test with geos 3.12 +rm tests/002_WKTWriter.phpt +rm tests/004_WKBWriter.phpt +rm tests/005_WKBReader.phpt +fi +if pkg-config geos --atleast-version 3.8; then # See https://git.osgeo.org/gitea/geos/php-geos/issues/23 # ignore failing test with geos 3.8 -rm ?TS/tests/001_Geometry.phpt +rm tests/001_Geometry.phpt +fi +%ifarch ppc64 ppc64le aarch64 armv7hl s390 s390x +# see https://git.osgeo.org/gogs/geos/php-geos/issues/17 +# ignore failing tests +rm -f tests/001_Geometry.phpt +rm -f tests/005_WKBReader.phpt %endif -cd NTS : 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 : 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 exit $ret @@ -177,8 +194,8 @@ exit $ret %files %{!?_licensedir:%global license %%doc} -%license NTS/{COPYING,LGPL-2,MIT-LICENSE} -%doc NTS/{CREDITS,NEWS,README.md,TODO} +%license %{sources}/{COPYING,LGPL-2,MIT-LICENSE} +%doc %{sources}/{CREDITS,NEWS,README.md,TODO} %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -190,8 +207,10 @@ exit $ret %changelog -* Fri Mar 31 2023 Remi Collet <remi@remirepo.net> - 1.0.0-27 +* Thu Jul 20 2023 Remi Collet <remi@remirepo.net> - 1.0.0-25 +- build out of sources tree - use SPDX license ID +- ignore 2 tests failing with libgeos 3.12 #2226098 * Fri Sep 9 2022 Remi Collet <remi@remirepo.net> - 1.0.0-24 - add patch for PHP 8.2 from |