From c4975645f6e9343fcdd8ed741ffae50c79da0fa8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 19 Jun 2025 16:06:34 +0200 Subject: update to 0.3.3 drop patch merged upstream re-license spec file to CECILL-2.1 fix test suite on aarch64 using patch from https://github.com/php-geospatial/geospatial/pull/33 --- PHPINFO | 2 +- REFLECTION | 127 ++++++++++++++++++++++++----------------------- php-pecl-geospatial.spec | 37 +++++++++----- tests.patch | 73 +++++++++++++++++++++++++++ 4 files changed, 164 insertions(+), 75 deletions(-) create mode 100644 tests.patch diff --git a/PHPINFO b/PHPINFO index fb9a04d..52c3c2b 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,4 +2,4 @@ geospatial Geospatial functions => enabled -Version => 0.3.2 +Version => 0.3.3 diff --git a/REFLECTION b/REFLECTION index 1821bfc..399c321 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #119 geospatial version 0.3.2 ] { +Extension [ extension #83 geospatial version 0.3.3 ] { - Constants [4] { Constant [ float GEO_DEG_TO_RAD ] { 0.017453292519943 } @@ -8,123 +8,128 @@ Extension [ extension #119 geospatial version 0.3.2 ] { } - Functions { - Function [ function haversine ] { - - - Parameters [3] { - Parameter #0 [ $geoJsonPointFrom ] - Parameter #1 [ $geoJsonPointTo ] - Parameter #2 [ $radius = ] - } - } - Function [ function initial_bearing ] { + Function [ function dms_to_decimal ] { - - Parameters [3] { - Parameter #0 [ $geoJsonPointFrom ] - Parameter #1 [ $geoJsonPointTo ] - Parameter #2 [ $radius = ] + - Parameters [4] { + Parameter #0 [ float $degrees ] + Parameter #1 [ float $minutes ] + Parameter #2 [ float $seconds ] + Parameter #3 [ string $direction = "" ] } + - Return [ float ] } - Function [ function fraction_along_gc_line ] { + Function [ function decimal_to_dms ] { - - Parameters [4] { - Parameter #0 [ $geoJsonPointFrom ] - Parameter #1 [ $geoJsonPointTo ] - Parameter #2 [ $fraction ] - Parameter #3 [ $radius = ] + - Parameters [2] { + Parameter #0 [ float $decimal ] + Parameter #1 [ string $coordinate ] } + - Return [ array ] } Function [ function helmert ] { - Parameters [5] { - Parameter #0 [ $x ] - Parameter #1 [ $y ] - Parameter #2 [ $z ] - Parameter #3 [ $from_reference_ellipsoid = ] - Parameter #4 [ $to_reference_ellipsoid = ] + Parameter #0 [ float $x ] + Parameter #1 [ float $y ] + Parameter #2 [ float $z ] + Parameter #3 [ int $from_reference_ellipsoid = 0 ] + Parameter #4 [ int $to_reference_ellipsoid = 0 ] } + - Return [ array ] } Function [ function polar_to_cartesian ] { - Parameters [3] { - Parameter #0 [ $latitude ] - Parameter #1 [ $longitude ] - Parameter #2 [ $reference_ellipsoid = ] + Parameter #0 [ float $latitude ] + Parameter #1 [ float $longitude ] + Parameter #2 [ int $reference_ellipsoid = 0 ] } + - Return [ array ] } Function [ function cartesian_to_polar ] { - Parameters [4] { - Parameter #0 [ $x ] - Parameter #1 [ $y ] - Parameter #2 [ $z ] - Parameter #3 [ $reference_ellipsoid = ] + Parameter #0 [ float $x ] + Parameter #1 [ float $y ] + Parameter #2 [ float $z ] + Parameter #3 [ int $reference_ellipsoid = 0 ] } + - Return [ array ] } Function [ function transform_datum ] { - Parameters [3] { - Parameter #0 [ $GeoJSONPoint ] - Parameter #1 [ $from_reference_ellipsoid ] - Parameter #2 [ $to_reference_ellipsoid ] + Parameter #0 [ array $coordinates ] + Parameter #1 [ int $from_reference_ellipsoid ] + Parameter #2 [ int $to_reference_ellipsoid ] } + - Return [ array ] } - Function [ function dms_to_decimal ] { + Function [ function haversine ] { - - Parameters [4] { - Parameter #0 [ $degrees ] - Parameter #1 [ $minutes ] - Parameter #2 [ $seconds ] - Parameter #3 [ $direction = ] + - Parameters [3] { + Parameter #0 [ array $from ] + Parameter #1 [ array $to ] + Parameter #2 [ float $radius = GEO_EARTH_RADIUS ] } + - Return [ float ] } - Function [ function decimal_to_dms ] { + Function [ function vincenty ] { - - Parameters [2] { - Parameter #0 [ $decimal ] - Parameter #1 [ $coordinate ] + - Parameters [3] { + Parameter #0 [ array $from ] + Parameter #1 [ array $to ] + Parameter #2 [ float $reference_ellipsoid = GEO_WGS84 ] } + - Return [ float ] } - Function [ function vincenty ] { + Function [ function fraction_along_gc_line ] { - Parameters [3] { - Parameter #0 [ $geoJsonPointFrom ] - Parameter #1 [ $geoJsonPointTo ] - Parameter #2 [ $reference_ellipsoid = ] + Parameter #0 [ array $from ] + Parameter #1 [ array $to ] + Parameter #2 [ float $fraction ] } + - Return [ array ] } - Function [ function rdp_simplify ] { + Function [ function interpolate_linestring ] { - Parameters [2] { - Parameter #0 [ $pointsArray ] - Parameter #1 [ $epsilon ] + Parameter #0 [ array $line ] + Parameter #1 [ float $epsilon ] } + - Return [ array ] } - Function [ function interpolate_linestring ] { + Function [ function initial_bearing ] { - Parameters [2] { - Parameter #0 [ $GeoJSONLineString ] - Parameter #1 [ $epsilon ] + Parameter #0 [ array $from ] + Parameter #1 [ array $to ] } + - Return [ float ] } - Function [ function interpolate_polygon ] { + Function [ function rdp_simplify ] { - Parameters [2] { - Parameter #0 [ $GeoJSONPolygon ] - Parameter #1 [ $epsilon ] + Parameter #0 [ array $points ] + Parameter #1 [ float $epsilon ] } + - Return [ array ] } Function [ function geohash_encode ] { - Parameters [2] { - Parameter #0 [ $GeoJSONPoint ] - Parameter #1 [ $precision ] + Parameter #0 [ array $point ] + Parameter #1 [ int $precision = 12 ] } + - Return [ string ] } Function [ function geohash_decode ] { - Parameters [1] { - Parameter #0 [ $geohash ] + Parameter #0 [ string $geohash ] } + - Return [ array ] } } } diff --git a/php-pecl-geospatial.spec b/php-pecl-geospatial.spec index b4d0623..f3825e6 100644 --- a/php-pecl-geospatial.spec +++ b/php-pecl-geospatial.spec @@ -1,14 +1,16 @@ # remirepo spec file for php-pecl-geospatial # -# Copyright (c) 2015-2024 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2015-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # %{?scl:%scl_package php-pecl-geospatial} -%global gh_commit d3f3ab0a836f10eacb7e117c06f12ea57e1e8649 +%global pie_vend php-geospatial +%global pie_proj geospatial +%global gh_commit 6cd0365f9f89a22131755a6c60daa92473ecb4c3 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner php-geospatial %global gh_project geospatial @@ -23,22 +25,22 @@ Summary: PHP Extension to handle common geospatial functions Name: %{?scl_prefix}php-pecl-%{pecl_name} -Version: 0.3.2 +Version: 0.3.3 %if 0%{?gh_date:1} Release: 0.11.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %else -Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %endif License: PHP-3.01 URL: https://pecl.php.net/package/%{pecl_name} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz -Patch0: 31.patch +Patch0: tests.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel >= 7.0 +BuildRequires: %{?scl_prefix}php-devel >= 8.0 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json @@ -46,11 +48,13 @@ Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} # Package have be renamed -Obsoletes: %{?scl_prefix}php-%{pecl_name} < %{version} -Provides: %{?scl_prefix}php-%{pecl_name} = %{version} -Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +Obsoletes: %{?scl_prefix}php-%{pecl_name} < %{version} +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description @@ -195,6 +199,13 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Thu Jun 19 2025 Remi Collet - 0.3.3-1 +- update to 0.3.3 +- drop patch merged upstream +- re-license spec file to CECILL-2.1 +- fix test suite on aarch64 using patch from + https://github.com/php-geospatial/geospatial/pull/33 + * Wed Sep 25 2024 Remi Collet - 0.3.2-4 - spec cleanup - fix test suite on aarch64 using patch from diff --git a/tests.patch b/tests.patch new file mode 100644 index 0000000..42ddba7 --- /dev/null +++ b/tests.patch @@ -0,0 +1,73 @@ +From 59826af88d8e41f56dadcf9cd83af83d87698401 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 19 Jun 2025 15:55:09 +0200 +Subject: [PATCH] relax new test for aarch64 + +--- + tests/interpolate-line-string-001.phpt | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/tests/interpolate-line-string-001.phpt b/tests/interpolate-line-string-001.phpt +index 50292f3..d372595 100644 +--- a/tests/interpolate-line-string-001.phpt ++++ b/tests/interpolate-line-string-001.phpt +@@ -32,9 +32,9 @@ array(26) { + [2]=> + array(2) { + [0]=> +- float(11.000073920872426) ++ float(11.0000739208724%d) + [1]=> +- float(10.035925156338873) ++ float(10.0359251563388%d) + } + [3]=> + array(2) { +@@ -55,7 +55,7 @@ array(26) { + [0]=> + float(14.431497984318062) + [1]=> +- float(7.0743500242581225) ++ float(7.07435002425812%d) + } + [6]=> + array(2) { +@@ -74,9 +74,9 @@ array(26) { + [8]=> + array(2) { + [0]=> +- float(12.756998952507347) ++ float(12.7569989525073%d) + [1]=> +- float(-1.7055449208364544) ++ float(-1.70554492083645%d) + } + [9]=> + array(2) { +@@ -95,9 +95,9 @@ array(26) { + [11]=> + array(2) { + [0]=> +- float(11.067030621797189) ++ float(11.0670306217971%d) + [1]=> +- float(-10.483970622513857) ++ float(-10.4839706225138%d) + } + [12]=> + array(2) { +@@ -125,12 +125,12 @@ array(26) { + [0]=> + float(8.642194115015831) + [1]=> +- float(-22.172231059691807) ++ float(-22.1722310596918%d) + } + [16]=> + array(2) { + [0]=> +- float(7.979717846837639) ++ float(7.9797178468376%d) + [1]=> + float(-25.08894018486976) + } -- cgit