From d2abcd64121cd41c3dc3705e92b27717941dd1bc Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 26 Jul 2023 09:28:06 +0200 Subject: build out of sources tree use SPDX license ID ignore 2 tests failing with libgeos 3.12 #2226098 --- REFLECTION | 399 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- php-geos.spec | 71 +++++++---- 2 files changed, 420 insertions(+), 50 deletions(-) diff --git a/REFLECTION b/REFLECTION index 5c65313..1fd699c 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,38 +1,59 @@ -Extension [ extension #89 geos version 1.0.0 ] { +Extension [ extension #124 geos version 1.0.0 ] { - Constants [20] { - Constant [ integer GEOSBUF_CAP_ROUND ] { 1 } - Constant [ integer GEOSBUF_CAP_FLAT ] { 2 } - Constant [ integer GEOSBUF_CAP_SQUARE ] { 3 } - Constant [ integer GEOSBUF_JOIN_ROUND ] { 1 } - Constant [ integer GEOSBUF_JOIN_MITRE ] { 2 } - Constant [ integer GEOSBUF_JOIN_BEVEL ] { 3 } - Constant [ integer GEOS_POINT ] { 0 } - Constant [ integer GEOS_LINESTRING ] { 1 } - Constant [ integer GEOS_LINEARRING ] { 2 } - Constant [ integer GEOS_POLYGON ] { 3 } - Constant [ integer GEOS_MULTIPOINT ] { 4 } - Constant [ integer GEOS_MULTILINESTRING ] { 5 } - Constant [ integer GEOS_MULTIPOLYGON ] { 6 } - Constant [ integer GEOS_GEOMETRYCOLLECTION ] { 7 } - Constant [ integer GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE ] { 1 } - Constant [ integer GEOSRELATE_BNR_MOD2 ] { 1 } - Constant [ integer GEOSRELATE_BNR_OGC ] { 1 } - Constant [ integer GEOSRELATE_BNR_ENDPOINT ] { 2 } - Constant [ integer GEOSRELATE_BNR_MULTIVALENT_ENDPOINT ] { 3 } - Constant [ integer GEOSRELATE_BNR_MONOVALENT_ENDPOINT ] { 4 } + Constant [ int GEOSBUF_CAP_ROUND ] { 1 } + Constant [ int GEOSBUF_CAP_FLAT ] { 2 } + Constant [ int GEOSBUF_CAP_SQUARE ] { 3 } + Constant [ int GEOSBUF_JOIN_ROUND ] { 1 } + Constant [ int GEOSBUF_JOIN_MITRE ] { 2 } + Constant [ int GEOSBUF_JOIN_BEVEL ] { 3 } + Constant [ int GEOS_POINT ] { 0 } + Constant [ int GEOS_LINESTRING ] { 1 } + Constant [ int GEOS_LINEARRING ] { 2 } + Constant [ int GEOS_POLYGON ] { 3 } + Constant [ int GEOS_MULTIPOINT ] { 4 } + Constant [ int GEOS_MULTILINESTRING ] { 5 } + Constant [ int GEOS_MULTIPOLYGON ] { 6 } + Constant [ int GEOS_GEOMETRYCOLLECTION ] { 7 } + Constant [ int GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE ] { 1 } + Constant [ int GEOSRELATE_BNR_MOD2 ] { 1 } + Constant [ int GEOSRELATE_BNR_OGC ] { 1 } + Constant [ int GEOSRELATE_BNR_ENDPOINT ] { 2 } + Constant [ int GEOSRELATE_BNR_MULTIVALENT_ENDPOINT ] { 3 } + Constant [ int GEOSRELATE_BNR_MONOVALENT_ENDPOINT ] { 4 } } - Functions { Function [ function GEOSVersion ] { + + - Parameters [0] { + } } Function [ function GEOSPolygonize ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Function [ function GEOSLineMerge ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Function [ function GEOSSharedPaths ] { + + - Parameters [2] { + Parameter #0 [ $geom1 ] + Parameter #1 [ $geom2 ] + } } Function [ function GEOSRelateMatch ] { + + - Parameters [2] { + Parameter #0 [ $maxtric ] + Parameter #1 [ $pattern ] + } } } @@ -53,9 +74,16 @@ Extension [ extension #89 geos version 1.0.0 ] { - Methods [2] { Method [ public method __construct ] { + + - Parameters [0] { + } } Method [ public method read ] { + + - Parameters [1] { + Parameter #0 [ $wkt ] + } } } } @@ -76,29 +104,55 @@ Extension [ extension #89 geos version 1.0.0 ] { - Methods [7] { Method [ public method __construct ] { + + - Parameters [0] { + } } Method [ public method write ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method setTrim ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method setRoundingPrecision ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method setOutputDimension ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method getOutputDimension ] { + + - Parameters [0] { + } } Method [ public method setOld3D ] { + + - Parameters [1] { + Parameter #0 [ $bval ] + } } } } - Class [ class GEOSGeometry ] { + Class [ class GEOSGeometry implements Stringable ] { - Constants [0] { } @@ -112,197 +166,451 @@ Extension [ extension #89 geos version 1.0.0 ] { - Properties [0] { } - - Methods [64] { + - Methods [66] { Method [ public method __construct ] { + + - Parameters [0] { + } } - Method [ public method __toString ] { + Method [ public method __toString ] { + + - Parameters [0] { + } + - Return [ string ] } Method [ public method project ] { + + - Parameters [2] { + Parameter #0 [ $geom ] + Parameter #1 [ $normalized = ] + } } Method [ public method interpolate ] { + + - Parameters [2] { + Parameter #0 [ $dist ] + Parameter #1 [ $normalized = ] + } } Method [ public method buffer ] { + + - Parameters [2] { + Parameter #0 [ $dist ] + Parameter #1 [ $style = ] + } } Method [ public method offsetCurve ] { + + - Parameters [2] { + Parameter #0 [ $dist ] + Parameter #1 [ $style = ] + } } Method [ public method envelope ] { + + - Parameters [0] { + } } Method [ public method intersection ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method convexHull ] { + + - Parameters [0] { + } } Method [ public method difference ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method symDifference ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method boundary ] { + + - Parameters [0] { + } } Method [ public method union ] { + + - Parameters [1] { + Parameter #0 [ $geom = ] + } } Method [ public method pointOnSurface ] { + + - Parameters [0] { + } } Method [ public method centroid ] { + + - Parameters [0] { + } } Method [ public method relate ] { + + - Parameters [2] { + Parameter #0 [ $geom ] + Parameter #1 [ $pattern = ] + } } Method [ public method relateBoundaryNodeRule ] { + + - Parameters [2] { + Parameter #0 [ $geom ] + Parameter #1 [ $rule ] + } } Method [ public method simplify ] { + + - Parameters [2] { + Parameter #0 [ $tolerance ] + Parameter #1 [ $preserveTopology = ] + } } Method [ public method normalize ] { + + - Parameters [0] { + } + } + + Method [ public method setPrecision ] { + + - Parameters [2] { + Parameter #0 [ $gridsize ] + Parameter #1 [ $flags = ] + } + } + + Method [ public method getPrecision ] { + + - Parameters [0] { + } } Method [ public method extractUniquePoints ] { + + - Parameters [0] { + } } Method [ public method disjoint ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method touches ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method intersects ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method crosses ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method within ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method contains ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method overlaps ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method covers ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method coveredBy ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method equals ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method equalsExact ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method isEmpty ] { + + - Parameters [0] { + } } Method [ public method checkValidity ] { + + - Parameters [1] { + Parameter #0 [ $flags = ] + } } Method [ public method isSimple ] { + + - Parameters [0] { + } } Method [ public method isRing ] { + + - Parameters [0] { + } } Method [ public method hasZ ] { + + - Parameters [0] { + } } Method [ public method isClosed ] { + + - Parameters [0] { + } } Method [ public method typeName ] { + + - Parameters [0] { + } } Method [ public method typeId ] { + + - Parameters [0] { + } } Method [ public method getSRID ] { + + - Parameters [0] { + } } Method [ public method setSRID ] { + + - Parameters [1] { + Parameter #0 [ $srid = ] + } } Method [ public method numGeometries ] { + + - Parameters [0] { + } } Method [ public method geometryN ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method numInteriorRings ] { + + - Parameters [0] { + } } Method [ public method numPoints ] { + + - Parameters [0] { + } } Method [ public method getX ] { + + - Parameters [0] { + } } Method [ public method getY ] { + + - Parameters [0] { + } } Method [ public method interiorRingN ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method exteriorRing ] { + + - Parameters [0] { + } } Method [ public method numCoordinates ] { + + - Parameters [0] { + } } Method [ public method dimension ] { + + - Parameters [0] { + } } Method [ public method coordinateDimension ] { + + - Parameters [0] { + } } Method [ public method pointN ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method startPoint ] { + + - Parameters [0] { + } } Method [ public method endPoint ] { + + - Parameters [0] { + } } Method [ public method area ] { + + - Parameters [0] { + } } Method [ public method length ] { + + - Parameters [0] { + } } Method [ public method distance ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method hausdorffDistance ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method snapTo ] { + + - Parameters [2] { + Parameter #0 [ $geom ] + Parameter #1 [ $tolerance ] + } } Method [ public method node ] { + + - Parameters [0] { + } } Method [ public method delaunayTriangulation ] { + + - Parameters [2] { + Parameter #0 [ $tolerance = ] + Parameter #1 [ $edgeonly = ] + } } Method [ public method voronoiDiagram ] { + + - Parameters [3] { + Parameter #0 [ $tolerance = ] + Parameter #1 [ $edgeonly = ] + Parameter #2 [ $extent = ] + } } Method [ public method clipByRect ] { + + - Parameters [4] { + Parameter #0 [ $xmin ] + Parameter #1 [ $ymin ] + Parameter #2 [ $xmax ] + Parameter #3 [ $ymax ] + } } } } @@ -323,30 +631,62 @@ Extension [ extension #89 geos version 1.0.0 ] { - Methods [9] { Method [ public method __construct ] { + + - Parameters [0] { + } } Method [ public method getOutputDimension ] { + + - Parameters [0] { + } } Method [ public method setOutputDimension ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method getByteOrder ] { + + - Parameters [0] { + } } Method [ public method setByteOrder ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method getIncludeSRID ] { + + - Parameters [0] { + } } Method [ public method setIncludeSRID ] { + + - Parameters [1] { + Parameter #0 [ $num ] + } } Method [ public method write ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } Method [ public method writeHEX ] { + + - Parameters [1] { + Parameter #0 [ $geom ] + } } } } @@ -367,12 +707,23 @@ Extension [ extension #89 geos version 1.0.0 ] { - Methods [3] { Method [ public method __construct ] { + + - Parameters [0] { + } } Method [ public method read ] { + + - Parameters [1] { + Parameter #0 [ $wkb ] + } } Method [ public method readHEX ] { + + - Parameters [1] { + Parameter #0 [ $wkb ] + } } } } 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 - 1.0.0-27 +* Thu Jul 20 2023 Remi Collet - 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 - 1.0.0-24 - add patch for PHP 8.2 from -- cgit