From c88c334e58119956139378f19df82a7e1e64d854 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 28 Jan 2021 17:14:39 +0100 Subject: update to 0.3.1 raise dependency on PHP 7.0 --- .gitignore | 2 + PHPINFO | 2 +- REFLECTION | 24 ++- geospatial-php8.patch | 442 ----------------------------------------------- php-pecl-geospatial.spec | 29 ++-- 5 files changed, 24 insertions(+), 475 deletions(-) delete mode 100644 geospatial-php8.patch diff --git a/.gitignore b/.gitignore index 1ab5c4f..01f0400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ +clog package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc diff --git a/PHPINFO b/PHPINFO index 82139a1..35ee1b5 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,4 +2,4 @@ geospatial Geospatial functions => enabled -Version => 0.2.1 +Version => 0.3.1 diff --git a/REFLECTION b/REFLECTION index 4845e70..2a16eeb 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,10 +1,10 @@ -Extension [ extension #96 geospatial version 0.2.1 ] { +Extension [ extension #118 geospatial version 0.3.1 ] { - Constants [4] { - Constant [ float GEO_DEG_TO_RAD ] { 0,017453292519943 } + Constant [ float GEO_DEG_TO_RAD ] { 0.017453292519943 } Constant [ float GEO_EARTH_RADIUS ] { 6378137 } - Constant [ integer GEO_AIRY_1830 ] { 2 } - Constant [ integer GEO_WGS84 ] { 1 } + Constant [ int GEO_AIRY_1830 ] { 2 } + Constant [ int GEO_WGS84 ] { 1 } } - Functions { @@ -62,11 +62,10 @@ Extension [ extension #96 geospatial version 0.2.1 ] { } Function [ function transform_datum ] { - - Parameters [4] { - Parameter #0 [ $latitude ] - Parameter #1 [ $longitude ] - Parameter #2 [ $from_reference_ellipsoid ] - Parameter #3 [ $to_reference_ellipsoid ] + - Parameters [3] { + Parameter #0 [ $GeoJSONPoint ] + Parameter #1 [ $from_reference_ellipsoid ] + Parameter #2 [ $to_reference_ellipsoid ] } } Function [ function dms_to_decimal ] { @@ -116,10 +115,9 @@ Extension [ extension #96 geospatial version 0.2.1 ] { } Function [ function geohash_encode ] { - - Parameters [3] { - Parameter #0 [ $latitude ] - Parameter #1 [ $longitude ] - Parameter #2 [ $precision ] + - Parameters [2] { + Parameter #0 [ $GeoJSONPoint ] + Parameter #1 [ $precision ] } } Function [ function geohash_decode ] { diff --git a/geospatial-php8.patch b/geospatial-php8.patch deleted file mode 100644 index 149da98..0000000 --- a/geospatial-php8.patch +++ /dev/null @@ -1,442 +0,0 @@ -diff -up ./geospatial.c.pr ./geospatial.c ---- ./geospatial.c.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./geospatial.c 2020-09-30 15:55:40.091268935 +0200 -@@ -1,8 +1,8 @@ - /* - +----------------------------------------------------------------------+ -- | PHP Version 5/7 | -+ | PHP Version 5/7/8 | - +----------------------------------------------------------------------+ -- | Copyright (c) 1997-2016 The PHP Group | -+ | Copyright (c) 1997-2020 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | -@@ -34,6 +34,11 @@ - #include "Zend/zend_exceptions.h" - #include "ext/spl/spl_exceptions.h" - -+#ifndef TSRMLS_CC -+#define TSRMLS_CC -+#define TSRMLS_DC -+#endif -+ - ZEND_BEGIN_ARG_INFO_EX(haversine_args, 0, 0, 2) - ZEND_ARG_INFO(0, geoJsonPointFrom) - ZEND_ARG_INFO(0, geoJsonPointTo) -@@ -450,7 +455,7 @@ geo_cartesian polar_to_cartesian(double - geo_lat_long cartesian_to_polar(double x, double y, double z, geo_ellipsoid eli) - { - -- double nu, lambda, h; -+ double nu = 0, lambda, h; - geo_lat_long polar; - - /* aiming for 1m accuracy */ -diff -up ./.gitignore.pr ./.gitignore ---- ./.gitignore.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./.gitignore 2020-09-30 15:54:31.215548030 +0200 -@@ -15,6 +15,7 @@ - /config.sub - /configure - /configure.in -+/configure.ac - /config.status - /config.cache - /conftest -diff -up ./tests/decimal_to_dms.phpt.pr ./tests/decimal_to_dms.phpt ---- ./tests/decimal_to_dms.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/decimal_to_dms.phpt 2020-09-30 15:54:31.215548030 +0200 -@@ -9,14 +9,14 @@ var_dump($dms); - $dms = decimal_to_dms(-1.034291666667, 'latitude'); - var_dump($dms); - ?> ----EXPECT-- -+--EXPECTF-- - array(4) { - ["degrees"]=> - int(1) - ["minutes"]=> - int(2) - ["seconds"]=> -- float(3.4500000011994) -+ float(3.450000001199%s) - ["direction"]=> - string(1) "W" - } -@@ -26,7 +26,7 @@ array(4) { - ["minutes"]=> - int(2) - ["seconds"]=> -- float(3.4500000011994) -+ float(3.450000001199%s) - ["direction"]=> - string(1) "S" - } -diff -up ./tests/dms_to_decimal.phpt.pr ./tests/dms_to_decimal.phpt ---- ./tests/dms_to_decimal.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/dms_to_decimal.phpt 2020-09-30 15:54:31.215548030 +0200 -@@ -16,10 +16,10 @@ var_dump($decimal); - $decimal = dms_to_decimal(74, 34, 31, 'W'); - var_dump($decimal); - ?> ----EXPECT-- --float(-1.0342916666667) --float(-2.3071388888889) --float(-2.3071388888889) --float(-2.3071388888889) --float(-0.1025) --float(-74.575277777778) -+--EXPECTF-- -+float(-1.034291666666%s) -+float(-2.307138888888%s) -+float(-2.307138888888%s) -+float(-2.307138888888%s) -+float(-0.102%s) -+float(-74.57527777777%s) -diff -up ./tests/fraction_along-001.phpt.pr ./tests/fraction_along-001.phpt ---- ./tests/fraction_along-001.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/fraction_along-001.phpt 2020-09-30 15:54:31.215548030 +0200 -@@ -12,7 +12,7 @@ var_dump(fraction_along_gc_line($point1, - var_dump(fraction_along_gc_line($point1, $point2, 0.8)); - var_dump(fraction_along_gc_line($point1, $point2, 1)); - ?> ----EXPECT-- -+--EXPECTF-- - array(2) { - ["type"]=> - string(5) "Point" -@@ -30,9 +30,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(6.9998522347268) -+ float(6.999852234726%s) - [1]=> -- float(10.023944943799) -+ float(10.02394494379%s) - } - } - array(2) { -@@ -41,9 +41,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(8.9999260791276) -+ float(8.999926079127%s) - [1]=> -- float(10.035925156339) -+ float(10.03592515633%s) - } - } - array(2) { -@@ -52,9 +52,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(11.000073920872) -+ float(11.00007392087%s) - [1]=> -- float(10.035925156339) -+ float(10.03592515633%s) - } - } - array(2) { -@@ -63,9 +63,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(13.000147765273) -+ float(13.00014776527%s) - [1]=> -- float(10.023944943799) -+ float(10.02394494379%s) - } - } - array(2) { -@@ -74,7 +74,7 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(15) -+ float(1%s) - [1]=> - float(10) - } -diff -up ./tests/fraction_along-002.phpt.pr ./tests/fraction_along-002.phpt ---- ./tests/fraction_along-002.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/fraction_along-002.phpt 2020-09-30 15:54:31.215548030 +0200 -@@ -7,15 +7,15 @@ $point2 = [ 'type' => 'Point', 'coordina - - var_dump(fraction_along_gc_line($point1, $point2, 0.5)); - ?> ----EXPECT-- -+--EXPECTF-- - array(2) { - ["type"]=> - string(5) "Point" - ["coordinates"]=> - array(2) { - [0]=> -- float(1.5809481271999) -+ float(1.580948127199%s) - [1]=> -- float(53.743611334154) -+ float(53.74361133415%s) - } - } -diff -up ./tests/geohash_decode.phpt.pr ./tests/geohash_decode.phpt ---- ./tests/geohash_decode.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/geohash_decode.phpt 2020-09-30 15:54:31.215548030 +0200 -@@ -25,7 +25,7 @@ var_dump(geohash_decode('u2edjnw17enr')) - - var_dump(geohash_decode('zzzzzzzzzzzz')); - ?> ----EXPECT-- -+--EXPECTF-- - array(2) { - ["type"]=> - string(5) "Point" -@@ -87,9 +87,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(171.02966308594) -+ float(171.029663085%s) - [1]=> -- float(49.671936035156) -+ float(49.6719360351%s) - } - } - array(2) { -@@ -98,9 +98,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(171.02897644043) -+ float(171.028976440%s) - [1]=> -- float(49.67399597168) -+ float(49.6739959716%s) - } - } - array(2) { -@@ -109,9 +109,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(171.0284614563) -+ float(171.028461456%s) - [1]=> -- float(49.674081802368) -+ float(49.6740818023%s) - } - } - array(2) { -@@ -120,9 +120,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(171.02861166) -+ float(171.0286116%s) - [1]=> -- float(49.674146175385) -+ float(49.67414617%s) - } - } - array(2) { -@@ -131,9 +131,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(171.02859556675) -+ float(171.0285955667%s) - [1]=> -- float(49.674154222012) -+ float(49.67415422201%s) - } - } - array(2) { -@@ -142,9 +142,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(171.0285962373) -+ float(171.028596237%s) - [1]=> -- float(49.674153551459) -+ float(49.67415355145%s) - } - } - array(2) { -@@ -153,9 +153,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(171.02859674022) -+ float(171.0285967402%s) - [1]=> -- float(49.674154138193) -+ float(49.67415413819%s) - } - } - array(2) { -@@ -186,9 +186,9 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(16.40000006184) -+ float(16.4000000618%s) - [1]=> -- float(48.199999993667) -+ float(48.19999999366%s) - } - } - array(2) { -@@ -197,8 +197,8 @@ array(2) { - ["coordinates"]=> - array(2) { - [0]=> -- float(179.99999983236) -+ float(179.9999998323%s) - [1]=> -- float(89.999999916181) -+ float(89.99999991618%s) - } - } -diff -up ./tests/Greenwich.phpt.pr ./tests/Greenwich.phpt ---- ./tests/Greenwich.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/Greenwich.phpt 2020-09-30 15:54:31.215548030 +0200 -@@ -25,16 +25,16 @@ var_dump($polar); - echo round($diferenceWGS84, 8),PHP_EOL; - echo round($diferenceAiry, 8),PHP_EOL; - ?> ----EXPECT-- -+--EXPECTF-- - array(2) { - ["type"]=> - string(5) "Point" - ["coordinates"]=> - array(2) { - [0]=> -- float(0.00013627354767069) -+ float(0.0001362735476706%s) - [1]=> -- float(51.477400823311) -+ float(51.47740082331%s) - } - } - 102.84185171 -diff -up ./tests/helmert.phpt.pr ./tests/helmert.phpt ---- ./tests/helmert.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/helmert.phpt 2020-09-30 15:54:31.215548030 +0200 -@@ -8,12 +8,12 @@ $z = 5020322.478; - - var_dump(helmert($x, $y, $z)); - ?> ----EXPECT-- -+--EXPECTF-- - array(3) { - ["x"]=> -- float(3909460.0676711) -+ float(3909460.067671%s) - ["y"]=> -- float(-146987.30138174) -+ float(-146987.301381%s) - ["z"]=> -- float(5019888.0705933) -+ float(5019888.070593%s) - } -diff -up ./tests/initial_bearing1.phpt.pr ./tests/initial_bearing1.phpt ---- ./tests/initial_bearing1.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/initial_bearing1.phpt 2020-09-30 15:54:31.216548027 +0200 -@@ -14,5 +14,5 @@ $to = array( - ); - var_dump(initial_bearing($from, $to)); - ?> ----EXPECT-- --float(148.270892801715) -+--EXPECTF-- -+float(148.27089280171%s) -diff -up ./tests/initial_bearing2.phpt.pr ./tests/initial_bearing2.phpt ---- ./tests/initial_bearing2.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/initial_bearing2.phpt 2020-09-30 15:54:31.216548027 +0200 -@@ -14,5 +14,5 @@ $to = array( - ); - var_dump(initial_bearing($from, $to)); - ?> ----EXPECT-- --float(337.890440190492) -+--EXPECTF-- -+float(337.89044019049%s) -diff -up ./tests/JodrellBank.phpt.pr ./tests/JodrellBank.phpt ---- ./tests/JodrellBank.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/JodrellBank.phpt 2020-09-30 15:54:31.216548027 +0200 -@@ -12,15 +12,15 @@ $polar = transform_datum($from, GEO_WGS8 - - var_dump($polar); - ?> ----EXPECT-- -+--EXPECTF-- - array(2) { - ["type"]=> - string(5) "Point" - ["coordinates"]=> - array(2) { - [0]=> -- float(-2.3057171628534) -+ float(-2.305717162853%s) - [1]=> -- float(53.235974015543) -+ float(53.23597401554%s) - } - } -diff -up ./tests/OSGB36_to_WGS84.phpt.pr ./tests/OSGB36_to_WGS84.phpt ---- ./tests/OSGB36_to_WGS84.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/OSGB36_to_WGS84.phpt 2020-09-30 15:54:31.216548027 +0200 -@@ -13,14 +13,14 @@ $polar = transform_datum($from, GEO_AIRY - var_dump(decimal_to_dms($polar['coordinates'][1], 'latitude')); - var_dump(decimal_to_dms($polar['coordinates'][0] ,'longitude')); - ?> ----EXPECT-- -+--EXPECTF-- - array(4) { - ["degrees"]=> - int(53) - ["minutes"]=> - int(14) - ["seconds"]=> -- float(11.493372672732) -+ float(11.49337267273%s) - ["direction"]=> - string(1) "N" - } -@@ -30,7 +30,7 @@ array(4) { - ["minutes"]=> - int(18) - ["seconds"]=> -- float(30.817794659248) -+ float(30.81779465924%s) - ["direction"]=> - string(1) "W" - } -diff -up ./tests/polar_to_cartesian.phpt.pr ./tests/polar_to_cartesian.phpt ---- ./tests/polar_to_cartesian.phpt.pr 2019-01-08 12:37:40.000000000 +0100 -+++ ./tests/polar_to_cartesian.phpt 2020-09-30 15:54:31.216548027 +0200 -@@ -7,12 +7,12 @@ $long = 1.4669444444; - - var_dump(polar_to_cartesian($lat, $long, GEO_AIRY_1830)); - ?> ----EXPECT-- -+--EXPECTF-- - array(3) { - ["x"]=> -- float(3810891.6734396) -+ float(3810891.673439%s) - ["y"]=> -- float(97591.624686311) -+ float(97591.62468631%s) - ["z"]=> -- float(5095766.3939034) -+ float(5095766.393903%s) - } diff --git a/php-pecl-geospatial.spec b/php-pecl-geospatial.spec index c9e0513..8298f91 100644 --- a/php-pecl-geospatial.spec +++ b/php-pecl-geospatial.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-geospatial # -# Copyright (c) 2015-2020 Remi Collet +# Copyright (c) 2015-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -11,7 +11,7 @@ %scl_package php-pecl-geospatial %endif -%global gh_commit 5e1d4b2083eb078019e599175076370c2873521f +%global gh_commit c6db5d5b5a4307fcaa29303c703bbe8638484674 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner php-geospatial %global gh_project geospatial @@ -19,30 +19,25 @@ %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name geospatial %global with_tests %{!?_without_tests:1}%{?_without_tests:0} -%if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini -%else %global ini_name 40-%{pecl_name}.ini -%endif %global with_fastlz 1 Summary: PHP Extension to handle common geospatial functions Name: %{?sub_prefix}php-pecl-%{pecl_name} -Version: 0.2.1 +Version: 0.3.1 %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: 3%{?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 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: %{pecl_name}-php8.patch - +BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel +BuildRequires: %{?scl_prefix}php-devel >= 7.0 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json @@ -77,12 +72,6 @@ Obsoletes: php80-pecl-%{pecl_name} <= %{version} %endif %endif -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter private shared object -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup} -%endif - %description The extension currently has implementations of the Haversine and @@ -104,8 +93,6 @@ mv NTS/package.xml . %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS -%patch0 -p1 -b .pr - # Check version as upstream often forget to update this extver=$(sed -n '/#define PHP_GEOSPATIAL_VERSION/{s/.* "//;s/".*$//;p}' php_geospatial.h) if test "x${extver}" != "x%{version}%{?prever}%{?gh_date:-dev}"; then @@ -249,6 +236,10 @@ fi %changelog +* Thu Jan 28 2021 Remi Collet - 0.3.1-1 +- update to 0.3.1 +- raise dependency on PHP 7.0 + * Wed Sep 30 2020 Remi Collet - 0.2.1-3 - add patch for PHP 8 from https://github.com/php-geospatial/geospatial/pull/27 -- cgit