From 743e453c169f003bd94b066baffcc1cedfc5499e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 25 Jun 2019 12:20:40 +0200 Subject: test build for upcoming 2.5.0 --- 0001-fix-Wimplicit-function-declaration.patch | 24 ----- ...-Fix-Wincompatible-pointer-types-with-7.3.patch | 28 ------ ...ix-segfault-in-013.solrclient_getByIds.sh.patch | 53 ----------- php-pecl-solr2.spec | 39 +++----- upstream.patch | 100 --------------------- 5 files changed, 14 insertions(+), 230 deletions(-) delete mode 100644 0001-fix-Wimplicit-function-declaration.patch delete mode 100644 0003-Fix-Wincompatible-pointer-types-with-7.3.patch delete mode 100644 0005-fix-segfault-in-013.solrclient_getByIds.sh.patch delete mode 100644 upstream.patch diff --git a/0001-fix-Wimplicit-function-declaration.patch b/0001-fix-Wimplicit-function-declaration.patch deleted file mode 100644 index 826862a..0000000 --- a/0001-fix-Wimplicit-function-declaration.patch +++ /dev/null @@ -1,24 +0,0 @@ -From c07233b6975099d928ab487eb1dad929cca43531 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 12 Oct 2018 13:49:25 +0200 -Subject: [PATCH 1/5] fix [-Wimplicit-function-declaration] - ---- - src/php7/php_solr.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/php7/php_solr.h b/src/php7/php_solr.h -index 0d32864..3704ec0 100644 ---- a/src/php7/php_solr.h -+++ b/src/php7/php_solr.h -@@ -642,6 +642,7 @@ PHP_SOLR_API void solr_collapse_function_register_class_constants(zend_class_ent - PHP_SOLR_API void solr_response_register_class_properties(zend_class_entry *ce TSRMLS_DC); - PHP_SOLR_API void solr_response_register_class_constants(zend_class_entry *ce TSRMLS_DC); - PHP_SOLR_API void solr_exception_register_class_properties(zend_class_entry *ce TSRMLS_DC); -+PHP_SOLR_API void solr_input_document_register_class_constants(zend_class_entry *ce TSRMLS_DC); - - PHP_SOLR_API void solr_set_response_object_properties(zend_class_entry *scope, zval *response_object, const solr_client_t *client, const solr_string_t *request_url, zend_bool success TSRMLS_DC); - PHP_SOLR_API void solr_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *filename, int file_line, const char *function_name, char *format, ...); --- -2.14.4 - diff --git a/0003-Fix-Wincompatible-pointer-types-with-7.3.patch b/0003-Fix-Wincompatible-pointer-types-with-7.3.patch deleted file mode 100644 index 925b213..0000000 --- a/0003-Fix-Wincompatible-pointer-types-with-7.3.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 9bdca9aaf4e6aa1ae61f43bb6be77f4540789374 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 12 Oct 2018 13:55:42 +0200 -Subject: [PATCH 3/5] Fix [-Wincompatible-pointer-types] with 7.3 - ---- - src/php7/solr_functions_helpers.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/php7/solr_functions_helpers.c b/src/php7/solr_functions_helpers.c -index 2ac1fe0..eb32808 100644 ---- a/src/php7/solr_functions_helpers.c -+++ b/src/php7/solr_functions_helpers.c -@@ -1427,7 +1427,11 @@ static inline int solr_pcre_replace_into_buffer(solr_string_t *buffer, char * se - { - zend_string *result; - int limit = -1; -+#if PHP_VERSION_ID >= 70300 -+ size_t replace_count = -1; -+#else - int replace_count = -1; -+#endif - zend_string *regex_str = zend_string_init(search, strlen(search), 0); - zend_string *subject_str = zend_string_init(buffer->str, buffer->len, 0); - #if PHP_VERSION_ID >= 70200 --- -2.14.4 - diff --git a/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch b/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch deleted file mode 100644 index 109b604..0000000 --- a/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9c0e23403876814f2812b4bad04989873194c91f Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 12 Oct 2018 14:10:54 +0200 -Subject: [PATCH 5/5] fix segfault in 013.solrclient_getByIds.sh - ---- - src/php7/php_solr_client.c | 26 ++++++++++++++------------ - 1 file changed, 14 insertions(+), 12 deletions(-) - -diff --git a/src/php7/php_solr_client.c b/src/php7/php_solr_client.c -index 3c76f52..8bad5df 100644 ---- a/src/php7/php_solr_client.c -+++ b/src/php7/php_solr_client.c -@@ -1346,22 +1346,24 @@ PHP_METHOD(SolrClient, getByIds) - - solr_string_init(&query_string); - solr_string_appends(&query_string, "ids=", sizeof("ids=")-1); -- SOLR_HASHTABLE_FOR_LOOP(ids) -- { -- zval *id_zv = NULL; -- id_zv = zend_hash_get_current_data(ids); -- if (Z_TYPE_P(id_zv) == IS_STRING && Z_STRLEN_P(id_zv)) { -- solr_string_appends(&query_string, Z_STRVAL_P(id_zv), Z_STRLEN_P(id_zv)); -- solr_string_appendc(&query_string, ','); -- } else { -- invalid_param = 1; -- goto solr_getbyids_exit; -+ -+ if (ids->nNumOfElements) { -+ SOLR_HASHTABLE_FOR_LOOP(ids) -+ { -+ zval *id_zv = NULL; -+ id_zv = zend_hash_get_current_data(ids); -+ if (Z_TYPE_P(id_zv) == IS_STRING && Z_STRLEN_P(id_zv)) { -+ solr_string_appends(&query_string, Z_STRVAL_P(id_zv), Z_STRLEN_P(id_zv)); -+ solr_string_appendc(&query_string, ','); -+ } else { -+ invalid_param = 1; -+ goto solr_getbyids_exit; -+ } -+ current_position++; - } -- current_position++; - } - - -- - solr_getbyids_exit: - if (invalid_param) { - solr_string_free(&query_string); --- -2.14.4 - diff --git a/php-pecl-solr2.spec b/php-pecl-solr2.spec index 3c6db55..d9a9eb5 100644 --- a/php-pecl-solr2.spec +++ b/php-pecl-solr2.spec @@ -3,7 +3,7 @@ # # Fedora spec file for php-pecl-solr2 # -# Copyright (c) 2011-2018 Remi Collet +# Copyright (c) 2011-2019 Remi Collet # Copyright (c) 2010 Johan Cwiklinski # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ @@ -34,19 +34,14 @@ Summary: Object oriented API to Apache Solr Summary(fr): API orientée objet pour Apache Solr Name: %{?sub_prefix}php-pecl-solr2 -Version: 2.4.0 -Release: 12%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 2.5.0 +Release: 0%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/solr Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz -Patch0: upstream.patch -Patch1: 0001-fix-Wimplicit-function-declaration.patch -Patch2: 0003-Fix-Wincompatible-pointer-types-with-7.3.patch -Patch3: 0005-fix-segfault-in-013.solrclient_getByIds.sh.patch - BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-curl @@ -82,16 +77,6 @@ Conflicts: %{?scl_prefix}php-pecl-%{pecl_name} < 2 %endif %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -%if "%{php_version}" > "5.6" -Obsoletes: php56u-pecl-%{pecl_name}2 <= %{version} -Obsoletes: php56w-pecl-%{pecl_name}2 <= %{version} -%endif -%if "%{php_version}" > "7.0" -Obsoletes: php70u-pecl-%{pecl_name} <= %{version} -Obsoletes: php70w-pecl-%{pecl_name} <= %{version} -Obsoletes: php70u-pecl-%{pecl_name}2 <= %{version} -Obsoletes: php70w-pecl-%{pecl_name}2 <= %{version} -%endif %if "%{php_version}" > "7.1" Obsoletes: php71u-pecl-%{pecl_name} <= %{version} Obsoletes: php71w-pecl-%{pecl_name} <= %{version} @@ -105,11 +90,17 @@ Obsoletes: php72u-pecl-%{pecl_name}2 <= %{version} Obsoletes: php72w-pecl-%{pecl_name}2 <= %{version} %endif %if "%{php_version}" > "7.3" -Obsoletes: php73u-pecl-%{pecl_name} <= %{version} +Obsoletes: php73-pecl-%{pecl_name} <= %{version} Obsoletes: php73w-pecl-%{pecl_name} <= %{version} -Obsoletes: php73u-pecl-%{pecl_name}2 <= %{version} +Obsoletes: php73-pecl-%{pecl_name}2 <= %{version} Obsoletes: php73w-pecl-%{pecl_name}2 <= %{version} %endif +%if "%{php_version}" > "7.4" +Obsoletes: php74-pecl-%{pecl_name} <= %{version} +Obsoletes: php74w-pecl-%{pecl_name} <= %{version} +Obsoletes: php74-pecl-%{pecl_name}2 <= %{version} +Obsoletes: php74w-pecl-%{pecl_name}2 <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -156,11 +147,6 @@ sed -e 's/role="test"/role="src"/' \ mv %{pecl_name}-%{version}%{?prever} NTS cd NTS -%patch0 -p1 -b .upstream -%patch1 -p1 -b .up1 -%patch2 -p1 -b .up2 -%patch3 -p1 -b .up3 - # Check version DIR=src/php$(%{__php} -r 'echo PHP_MAJOR_VERSION;') extver=$(sed -n '/#define PHP_SOLR_VERSION /{s/.* "//;s/".*$//;p}' $DIR/php_solr_version.h) @@ -308,6 +294,9 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \ %changelog +* Tue Jun 25 2019 Remi Collet - 2.5.0-0 +- test build for upcoming 2.5.0 + * Thu Dec 13 2018 Remi Collet - 2.4.0-12 - cleanup for EL-8 diff --git a/upstream.patch b/upstream.patch deleted file mode 100644 index de020f2..0000000 --- a/upstream.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 744e32915d5989101267ed2c84a407c582dc6f31 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 23 Jun 2017 16:25:50 +0200 -Subject: [PATCH] Fix for 7.2: - ZEND_ACC_CLONE have been removed, and was not - used in previous versions - fix php_pcre_replace call - ---- - src/php7/php_solr.c | 8 ++++---- - src/php7/solr_functions_helpers.c | 15 ++++++++++++++- - 2 files changed, 18 insertions(+), 5 deletions(-) - -diff --git a/src/php7/php_solr.c b/src/php7/php_solr.c -index 568b7c5..297f444 100644 ---- a/src/php7/php_solr.c -+++ b/src/php7/php_solr.c -@@ -566,7 +566,7 @@ static zend_function_entry solr_document_methods[] = { - SOLR_CTOR(SolrDocument, __construct, SolrDocument__construct_args) - SOLR_DTOR(SolrDocument, __destruct, Solr_no_args) - -- PHP_ME(SolrDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE) -+ PHP_ME(SolrDocument, __clone, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrDocument, __set, SolrDocument_addField_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrDocument, __get, SolrDocument_getField_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrDocument, __isset, SolrDocument_fieldExists_args, ZEND_ACC_PUBLIC) -@@ -609,7 +609,7 @@ static zend_function_entry solr_document_methods[] = { - static zend_function_entry solr_input_document_methods[] = { - SOLR_CTOR(SolrInputDocument, __construct, SolrInputDocument__construct_args) - SOLR_DTOR(SolrInputDocument, __destruct, Solr_no_args) -- PHP_ME(SolrInputDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE) -+ PHP_ME(SolrInputDocument, __clone, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrInputDocument, __sleep, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrInputDocument, __wakeup, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrInputDocument, setBoost, SolrInputDocument_setBoost_args, ZEND_ACC_PUBLIC) -@@ -645,7 +645,7 @@ static zend_function_entry solr_client_methods[] = { - SOLR_DTOR(SolrClient, __destruct, Solr_no_args) - PHP_ME(SolrClient, __sleep, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrClient, __wakeup, NULL, ZEND_ACC_PUBLIC) -- PHP_ME(SolrClient, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE) -+ PHP_ME(SolrClient, __clone, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrClient, getOptions, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrClient, getDebug, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrClient, setServlet, SolrClient_setServlet_args, ZEND_ACC_PUBLIC) -@@ -722,7 +722,7 @@ static zend_function_entry solr_params_methods[] = { - PHP_ME(SolrParams, getParams, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrParams, getParam, SolrParams_getParam_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrParams, getPreparedParams, Solr_no_args, ZEND_ACC_PUBLIC) -- PHP_ME(SolrParams, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE) -+ PHP_ME(SolrParams, __clone, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrParams, serialize, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrParams, unserialize, SolrParams_unserialize_args, ZEND_ACC_PUBLIC) - PHP_MALIAS(SolrParams, add, addParam, SolrParams_addParam_args, ZEND_ACC_PUBLIC) -diff --git a/src/php7/solr_functions_helpers.c b/src/php7/solr_functions_helpers.c -index b249a99..6d24ff4 100644 ---- a/src/php7/solr_functions_helpers.c -+++ b/src/php7/solr_functions_helpers.c -@@ -1404,19 +1404,28 @@ PHP_SOLR_API long solr_get_json_last_error(TSRMLS_D) - static inline int solr_pcre_replace_into_buffer(solr_string_t *buffer, char * search, char *replace) - { - zend_string *result; -- zval replace_val; - int limit = -1; - int replace_count = -1; - zend_string *regex_str = zend_string_init(search, strlen(search), 0); - zend_string *subject_str = zend_string_init(buffer->str, buffer->len, 0); -+#if PHP_VERSION_ID >= 70200 -+ zend_string *replace_str = zend_string_init(replace, strlen(replace), 0); -+#else -+ zval replace_val; - ZVAL_STRING(&replace_val, replace); -+#endif -+ - result = php_pcre_replace( - regex_str, - subject_str, - buffer->str, - buffer->len, -+#if PHP_VERSION_ID >= 70200 -+ replace_str, -+#else - &replace_val, - 0, -+#endif - limit, - &replace_count - ); -@@ -1424,7 +1433,11 @@ static inline int solr_pcre_replace_into_buffer(solr_string_t *buffer, char * se - solr_string_set_ex(buffer, (solr_char_t *)result->val, (size_t)result->len); - /* fprintf(stdout, "%s", buffer->str); */ - efree(result); -+#if PHP_VERSION_ID >= 70200 -+ zend_string_release(replace_str); -+#else - zval_ptr_dtor(&replace_val); -+#endif - zend_string_release(regex_str); - zend_string_release(subject_str); - --- -2.1.4 - -- cgit