summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-xmlrpc.spec14
-rw-r--r--xmlrpc-php81.patch30
2 files changed, 41 insertions, 3 deletions
diff --git a/php-pecl-xmlrpc.spec b/php-pecl-xmlrpc.spec
index ce6b777..342ad5e 100644
--- a/php-pecl-xmlrpc.spec
+++ b/php-pecl-xmlrpc.spec
@@ -33,7 +33,7 @@
Summary: Functions to write XML-RPC servers and clients
Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: %{upver}%{?lower:~%{lower}}%{?gh_date:.%{gh_date}}
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
# Extension is PHP
# Library is BSD
@@ -45,9 +45,11 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
Source0: https://pecl.php.net/get/%{pecl_name}-%{upver}%{?rcver}.tgz
%endif
+Patch0: %{pecl_name}-php81.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel > 8.0
+BuildRequires: %{?scl_prefix}php-devel >= 8.0
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-xml
@@ -69,8 +71,9 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{rele
%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
-%if "%{php_version}" > "8.0"
Obsoletes: php80-pecl-%{pecl_name} <= %{version}
+%if "%{php_version}" > "8.1"
+Obsoletes: php81-pecl-%{pecl_name} <= %{version}
%endif
%endif
@@ -102,6 +105,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .php81
+
# Check version as upstream often forget to update this
extver=$(sed -n '/#define PHP_XMLRPC_VERSION/{s/.* "//;s/".*$//;p}' php_xmlrpc.h)
if test "x${extver}" != "x%{upver}%{?rcver}%{?gh_date:-dev}"; then
@@ -216,6 +221,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Thu Jul 22 2021 Remi Collet <remi@remirepo.net> - 1.0.0~rc2-2
+- add upstream patch for PHP 8.1
+
* Fri Jan 15 2021 Remi Collet <remi@remirepo.net> - 1.0.0~rc2-1
- update to 1.0.0RC2 (beta)
diff --git a/xmlrpc-php81.patch b/xmlrpc-php81.patch
new file mode 100644
index 0000000..f08b9c4
--- /dev/null
+++ b/xmlrpc-php81.patch
@@ -0,0 +1,30 @@
+From 0f782ffe52cebd0a65356427b7ab72d48b72d20c Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Thu, 22 Jul 2021 12:59:04 +0200
+Subject: [PATCH] Fix #1 compatibility with 8.1.0beta1
+
+---
+ .gitignore | 1 +
+ xmlrpc-epi-php.c | 6 +++++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/xmlrpc-epi-php.c b/xmlrpc-epi-php.c
+index e3120b8..2d0b367 100644
+--- a/xmlrpc-epi-php.c
++++ b/xmlrpc-epi-php.c
+@@ -227,10 +227,14 @@ PHP_MINIT_FUNCTION(xmlrpc)
+ zend_class_entry ce;
+ INIT_CLASS_ENTRY(ce, "XmlRpcServer", class_XmlRpcServer_methods);
+ xmlrpc_server_ce = zend_register_internal_class(&ce);
+- xmlrpc_server_ce->ce_flags |= ZEND_ACC_FINAL;
+ xmlrpc_server_ce->create_object = xmlrpc_server_create_object;
++#if PHP_VERSION_ID < 80100
+ xmlrpc_server_ce->serialize = zend_class_serialize_deny;
+ xmlrpc_server_ce->unserialize = zend_class_unserialize_deny;
++ xmlrpc_server_ce->ce_flags |= ZEND_ACC_FINAL;
++#else
++ xmlrpc_server_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
++#endif
+
+ memcpy(&xmlrpc_server_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
+ xmlrpc_server_object_handlers.offset = XtOffsetOf(xmlrpc_server_data, std);