From 167b2dbec955c678e1bf2a262b7631ffa17a7b7d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mar 04 2021 14:08:03 +0000 Subject: rebuild for https://fedoraproject.org/wiki/Changes/php80 add upstream patch for PHP 8 --- diff --git a/geoip-php8.patch b/geoip-php8.patch new file mode 100644 index 0000000..5de99f6 --- /dev/null +++ b/geoip-php8.patch @@ -0,0 +1,93 @@ +--- pecl/geoip/trunk/geoip.c 2020/10/30 12:04:28 351081 ++++ pecl/geoip/trunk/geoip.c 2020/10/30 12:51:07 351082 +@@ -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 + }; + /* }}} */ + diff --git a/php-pecl-geoip.spec b/php-pecl-geoip.spec index dd44f17..a9cf250 100644 --- a/php-pecl-geoip.spec +++ b/php-pecl-geoip.spec @@ -3,12 +3,18 @@ Name: php-pecl-geoip Version: 1.1.1 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Extension to map IP addresses to geographic places License: PHP URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz +# Upstream patch for PHP 8 +# https://svn.php.net/viewvc?view=revision&revision=351082 +Patch0: %{pecl_name}-php8.patch + +BuildRequires: make +BuildRequires: gcc BuildRequires: GeoIP-devel BuildRequires: php-devel BuildRequires: php-pear @@ -43,6 +49,8 @@ extension=%{pecl_name}.so EOF cd %{pecl_name}-%{version} +%patch0 -p3 -b .up + # Upstream often forget this extver=$(sed -n '/#define PHP_GEOIP_VERSION/{s/.* "//;s/".*$//;p}' php_geoip.h) if test "x${extver}" != "x%{version}"; then @@ -103,6 +111,10 @@ NO_INTERACTION=1 \ %changelog +* Thu Mar 4 2021 Remi Collet - 1.1.1-15 +- rebuild for https://fedoraproject.org/wiki/Changes/php80 +- add upstream patch for PHP 8 + * Wed Jan 27 2021 Fedora Release Engineering - 1.1.1-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild