%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 %bcond_with json %bcond_with search Name: valkey Version: 9.0.3 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-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: git-core BuildRequires: libicu-devel %endif %description Valkey is an advanced key-value store. %package devel Summary: Development header for Valkey module development Provides: %{name}-static = %{version}-%{release} %description devel Header file required for building loadable Valkey modules. %package client Summary: Command line tools for Valkey %description client Command line client and benchmarking tools for Valkey. %package sentinel Summary: Sentinel service for Valkey %description sentinel High availability Sentinel daemon for Valkey. %if %{with json} %package json Summary: JSON module for Valkey Requires: %{name}%{?_isa} = %{version}-%{release} %description json JSON data type support module for Valkey. %endif %if %{with search} %package search Summary: Search module for Valkey Requires: %{name}%{?_isa} = %{version}-%{release} %description search Full-text search and secondary indexing module for Valkey. %endif %prep %setup -n %{name}-%{version} -a1 -a2 %patch -P1 -p1 %build %{gcc_toolset_enable} %make_build \ DEBUG="" \ V="echo" \ BUILD_WITH_SYSTEMD=yes \ BUILD_TLS=yes \ BUILD_RDMA=no %if %{with json} pushd %{json_module_name}-%{json_module_version} cmake \ -DVALKEY_VERSION=%{version} \ -DBUILD_RELEASE=1 make %{?_smp_mflags} popd %endif %if %{with search} pushd %{search_module_name}-%{search_module_version} cmake \ -DVALKEY_VERSION=%{version} \ -DBUILD_RELEASE=1 make %{?_smp_mflags} popd %endif %install %{gcc_toolset_enable} %make_install -C src \ PREFIX=%{buildroot}/%{_prefix} \ USE_REDIS_SYMLINKS=no # remove sample confs rm -rf %{buildroot}%{_datadir}/%{name} # System user install -p -D -m 0644 %{S:3} %{buildroot}%{_sysusersdir}/%{name}.conf # Install tmpfiles.d file install -p -D -m 0644 %{S:4} %{buildroot}%{_tmpfilesdir}/%{name}.conf # Filesystem layout install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_sharedstatedir}/%{name} install -d %{buildroot}%{_libdir}/%{name} install -d %{buildroot}%{_libdir}/%{name}/modules # Fix executable permissions chmod 755 %{buildroot}%{_bindir}/%{name}-* # Install module development header install -pDm644 src/%{name}module.h %{buildroot}%{_includedir}/%{name}module.h %if %{with json} pushd %{json_module_name}-%{json_module_version} install -pDm755 src/libjson.so %{buildroot}%{_libdir}/%{name}/modules/libjson.so popd %endif %if %{with search} pushd %{search_module_name}-%{search_module_version} install -pDm755 src/libsearch.so %{buildroot}%{_libdir}/%{name}/modules/libsearch.so popd %endif %files %attr(0750, valkey, root) %dir %{_sysconfdir}/%{name} %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/modules %dir %attr(0750, valkey, valkey) %{_sharedstatedir}/%{name} %{_bindir}/%{name}-* %dir %attr(0755, valkey, valkey) %ghost %{_localstatedir}/run/%{name} %{_sysusersdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf %if %{with json} %files json %{_libdir}/%{name}/modules/libjson.so %endif %if %{with search} %files search %{_libdir}/%{name}/modules/libsearch.so %endif %files devel %{_includedir}/%{name}module.h %files client %{_bindir}/valkey-cli %{_bindir}/valkey-benchmark %files sentinel %{_bindir}/valkey-sentinel %changelog %autochangelog