[packages/php-pecl-geoip] Rel 2; fix build with newer php
arekm
arekm at pld-linux.org
Thu Mar 2 10:24:21 CET 2023
commit f1b2b077fd13869da8b931aa095f1cf3c59f7457
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Mar 2 10:24:09 2023 +0100
Rel 2; fix build with newer php
git.patch | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++
php-pecl-geoip.spec | 4 +-
2 files changed, 108 insertions(+), 1 deletion(-)
---
diff --git a/php-pecl-geoip.spec b/php-pecl-geoip.spec
index 71014ef..b00f2f8 100644
--- a/php-pecl-geoip.spec
+++ b/php-pecl-geoip.spec
@@ -5,12 +5,13 @@ Summary: %{modname} - Map IP address to geographic places
Summary(pl.UTF-8): %{modname} - odwzorowanie adresów IP w miejsca geograficzne
Name: %{php_name}-pecl-%{modname}
Version: 1.1.1
-Release: 1
+Release: 2
License: PHP 3.01
Group: Development/Languages/PHP
Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
# Source0-md5: 4f5f4b8a41a5802de6591c79b85cc838
Patch0: find_libgeoip.patch
+Patch1: git.patch
URL: http://pecl.php.net/package/geoip/
BuildRequires: %{php_name}-devel >= 3:5.0.4
BuildRequires: GeoIP-devel >= 1.4.0
@@ -41,6 +42,7 @@ To rozszerzenie ma w PECL status: %{status}.
%setup -qc
mv %{modname}-%{version}/* .
%patch0 -p1
+%patch1 -p1
sed -i -e 's,GEOIP_DIR/lib,GEOIP_DIR/%{_lib},g' config.m4
diff --git a/git.patch b/git.patch
new file mode 100644
index 0000000..d8c2a43
--- /dev/null
+++ b/git.patch
@@ -0,0 +1,105 @@
+diff --git a/geoip.c b/geoip.c
+index 1538430..3e41a9d 100644
+--- a/geoip.c
++++ b/geoip.c
+@@ -34,41 +34,72 @@
+ #include "ext/standard/info.h"
+ #include "php_geoip.h"
+
+-
++/* For PHP 8 */
++#ifndef TSRMLS_CC
++#define TSRMLS_CC
++#endif
+
+ ZEND_DECLARE_MODULE_GLOBALS(geoip)
+
++ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_void, 0, 0, 0)
++ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_database_opt, 0, 0, 0)
++ ZEND_ARG_INFO(0, database)
++ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_database, 0, 0, 1)
++ ZEND_ARG_INFO(0, database)
++ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_host, 0, 0, 1)
++ ZEND_ARG_INFO(0, host)
++ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_region, 0, 0, 2)
++ ZEND_ARG_INFO(0, country_code)
++ ZEND_ARG_INFO(0, region_code)
++ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_directory, 0, 0, 1)
++ ZEND_ARG_INFO(0, directory)
++ZEND_END_ARG_INFO()
++
+ static int le_geoip;
+
+ /* {{{ */
+ zend_function_entry geoip_functions[] = {
+- PHP_FE(geoip_database_info, NULL)
++ PHP_FE(geoip_database_info, arginfo_geoip_database_opt)
+ #define GEOIPDEF(php_func, c_func, db_type) \
+- PHP_FE(php_func, NULL)
++ PHP_FE(php_func, arginfo_geoip_host)
+ #include "geoip.def"
+ #undef GEOIPDEF
+- PHP_FE(geoip_continent_code_by_name, NULL)
+- PHP_FE(geoip_org_by_name, NULL)
+- PHP_FE(geoip_record_by_name, NULL)
+- PHP_FE(geoip_id_by_name, NULL)
+- PHP_FE(geoip_region_by_name, NULL)
+- PHP_FE(geoip_isp_by_name, NULL)
+- PHP_FE(geoip_db_avail, NULL)
+- PHP_FE(geoip_db_get_all_info, NULL)
+- PHP_FE(geoip_db_filename, NULL)
++ PHP_FE(geoip_continent_code_by_name, arginfo_geoip_host)
++ PHP_FE(geoip_org_by_name, arginfo_geoip_host)
++ PHP_FE(geoip_record_by_name, arginfo_geoip_host)
++ PHP_FE(geoip_id_by_name, arginfo_geoip_host)
++ PHP_FE(geoip_region_by_name, arginfo_geoip_host)
++ PHP_FE(geoip_isp_by_name, arginfo_geoip_host)
++ PHP_FE(geoip_db_avail, arginfo_geoip_database)
++ PHP_FE(geoip_db_get_all_info, arginfo_geoip_void)
++ PHP_FE(geoip_db_filename, arginfo_geoip_database)
+ #if LIBGEOIP_VERSION >= 1004001
+- PHP_FE(geoip_region_name_by_code, NULL)
+- PHP_FE(geoip_time_zone_by_country_and_region, NULL)
++ PHP_FE(geoip_region_name_by_code, arginfo_geoip_region)
++ PHP_FE(geoip_time_zone_by_country_and_region, arginfo_geoip_region)
+ #endif
+ #ifdef HAVE_CUSTOM_DIRECTORY
+- PHP_FE(geoip_setup_custom_directory, NULL)
++ PHP_FE(geoip_setup_custom_directory, arginfo_geoip_directory)
+ #endif
+- PHP_FE(geoip_asnum_by_name, NULL)
+- PHP_FE(geoip_domain_by_name, NULL)
++ PHP_FE(geoip_asnum_by_name, arginfo_geoip_host)
++ PHP_FE(geoip_domain_by_name, arginfo_geoip_host)
+ #if LIBGEOIP_VERSION >= 1004008
+- PHP_FE(geoip_netspeedcell_by_name, NULL)
++ PHP_FE(geoip_netspeedcell_by_name, arginfo_geoip_host)
+ #endif
++#ifdef PHP_FE_END
++ PHP_FE_END
++#else
+ {NULL, NULL, NULL}
++#endif
+ };
+ /* }}} */
+
+@@ -365,7 +396,7 @@ PHP_FUNCTION(geoip_database_info)
+ gi = GeoIP_open_type(edition, GEOIP_STANDARD);
+ } else {
+ if (NULL != GeoIPDBFileName[edition])
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_COUNTRY_EDITION]);
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[edition]);
+ else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available.");
+ return;
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-pecl-geoip.git/commitdiff/f1b2b077fd13869da8b931aa095f1cf3c59f7457
More information about the pld-cvs-commit
mailing list