summaryrefslogtreecommitdiffstats
path: root/php-pecl-redis6.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-07-11 09:32:19 +0200
committerRemi Collet <remi@php.net>2024-07-11 09:32:19 +0200
commit7ab3311e96b92a12e748f7e8b673d43d3f294da2 (patch)
treef4874dda764cfe79fa6fec254421f50f289324d0 /php-pecl-redis6.spec
parentb4c70ad503eabd82414c4c719c57b3829b27d086 (diff)
add upstream patch for PHP 8.4
allow to build with valkey
Diffstat (limited to 'php-pecl-redis6.spec')
-rw-r--r--php-pecl-redis6.spec77
1 files changed, 30 insertions, 47 deletions
diff --git a/php-pecl-redis6.spec b/php-pecl-redis6.spec
index 6163676..db32f4a 100644
--- a/php-pecl-redis6.spec
+++ b/php-pecl-redis6.spec
@@ -8,7 +8,7 @@
#
%if 0%{?scl:1}
-%scl_package php-pecl-redis
+%scl_package php-pecl-redis6
%bcond_with tests
%else
%bcond_without tests
@@ -16,7 +16,12 @@
%endif
%bcond_without igbinary
%bcond_without msgpack
-
+%if 0%{?fedora} >= 41
+%bcond_without valkey
+%else
+# Use valkey instead of redis for tests
+%bcond_with valkey
+%endif
# Use keydb instead of redis for tests
%bcond_with keydb
@@ -33,11 +38,13 @@
Summary: Extension for communicating with the Redis key-value store
Name: %{?scl_prefix}php-pecl-redis6
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-3.01
URL: https://pecl.php.net/package/redis
Source0: https://pecl.php.net/get/%{sources}.tgz
+Patch0: %{pecl_name}-upstream.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.2
@@ -54,12 +61,16 @@ BuildRequires: pkgconfig(libzstd) >= 1.3.0
BuildRequires: pkgconfig(liblz4)
# to run Test suite
%if %{with tests}
+%if %{with valkey}
+BuildRequires: valkey
+%else
%if %{with keydb}
BuildRequires: keydb
%else
BuildRequires: redis
%endif
%endif
+%endif
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -94,25 +105,6 @@ Conflicts: %{?scl_prefix}php-pecl-%{pecl_name}4 < 6
Conflicts: %{?scl_prefix}php-pecl-%{pecl_name}5 < 6
%endif
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7
-# Other third party repo stuff
-%if "%{php_version}" > "7.1"
-Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.2"
-Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
-
%description
The phpredis extension provides an API for communicating
@@ -130,11 +122,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
# Don't install/register tests, license, and bundled library
sed -e 's/role="test"/role="src"/' \
- %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-e '/liblzf/d' \
-i package.xml
cd %{sources}
+%patch -P0 -p1
+
# Use system library
rm -r liblzf
@@ -282,6 +276,10 @@ done
cd %{sources}/tests
: Launch redis server
+%if %{with valkey}
+SRV=%{_root_bindir}/valkey-server
+CLI=%{_root_bindir}/valkey-cli
+%else
%if %{with keydb}
SRV=%{_root_bindir}/keydb-server
CLI=%{_root_bindir}/keydb-cli
@@ -289,15 +287,16 @@ CLI=%{_root_bindir}/keydb-cli
SRV=%{_root_bindir}/redis-server
CLI=%{_root_bindir}/redis-cli
%endif
+%endif
mkdir -p data
-pidfile=$PWD/redis.pid
+pidfile=$PWD/server.pid
port=$(%{__php} -r 'echo 9000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE + %{?fedora}%{?rhel} + 0%{?scl:1};')
$SRV \
--bind 127.0.0.1 \
--port $port \
--daemonize yes \
- --logfile $PWD/redis.log \
+ --logfile $PWD/server.log \
--dir $PWD/data \
--pidfile $pidfile
@@ -316,7 +315,7 @@ if [ -f $pidfile ]; then
$CLI -p $port shutdown nosave
sleep 2
fi
-cat $PWD/redis.log
+cat $PWD/server.log
exit $ret
%else
@@ -324,28 +323,8 @@ exit $ret
%endif
-%if 0%{?fedora} < 24 && 0%{?rhel} < 8
-# when pear installed alone, after us
-%triggerin -- %{?scl_prefix}php-pear
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-# posttrans as pear can be installed after us
-%posttrans
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-%postun
-if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
-fi
-%endif
-
-
%files
-%{?_licensedir:%license %{sources}/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -359,6 +338,10 @@ fi
%changelog
+* Thu Jul 11 2024 Remi Collet <remi@remirepo.net> - 6.0.2-2
+- add upstream patch for PHP 8.4
+- allow to build with valkey
+
* Mon Oct 23 2023 Remi Collet <remi@remirepo.net> - 6.0.2-1
- update to 6.0.2