%bcond_without json %bcond_with search %global debug_package %{nil} %define _build_id_links none %if 0%{?rhel} && 0%{?rhel} < 10 %global gcc_toolset_enable source /opt/rh/gcc-toolset-15/enable %else %global gcc_toolset_enable source /usr/lib/gcc-toolset/15-env.source %endif %global json_module_name valkey-json %global json_module_version 1.0.2 %global search_module_name valkey-search %global search_module_version 1.2.0 Name: valkey Version: 9.0.4 Release: 1%{?dist} Summary: A persistent key-value database License: BSD-3-Clause AND BSD-2-Clause AND MIT AND BSL-1.0 URL: https://valkey.io Source0: https://github.com/valkey-io/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source1: https://github.com/valkey-io/%{json_module_name}/archive/%{json_module_version}/%{json_module_name}-%{json_module_version}.tar.gz Source2: https://github.com/valkey-io/%{search_module_name}/archive/%{search_module_version}/%{search_module_name}-%{search_module_version}.tar.gz Source3: valkey.sysusers Source4: valkey.tmpfiles Patch1: valkey-9.0.4-use-system-jemalloc.patch BuildRequires: make BuildRequires: gcc-toolset-15-gcc BuildRequires: gcc-toolset-15-gcc-c++ BuildRequires: gcc-toolset-15-gcc-plugin-annobin BuildRequires: pkgconfig(libsystemd) BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros BuildRequires: openssl-devel BuildRequires: jemalloc-devel %if %{with json} || %{with search} BuildRequires: cmake BuildRequires: git-core BuildRequires: libicu-devel %endif %description Valkey is an advanced key-value store. %package devel Summary: Development headers for Valkey modules %package client Summary: Valkey CLI tools %package sentinel Summary: Sentinel service for Valkey %if %{with json} %package json Summary: JSON module for Valkey Requires: %{name}%{?_isa} = %{version}-%{release} %endif %if %{with search} %package search Summary: Search module for Valkey Requires: %{name}%{?_isa} = %{version}-%{release} %endif %prep %setup -q -n %{name}-%{version} %patch -P1 -p1 %if %{with json} %setup -q -T -D -a1 -n %{json_module_name}-%{json_module_version} %endif %if %{with search} %setup -q -T -D -a2 -n %{search_module_name}-%{search_module_version} %endif %build %{gcc_toolset_enable} %make_build \ BUILD_WITH_SYSTEMD=yes \ BUILD_TLS=yes \ BUILD_RDMA=no %if %{with json} pushd %{json_module_name}-%{json_module_version} %cmake \ -DBUILD_RELEASE=ON \ -DVALKEY_VERSION=%{version} \ -DENABLE_UNIT_TESTS=OFF \ -DENABLE_INTEGRATION_TESTS=OFF %cmake_build popd %endif %if %{with search} pushd %{search_module_name}-%{search_module_version} %cmake \ -DBUILD_RELEASE=ON \ -DVALKEY_VERSION=%{version} \ -DENABLE_UNIT_TESTS=OFF \ -DENABLE_INTEGRATION_TESTS=OFF %cmake_build popd %endif %install install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_includedir}/%{name} install -d %{buildroot}%{_libdir}/%{name}/modules install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_sharedstatedir}/%{name} install -d %{buildroot}%{_localstatedir}/log/%{name} install -d %{buildroot}%{_localstatedir}/run/%{name} install -pm755 src/valkey-{server,cli,benchmark,check-aof,check-rdb,sentinel} %{buildroot}%{_bindir}/ install -pm644 src/valkeymodule.h %{buildroot}%{_includedir}/%{name} install -Dpm644 %{S:3} %{buildroot}%{_sysusersdir}/%{name}.conf install -Dpm644 %{S:4} %{buildroot}%{_tmpfilesdir}/%{name}.conf %if %{with json} install -pDm755 \ %{json_module_name}-%{json_module_version}/src/libjson.so \ %{buildroot}%{_libdir}/%{name}/modules/libjson.so %endif %if %{with search} install -pDm755 \ %{search_module_name}-%{search_module_version}/src/libsearch.so \ %{buildroot}%{_libdir}/%{name}/modules/libsearch.so %endif %files %dir %{_sysconfdir}/%{name} %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/modules %dir %{_sharedstatedir}/%{name} %ghost %dir %{_localstatedir}/run/%{name} %{_bindir}/valkey-server %{_bindir}/valkey-check-aof %{_bindir}/valkey-check-rdb %{_sysusersdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf %files devel %{_includedir}/%{name}/valkeymodule.h %files client %{_bindir}/valkey-cli %{_bindir}/valkey-benchmark %files sentinel %{_bindir}/valkey-sentinel %if %{with json} %files json %{_libdir}/%{name}/modules/libjson.so %endif %if %{with search} %files search %{_libdir}/%{name}/modules/libsearch.so %endif %changelog %autochangelog