summaryrefslogtreecommitdiffstats
path: root/php-phpiredis.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-phpiredis.spec')
-rw-r--r--php-phpiredis.spec62
1 files changed, 17 insertions, 45 deletions
diff --git a/php-phpiredis.spec b/php-phpiredis.spec
index c038451..50264c1 100644
--- a/php-phpiredis.spec
+++ b/php-phpiredis.spec
@@ -1,8 +1,8 @@
# remirepo spec file for php-phpiredis
#
-# Copyright (c) 2016-2023 Remi Collet
-# License: CC-BY-SA-4.0
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2016-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
@@ -10,38 +10,22 @@
%scl_package php-phpiredis
%endif
-# For PHP < 5.6 and EPEL-9
-%{!?__phpize: %global __phpize %{_bindir}/phpize}
-%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize}
-%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config}
-%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config}
-
%bcond_without tests
%global gh_commit 4b6e81fc73b9473123a353c7c71112bf66a420ae
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner nrk
%global gh_project phpiredis
-#global gh_date 20160715
-#global prever RC1
%global pecl_name phpiredis
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%if "%{php_version}" < "5.6"
-%global ini_name %{pecl_name}.ini
-%else
%global ini_name 40-%{pecl_name}.ini
-%endif
%global sources %{gh_project}-%{gh_commit}
%global _configure ../%{sources}/configure
Name: %{?scl_prefix}php-%{pecl_name}
Version: 1.0.1
-%if 0%{?gh_date}
-Release: 4%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-%else
-Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-%endif
+Release: 7%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: Client extension for Redis
@@ -59,20 +43,12 @@ BuildRequires: %{?scl_prefix}php-pear
# ensure we use hiredis-last when exists
BuildRequires: hiredis-devel >= 0.13.3
%if %{with tests}
-BuildRequires: redis
-# Workaround
-BuildRequires: jemalloc
+BuildRequires: valkey
%endif
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%if 0%{?fedora} < 20 && 0%{?rhel} < 7
-# Filter private shared
-%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
-%{?filter_setup}
-%endif
-
%description
Phpiredis is an extension for PHP based on hiredis
@@ -112,28 +88,30 @@ mkdir ZTS
cd %{sources}
%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
cd ../NTS
%configure --with-php-config=%{__phpconfig}
-make %{?_smp_mflags}
+%make_build
%if %{with_zts}
cd ../ZTS
%configure --with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# install configuration
install -Dpm 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -Dpm 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -154,16 +132,16 @@ install -Dpm 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%if %{with tests}
: Run test server
cd %{sources}
-pidfile=$PWD/redis.pid
+pidfile=$PWD/valkey.pid
port=$(%{__php} -r 'echo 9000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE;')
sed -e "/REDIS_PORT/s/6379/$port/" -i tests/testsuite_configuration.inc
mkdir -p data
-redis-server \
+valkey-server \
--bind 127.0.0.1 \
--port $port \
--daemonize yes \
- --logfile $PWD/redis.log \
+ --logfile $PWD/valkey.log \
--dir $PWD/data \
--pidfile $pidfile
@@ -174,14 +152,6 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php -q --show-diff || ret=1
-%if %{with_zts}
-: Upstream test suite for ZTS extension
-TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
-REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php -q --show-diff || ret=1
-%endif
-
: Cleanup
if [ -s $pidfile ]; then
kill $(cat $pidfile)
@@ -193,7 +163,6 @@ exit $ret
%files
-%{!?_licensedir:%global license %%doc}
%license %{sources}/LICENSE
%doc %{sources}/README.md
@@ -207,6 +176,9 @@ exit $ret
%changelog
+* Mon Nov 18 2024 Remi Collet <remi@remirepo.net> - 1.0.1-7
+- use valkey for tests
+
* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 1.0.1-6
- rebuild for PHP 8.3.0RC1