From b4c70ad503eabd82414c4c719c57b3829b27d086 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 16 Apr 2024 12:15:03 +0200 Subject: allow build using keydb --- php-pecl-redis6.spec | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/php-pecl-redis6.spec b/php-pecl-redis6.spec index 4ae543c..6163676 100644 --- a/php-pecl-redis6.spec +++ b/php-pecl-redis6.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-redis6 # -# Copyright (c) 2012-2023 Remi Collet +# Copyright (c) 2012-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -17,6 +17,9 @@ %bcond_without igbinary %bcond_without msgpack +# Use keydb instead of redis for tests +%bcond_with keydb + %global pecl_name redis %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} # after 20-json, 40-igbinary and 40-msgpack @@ -51,7 +54,11 @@ BuildRequires: pkgconfig(libzstd) >= 1.3.0 BuildRequires: pkgconfig(liblz4) # to run Test suite %if %{with tests} -BuildRequires: redis >= 7 +%if %{with keydb} +BuildRequires: keydb +%else +BuildRequires: redis +%endif %endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} @@ -275,10 +282,18 @@ done cd %{sources}/tests : Launch redis server +%if %{with keydb} +SRV=%{_root_bindir}/keydb-server +CLI=%{_root_bindir}/keydb-cli +%else +SRV=%{_root_bindir}/redis-server +CLI=%{_root_bindir}/redis-cli +%endif + mkdir -p data pidfile=$PWD/redis.pid port=$(%{__php} -r 'echo 9000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE + %{?fedora}%{?rhel} + 0%{?scl:1};') -%{_root_bindir}/redis-server \ +$SRV \ --bind 127.0.0.1 \ --port $port \ --daemonize yes \ @@ -298,7 +313,7 @@ $TEST_PHP_EXECUTABLE $TEST_PHP_ARGS TestRedis.php || ret=1 : Cleanup if [ -f $pidfile ]; then - %{_root_bindir}/redis-cli -p $port shutdown nosave + $CLI -p $port shutdown nosave sleep 2 fi cat $PWD/redis.log -- cgit