summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-06-14 07:54:42 +0200
committerRemi Collet <remi@php.net>2023-06-14 07:54:42 +0200
commit75a4e7f92e4e7b3f1536e19af21ad7a535895f38 (patch)
tree0678d2ff8ba4a61f64862be8966812f4402a842d
parente54cdd4f4c9340ed371e77569f1fcb604bb685bd (diff)
raise dependency on IP2location library version 8.6HEADmaster
build out of sources tree
-rw-r--r--PHPINFO2
-rw-r--r--REFLECTION21
-rw-r--r--php-pecl-ip2location.spec51
3 files changed, 52 insertions, 22 deletions
diff --git a/PHPINFO b/PHPINFO
index bd89f9d..1fd3237 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -3,4 +3,4 @@ ip2location
ip2location support => enabled
extension version => 8.2.0
-library version => 8.4.1
+library version => 8.6.1
diff --git a/REFLECTION b/REFLECTION
index e3691dc..dbe9e9b 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -201,6 +201,27 @@ Extension [ <persistent> extension #78 ip2location version 8.2.0 ] {
}
- Return [ string ]
}
+ Function [ <internal:ip2location> function ip2location_get_district ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> string $ip_address ]
+ }
+ - Return [ string ]
+ }
+ Function [ <internal:ip2location> function ip2location_get_asn ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> string $ip_address ]
+ }
+ - Return [ string ]
+ }
+ Function [ <internal:ip2location> function ip2location_get_as ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> string $ip_address ]
+ }
+ - Return [ string ]
+ }
}
}
diff --git a/php-pecl-ip2location.spec b/php-pecl-ip2location.spec
index 2cfdd35..5bbc2eb 100644
--- a/php-pecl-ip2location.spec
+++ b/php-pecl-ip2location.spec
@@ -6,9 +6,13 @@
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-ip2location
-%endif
+%{?scl:%scl_package php-pecl-ip2location}
+
+# Defined in Fedora >= 37 and RHEL >= 10, in PHP >= 7.4 for remirepo
+%{!?__phpize: %global __phpize %{_bindir}/phpize}
+%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize}
+%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config}
+%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config}
%global pecl_name ip2location
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
@@ -20,13 +24,16 @@
%global upstream_version 8.2.0
#global upstream_prever RC1
-%global libversion 8.4
+%global libversion 8.6
+
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: Get geo location information of an IP address
Name: %{?scl_prefix}php-pecl-%{pecl_name}
License: PHP-3.01
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
@@ -61,7 +68,6 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
# Don't install tests
sed -e 's/role="test"/role="src"/' \
@@ -70,7 +76,7 @@ sed -e 's/role="test"/role="src"/' \
-e '/AGREEMENT.PDF/s/role="doc"/role="test"/' \
-i package.xml
-cd NTS
+cd %{sources}
sed -e "s/\r//" -i LICENSE CREDITS *.md *.c *.h
# Check version
@@ -81,8 +87,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-cp -r NTS ZTS
+mkdir ZTS
%endif
cat <<EOF | tee %{ini_name}
@@ -94,15 +101,16 @@ EOF
%build
%{?dtsenable}
-cd NTS
+cd %{sources}
%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+
+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
@@ -124,23 +132,22 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
%check
+cd %{sources}
: simple NTS module load test
%{_bindir}/php --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
: upstream test suite
-cd NTS
-TEST_PHP_EXECUTABLE=%{_bindir}/php \
+TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{_bindir}/php -n run-tests.php --show-diff
+%{__php} -n run-tests.php -q --show-diff
%if %{with_zts}
: simple ZTS module load test
@@ -149,12 +156,10 @@ REPORT_EXIT_STATUS=1 \
--modules | grep %{pecl_name}
: upstream test suite
-cd ../ZTS
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
+%{__ztsphp} -n run-tests.php -q --show-diff
%endif
@@ -179,7 +184,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -193,6 +198,10 @@ fi
%changelog
+* Mon Jun 12 2023 Remi Collet <remi@remirepo.net> - 8.2.0-2
+- raise dependency on IP2location library version 8.6
+- build out of sources tree
+
* Mon Jun 12 2023 Remi Collet <remi@remirepo.net> - 8.2.0-1
- update to 8.2.0