From 15186f70b7b1870d992fcb852362806c3b7f3b93 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 30 Sep 2020 15:11:56 +0200 Subject: add patches for library version 8.1.4 and for PHP 8 from https://github.com/chrislim2888/IP2Location-PECL-Extension/pull/12 --- 12.patch | 112 ++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-ip2location.spec | 9 +++- 2 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 12.patch diff --git a/12.patch b/12.patch new file mode 100644 index 0000000..6fc98ec --- /dev/null +++ b/12.patch @@ -0,0 +1,112 @@ +From 9d0d006505d6c8fdf4ed9d52df1be10e16fa02d3 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 30 Sep 2020 15:06:29 +0200 +Subject: [PATCH] adapt for library version 8.1.4 + +--- + ip2location.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/ip2location.c b/ip2location.c +index 064e5a2..198410a 100644 +--- a/ip2location.c ++++ b/ip2location.c +@@ -406,7 +406,7 @@ PHP_FUNCTION(ip2location_get_zipcode) + return; + } + record = IP2Location_get_zipcode(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->zip_code; + #else + ret = record->zipcode; +@@ -434,7 +434,7 @@ PHP_FUNCTION(ip2location_get_timezone) + return; + } + record = IP2Location_get_timezone(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->time_zone; + #else + ret = record->timezone; +@@ -469,7 +469,7 @@ PHP_FUNCTION(ip2location_get_netspeed) + } + + record = IP2Location_get_netspeed(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->net_speed; + #else + ret = record->netspeed; +@@ -497,7 +497,7 @@ PHP_FUNCTION(ip2location_get_iddcode) + return; + } + record = IP2Location_get_iddcode(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->idd_code; + #else + ret = record->iddcode; +@@ -525,7 +525,7 @@ PHP_FUNCTION(ip2location_get_areacode) + return; + } + record = IP2Location_get_areacode(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->area_code; + #else + ret = record->areacode; +@@ -553,7 +553,7 @@ PHP_FUNCTION(ip2location_get_weatherstationcode) + return; + } + record = IP2Location_get_weatherstationcode(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->weather_station_code; + #else + ret = record->weatherstationcode; +@@ -581,7 +581,7 @@ PHP_FUNCTION(ip2location_get_weatherstationname) + return; + } + record = IP2Location_get_weatherstationname(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->weather_station_name; + #else + ret = record->weatherstationname; +@@ -655,7 +655,7 @@ PHP_FUNCTION(ip2location_get_mobilebrand) + return; + } + record = IP2Location_get_mobilebrand(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->mobile_brand; + #else + ret = record->mobilebrand; +@@ -702,7 +702,7 @@ PHP_FUNCTION(ip2location_get_usagetype) + return; + } + record = IP2Location_get_usagetype(IP2LOCATION_G(ip2location_ptr), ip_address); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + ret = record->usage_type; + #else + ret = record->usagetype; +@@ -738,7 +738,7 @@ PHP_FUNCTION(ip2location_get_all) + add_assoc_string(return_value, "city",record->city); + add_assoc_string(return_value, "isp",record->isp); + add_assoc_string(return_value, "domain",record->domain); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + add_assoc_string(return_value, "zipcode",record->zip_code); + add_assoc_string(return_value, "timezone",record->time_zone); + add_assoc_string(return_value, "netspeed",record->net_speed); +@@ -768,7 +768,7 @@ PHP_FUNCTION(ip2location_get_all) + add_assoc_string(return_value, "city",record->city, 1); + add_assoc_string(return_value, "isp",record->isp, 1); + add_assoc_string(return_value, "domain",record->domain, 1); +-#if API_VERSION_NUMERIC >= 80100 ++#if API_VERSION_NUMERIC >= 80100 && API_VERSION_NUMERIC < 80104 + add_assoc_string(return_value, "zipcode",record->zip_code, 1); + add_assoc_string(return_value, "timezone",record->time_zone, 1); + add_assoc_string(return_value, "netspeed",record->net_speed, 1); diff --git a/php-pecl-ip2location.spec b/php-pecl-ip2location.spec index 8b01e86..25dbef6 100644 --- a/php-pecl-ip2location.spec +++ b/php-pecl-ip2location.spec @@ -26,7 +26,7 @@ Summary: Get geo location information of an IP address Name: %{?sub_prefix}php-pecl-%{pecl_name} License: PHP Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 7%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Release: 8%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} URL: https://pecl.php.net/package/igbinary Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz @@ -40,6 +40,8 @@ Patch2: https://patch-diff.githubusercontent.com/raw/chrislim2888/IP2Loc Patch3: https://patch-diff.githubusercontent.com/raw/chrislim2888/IP2Location-PECL-Extension/pull/10.patch # https://github.com/chrislim2888/IP2Location-PECL-Extension/pull/11 - config.m4 Patch4: https://patch-diff.githubusercontent.com/raw/chrislim2888/IP2Location-PECL-Extension/pull/11.patch +# https://github.com/chrislim2888/IP2Location-PECL-Extension/pull/12 - library 8.1.4 +Patch5: https://patch-diff.githubusercontent.com/raw/chrislim2888/IP2Location-PECL-Extension/pull/12.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-pear @@ -112,6 +114,7 @@ sed -e "s/\r//" -i *.c config.m4 %patch2 -p1 -b .pr9 %patch3 -p1 -b .pr10 %patch4 -p1 -b .pr11 +%patch5 -p1 -b .pr12 # Check version extver=$(sed -n '/#define PHP_IP2LOCATION_VERSION/{s/.* "//;s/".*$//;p}' php_ip2location.h) @@ -233,6 +236,10 @@ fi %changelog +* Wed Sep 30 2020 Remi Collet - 8.0.1-8 +- add patches for library version 8.1.4 and for PHP 8 from + https://github.com/chrislim2888/IP2Location-PECL-Extension/pull/12 + * Wed Sep 30 2020 Remi Collet - 8.0.1-7 - rebuild for PHP 8.0.0RC1 -- cgit