From 3f02f88a17d0d6b0891497a65ed190b89157416d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 11 Sep 2020 16:48:26 +0200 Subject: add patches for PHP 8 from upstream and https://github.com/phpredis/phpredis/pull/1845 disable msgpack serializer with PHP 8 --- php-pecl-redis5.spec | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'php-pecl-redis5.spec') diff --git a/php-pecl-redis5.spec b/php-pecl-redis5.spec index 7e6563b..e6f5389 100644 --- a/php-pecl-redis5.spec +++ b/php-pecl-redis5.spec @@ -21,6 +21,13 @@ %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %bcond_without tests %bcond_without igbinary +# NOTICE: this only work when php-devel in buildroot (so only for SCL) +# use mock... --without msgpack for base package +%if "%{php_version}" > "8.0" +%bcond_with msgpack +%else +%bcond_without msgpack +%endif # after 20-json, 40-igbinary and 40-msgpack %global ini_name 50-%{pecl_name}.ini @@ -30,11 +37,13 @@ Summary: Extension for communicating with the Redis key-value store Name: %{?sub_prefix}php-pecl-redis5 Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -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;')}} License: PHP URL: https://pecl.php.net/package/redis Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Patch0: %{pecl_name}-php8.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel > 7 BuildRequires: %{?scl_prefix}php-pear @@ -42,7 +51,9 @@ BuildRequires: %{?scl_prefix}php-json %if %{with igbinary} BuildRequires: %{?scl_prefix}php-pecl-igbinary-devel %endif +%if %{with msgpack} BuildRequires: %{?scl_prefix}php-pecl-msgpack-devel >= 2.0.3 +%endif BuildRequires: pkgconfig(liblzf) BuildRequires: pkgconfig(libzstd) >= 1.3.0 BuildRequires: pkgconfig(liblz4) @@ -57,7 +68,9 @@ Requires: %{?scl_prefix}php-json%{?_isa} %if %{with igbinary} Requires: %{?scl_prefix}php-pecl(igbinary)%{?_isa} %endif +%if %{with msgpack} Requires: %{?scl_prefix}php-pecl-msgpack%{?_isa} +%endif %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Obsoletes: %{?scl_prefix}php-%{pecl_name} < 3 @@ -79,7 +92,7 @@ Conflicts: %{?scl_prefix}php-pecl-%{pecl_name} < 5 Conflicts: %{?scl_prefix}php-pecl-%{pecl_name}4 < 5 %endif -%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} +%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff %if "%{php_version}" > "7.1" Obsoletes: php71u-pecl-%{pecl_name} <= %{version} @@ -95,7 +108,9 @@ Obsoletes: php73w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.4" Obsoletes: php74-pecl-%{pecl_name} <= %{version} -Obsoletes: php74w-pecl-%{pecl_name} <= %{version} +%endif +%if "%{php_version}" > "8.0" +Obsoletes: php80-pecl-%{pecl_name} <= %{version} %endif %endif @@ -129,6 +144,10 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%if "%{php_version}" > "8.0" +%patch0 -p1 -b.php8 +%endif + # Use system library rm -r liblzf @@ -203,7 +222,9 @@ peclconf() { %if %{with igbinary} --enable-redis-igbinary \ %endif +%if %{with msgpack} --enable-redis-msgpack \ +%endif --enable-redis-lzf \ --with-liblzf \ --enable-redis-zstd \ @@ -251,20 +272,25 @@ done %check # simple module load test -DEPS="--no-php-ini --define extension=json.so" +DEPS="--no-php-ini" +%if "%{php_version}" < "8.0" +DEPS="$DEPS --define extension=json.so" +%endif %if %{with igbinary} DEPS="$DEPS --define extension=igbinary.so" %endif +%if %{with msgpack} DEPS="$DEPS --define extension=msgpack.so" +%endif %{__php} $DEPS \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --modules | grep '^%{pecl_name}$' %if %{with_zts} %{__ztsphp} $DEPS \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --modules | grep '^%{pecl_name}$' %endif %if %{with tests} @@ -339,6 +365,11 @@ fi %changelog +* Fri Sep 11 2020 Remi Collet - 5.3.1-2 +- add patches for PHP 8 from upstream and + https://github.com/phpredis/phpredis/pull/1845 +- disable msgpack serializer with PHP 8 + * Wed Jul 8 2020 Remi Collet - 5.3.1-1 - update to 5.3.1 -- cgit