diff options
| -rw-r--r-- | 25.patch | 139 | ||||
| -rw-r--r-- | composer.json | 12 | ||||
| -rw-r--r-- | php-pecl-ip2location.spec | 72 |
3 files changed, 48 insertions, 175 deletions
diff --git a/25.patch b/25.patch deleted file mode 100644 index 33db97c..0000000 --- a/25.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 8828108300b1b65eab2c631a73898dae33d6c112 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Wed, 3 Sep 2025 09:56:27 +0200 -Subject: [PATCH 1/2] Fix API version check - ---- - ip2location.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ip2location.c b/ip2location.c -index 2252b3b..6a0904e 100644 ---- a/ip2location.c -+++ b/ip2location.c -@@ -802,7 +802,7 @@ PHP_FUNCTION(ip2location_get_as) - /* }}} */ - #endif - --#if API_VERSION_NUMERIC >= 80600 -+#if API_VERSION_NUMERIC >= 80700 - /* {{{ ip2location_get_as_domain("ip_address") - * Returns ip address's internet connection district type information */ - PHP_FUNCTION(ip2location_get_as_domain) - -From af16709c6121365d38398af505ea3579b82f0f5e Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Wed, 3 Sep 2025 10:14:37 +0200 -Subject: [PATCH 2/2] regenerate arginfo from stub - ---- - ip2location_arginfo.h | 10 ++++++---- - ip2location_legacy_arginfo.h | 32 ++++++++++++++++++++++++++------ - 2 files changed, 32 insertions(+), 10 deletions(-) - -diff --git a/ip2location_arginfo.h b/ip2location_arginfo.h -index 3897564..9fe1542 100644 ---- a/ip2location_arginfo.h -+++ b/ip2location_arginfo.h -@@ -1,5 +1,5 @@ - /* This is a generated file, edit the .stub.php file instead. -- * Stub hash: c57e18a606ee629525559e7f245e9643c54c59c5 */ -+ * Stub hash: ed66f116eb8a1c160a1e2517559e0bef39118179 */ - - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ip2location_open, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, file_path, IS_STRING, 0) -@@ -90,15 +90,17 @@ ZEND_END_ARG_INFO() - #endif - - #if API_VERSION_NUMERIC >= 80700 --#define arginfo_ip2location_get_as_domain arginfo_ip2location_get_district -+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ip2location_get_as_domain, 0, 1, IS_STRING, 0) -+ ZEND_ARG_TYPE_INFO(0, ip_address, IS_STRING, 0) -+ZEND_END_ARG_INFO() - #endif - - #if API_VERSION_NUMERIC >= 80700 --#define arginfo_ip2location_get_as_usage_type arginfo_ip2location_get_district -+#define arginfo_ip2location_get_as_usage_type arginfo_ip2location_get_as_domain - #endif - - #if API_VERSION_NUMERIC >= 80700 --#define arginfo_ip2location_get_as_cidr arginfo_ip2location_get_district -+#define arginfo_ip2location_get_as_cidr arginfo_ip2location_get_as_domain - #endif - - -diff --git a/ip2location_legacy_arginfo.h b/ip2location_legacy_arginfo.h -index 5549a90..ce3b97d 100644 ---- a/ip2location_legacy_arginfo.h -+++ b/ip2location_legacy_arginfo.h -@@ -1,5 +1,5 @@ - /* This is a generated file, edit the .stub.php file instead. -- * Stub hash: c57e18a606ee629525559e7f245e9643c54c59c5 */ -+ * Stub hash: ed66f116eb8a1c160a1e2517559e0bef39118179 */ - - ZEND_BEGIN_ARG_INFO_EX(arginfo_ip2location_open, 0, 0, 1) - ZEND_ARG_INFO(0, file_path) -@@ -80,23 +80,25 @@ ZEND_END_ARG_INFO() - #endif - - #if API_VERSION_NUMERIC >= 80600 --#define arginfo_ip2location_get_asn arginfo_ip2location_get_asn -+#define arginfo_ip2location_get_asn arginfo_ip2location_get_district - #endif - - #if API_VERSION_NUMERIC >= 80600 --#define arginfo_ip2location_get_as arginfo_ip2location_get_as -+#define arginfo_ip2location_get_as arginfo_ip2location_get_district - #endif - - #if API_VERSION_NUMERIC >= 80700 --#define arginfo_ip2location_get_as_domain arginfo_ip2location_get_domain -+ZEND_BEGIN_ARG_INFO_EX(arginfo_ip2location_get_as_domain, 0, 0, 1) -+ ZEND_ARG_INFO(0, ip_address) -+ZEND_END_ARG_INFO() - #endif - - #if API_VERSION_NUMERIC >= 80700 --#define arginfo_ip2location_get_as_usage_type arginfo_ip2location_get_usage_type -+#define arginfo_ip2location_get_as_usage_type arginfo_ip2location_get_as_domain - #endif - - #if API_VERSION_NUMERIC >= 80700 --#define arginfo_ip2location_get_as_cidr arginfo_ip2location_get_cidr -+#define arginfo_ip2location_get_as_cidr arginfo_ip2location_get_as_domain - #endif - - -@@ -143,6 +145,15 @@ ZEND_FUNCTION(ip2location_get_asn); - #if API_VERSION_NUMERIC >= 80600 - ZEND_FUNCTION(ip2location_get_as); - #endif -+#if API_VERSION_NUMERIC >= 80700 -+ZEND_FUNCTION(ip2location_get_as_domain); -+#endif -+#if API_VERSION_NUMERIC >= 80700 -+ZEND_FUNCTION(ip2location_get_as_usage_type); -+#endif -+#if API_VERSION_NUMERIC >= 80700 -+ZEND_FUNCTION(ip2location_get_as_cidr); -+#endif - - - static const zend_function_entry ext_functions[] = { -@@ -188,6 +199,15 @@ static const zend_function_entry ext_functions[] = { - #endif - #if API_VERSION_NUMERIC >= 80600 - ZEND_FE(ip2location_get_as, arginfo_ip2location_get_as) -+#endif -+#if API_VERSION_NUMERIC >= 80700 -+ ZEND_FE(ip2location_get_as_domain, arginfo_ip2location_get_as_domain) -+#endif -+#if API_VERSION_NUMERIC >= 80700 -+ ZEND_FE(ip2location_get_as_usage_type, arginfo_ip2location_get_as_usage_type) -+#endif -+#if API_VERSION_NUMERIC >= 80700 -+ ZEND_FE(ip2location_get_as_cidr, arginfo_ip2location_get_as_cidr) - #endif - ZEND_FE_END - }; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..20eab44 --- /dev/null +++ b/composer.json @@ -0,0 +1,12 @@ +{ + "name": "ip2location/ip2location-pie", + "type": "php-ext", + "license": "PHP-3.01", + "description": "IP2Location Geolocation Lookup", + "require": { + "php": ">= 7.0.0" + }, + "php-ext": { + "extension-name": "ip2location" + } +}
\ No newline at end of file diff --git a/php-pecl-ip2location.spec b/php-pecl-ip2location.spec index 7944c84..fc60434 100644 --- a/php-pecl-ip2location.spec +++ b/php-pecl-ip2location.spec @@ -8,30 +8,36 @@ # %{?scl:%scl_package php-pecl-ip2location} -%global pecl_name ip2location -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global ini_name 40-%{pecl_name}.ini +%global pecl_name ip2location +%global pie_vend ip2location +%global pie_proj ip2location-pie +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global ini_name 40-%{pecl_name}.ini %global upstream_version 8.3.0 #global upstream_prever RC1 %global libversion 8.6 -%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} -%global _configure ../%{sources}/configure +%global sources %{gh_proj}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure + +# Github forge +%global gh_vend chrislim2888 +%global gh_proj IP2Location-PECL-Extension +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +%global tag %{upstream_version}%{?upstream_prever} -Summary: Get geo location information of an IP address Name: %{?scl_prefix}php-pecl-%{pecl_name} +Summary: Get geo location information of an IP address License: PHP-3.01 Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 1%{?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 - -Patch0: https://patch-diff.githubusercontent.com/raw/chrislim2888/IP2Location-PECL-Extension/pull/25.patch +Release: 2%{?dist} +%forgemeta +URL: %{forgeurl} +Source0: %{forgesource} BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-devel # ensure proper version is used BuildRequires: IP2Location-devel >= %{libversion} @@ -40,10 +46,15 @@ Requires: IP2Location-libs%{?_isa} >= %{libversion} Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -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} +# Extension +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +# PECL +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +# PIE +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description @@ -60,17 +71,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -# Don't install tests -sed -e 's/role="test"/role="src"/' \ - -e '/LICENSE/s/role="doc"/role="src"/' \ - -e '/README.TXT/s/role="doc"/role="test"/' \ - -e '/AGREEMENT.PDF/s/role="doc"/role="test"/' \ - -i package.xml - cd %{sources} -%patch -P0 -p1 -b .pr25 -sed -e "s/\r//" -i LICENSE CREDITS *.md *.c *.h - # Check version extver=$(sed -n '/#define PHP_IP2LOCATION_VERSION/{s/.* "//;s/".*$//;p}' php_ip2location.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then @@ -114,8 +115,6 @@ cd ../ZTS %make_install -C NTS -install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml - install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install the ZTS stuff @@ -124,11 +123,6 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif -# Documentation -for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i -done - %check cd %{sources} @@ -165,11 +159,12 @@ fi %files %license %{sources}/LICENSE -%doc %{pecl_docdir}/%{pecl_name} -%config(noreplace) %{php_inidir}/%{ini_name} +%doc %{sources}/composer.json +%doc %{sources}/CREDITS +%doc %{sources}/*.md +%config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so -%{pecl_xmldir}/%{name}.xml %if %{with_zts} %config(noreplace) %{php_ztsinidir}/%{ini_name} @@ -178,6 +173,11 @@ fi %changelog +* Tue Mar 17 2026 Remi Collet <remi@remirepo.net> - 8.3.0-2 +- drop pear/pecl dependency +- sources from github +- drop patch merged upstream + * Wed Sep 3 2025 Remi Collet <remi@remirepo.net> - 8.3.0-1 - update to 8.3.0 - re-license spec file to CECILL-2.1 |
