# Redis and the modules upstream bundles with it, built from one source. # # Packages: # redis the server. It recommends the four modules, so # `dnf install redis` gives the server with every module. # redisbloom \ # redisearch | one module each: the .so and its loadmodule stub. # redisjson | Each requires redis. # redistimeseries / # redis-devel redismodule.h and RPM macros for building other modules. # # Everything is in one spec because upstream pins each module to an exact ref # in modules/modules.yaml for every Redis release. Module versions follow the # core and are bumped together with it. See docs/MAINTENANCE.md. # # The build has no network access, so: # - Source1 and Source2 carry the Rust crates for RedisJSON and RediSearch. # - Source3 to Source8 carry RediSearch's CMake FetchContent dependencies. # Boost, the seventh, comes from the system. # - the release tarball marks each module as already fetched. # # Vector sets are compiled into the server by upstream. They are not a # module, so there is nothing to package for them. %global _hardened_build 1 %global redis_modules_abi 1 %global redis_modules_dir %{_libdir}/redis/modules %global redis_modules_cfg %{_sysconfdir}/redis/modules.conf.d # RediSearch's CMake FetchContent pins. Re-check them on every bump: a stale # pin only fails late, at configure time. %global cpu_features_ver 0.10.1 %global eve_ver 2023.02.15 %global robinmap_ver 1.4.0 %global fmt_ver 12.1.0 %global spdlog_ver 1.15.3 %global toml_ver 3.3.0 # The upstream test suite runs with --with tests. It is off by default # because it is slow and timing-sensitive on shared builders. %bcond_with tests Name: redis Version: 8.12~rc3 # Upstream writes pre-releases as 8.12-rc3. %global upstream_ver %(echo %{version} | tr '~' '-') Release: 1%{?dist} Summary: A persistent key-value database # The server only. Each module package carries its own licence expression. # - redis: AGPL-3.0-only (upstream offers RSALv2, SSPLv1 or AGPLv3) # - deps/hiredis: BSD-3-Clause # - deps/jemalloc, deps/linenoise, src/lzf*: BSD-2-Clause # - deps/lua: MIT # - deps/fpconv: BSL-1.0 # - deps/hdr_histogram: CC0-1.0 OR BSD-2-Clause # - deps/xxhash, deps/fast_float: BSD-2-Clause / MIT # - deps/tre: BSD-2-Clause # - deps/croaring: Apache-2.0 OR MIT License: AGPL-3.0-only AND BSD-3-Clause AND BSD-2-Clause AND MIT AND BSL-1.0 AND (Apache-2.0 OR MIT) URL: https://redis.io # Upstream's release tarball already contains each module at its pinned ref. Source0: https://download.redis.io/releases/redis-%{upstream_ver}.tar.gz # Rust crates for RedisJSON and RediSearch, from `cargo vendor`. Generated by # scripts/make-sources.sh (`make sources`) because the build has no network. Source1: redisjson-vendor-%{upstream_ver}.tar.gz Source2: redisearch-vendor-%{upstream_ver}.tar.gz Source3: https://github.com/google/cpu_features/archive/refs/tags/v%{cpu_features_ver}.tar.gz#/cpu_features-%{cpu_features_ver}.tar.gz Source4: https://github.com/jfalcou/eve/archive/refs/tags/v%{eve_ver}.tar.gz#/eve-%{eve_ver}.tar.gz Source5: https://github.com/Tessil/robin-map/archive/refs/tags/v%{robinmap_ver}.tar.gz#/robin-map-%{robinmap_ver}.tar.gz Source6: https://github.com/fmtlib/fmt/archive/refs/tags/%{fmt_ver}.tar.gz#/fmt-%{fmt_ver}.tar.gz Source7: https://github.com/gabime/spdlog/archive/refs/tags/v%{spdlog_ver}.tar.gz#/spdlog-%{spdlog_ver}.tar.gz Source8: https://github.com/marzer/tomlplusplus/archive/refs/tags/v%{toml_ver}.tar.gz#/tomlplusplus-%{toml_ver}.tar.gz Source9: redis.logrotate Source10: redis-sentinel.service Source11: redis.service Source12: redis.sysusers Source13: %{name}.rpmlintrc # RPM layout paths in redis.conf and sentinel.conf, and an include of # %%{redis_modules_cfg}/*.conf so that the module package enables itself. # Also removes the tarball's loadmodule lines: they point into the source # tree, and Redis aborts at startup when a loadmodule target is missing. # Sets config-rewrite-source-aware, so that CONFIG REWRITE leaves the settings # of the included module files out of redis.conf. # Distribution-specific, not for upstream. Patch0: redis-conf.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: cmake >= 3.13 BuildRequires: automake BuildRequires: autoconf BuildRequires: libtool BuildRequires: pkgconf-pkg-config BuildRequires: python3 # RedisJSON and RedisTimeSeries build through `readies`, which needs a working # `python3 -m pip` and reports a missing interpreter without it. BuildRequires: python3-pip BuildRequires: openssl-devel >= 1.0.2 BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(libsystemd) BuildRequires: jq BuildRequires: which # RediSearch takes Boost from the system (-DBOOST_DIR). BuildRequires: boost-devel >= 1.83 BuildRequires: clang-devel # Crates come from Source1 and Source2, so no rust-*-devel BuildRequires. BuildRequires: rust >= 1.80 BuildRequires: cargo # For %%cargo_vendor_manifest and %%cargo_license_summary. BuildRequires: cargo-rpm-macros >= 25 %if %{with tests} BuildRequires: procps-ng BuildRequires: tcl8 %endif Requires: logrotate # The modules upstream bundles with Redis. They are weak dependencies: # `dnf install redis` installs them, and each can be removed or left out. Recommends: redisbloom%{?_isa} = %{version}-%{release} Recommends: redisearch%{?_isa} = %{version}-%{release} Recommends: redisjson%{?_isa} = %{version}-%{release} Recommends: redistimeseries%{?_isa} = %{version}-%{release} # Both packages install the redis-* binaries and redis.service. Conflicts: valkey-compat-redis Provides: redis(modules_abi)%{?_isa} = %{redis_modules_abi} Provides: bundled(jemalloc) = 5.3.0 Provides: bundled(hiredis) = 1.2.0 Provides: bundled(lua-libs) = 5.1.5 Provides: bundled(linenoise) = 1.0 Provides: bundled(lzf) Provides: bundled(hdr_histogram) = 0.11.0 Provides: bundled(fast_float) = 6.1.4 Provides: bundled(xxhash) = 0.8.3 Provides: bundled(fpconv) Provides: bundled(tre) Provides: bundled(croaring) = 4.7.2 # The modules are loaded by path, not linked against. %global __provides_exclude_from ^%{redis_modules_dir}/.*$ # The module build scripts only support x86_64 and aarch64. ExclusiveArch: x86_64 aarch64 %description Redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. Vector sets are compiled into the server. The modules upstream bundles with Redis are packaged as redisbloom, redisearch, redisjson and redistimeseries. They are installed together with this package by default, and each can be removed or left out. A module package drops a loadmodule stub into %{redis_modules_cfg}, which redis.conf includes, so the module is live as soon as Redis starts. The server and the modules are built from the same source, so they can never drift apart. %package -n redisbloom Summary: Bloom and cuckoo filters, count-min sketch and top-k for Redis # - RedisBloom: AGPL-3.0-only (upstream offers RSALv2, SSPLv1 or AGPLv3) # - deps/RedisModulesSDK: BSD-3-Clause and MIT # - deps/t-digest-c: MIT License: AGPL-3.0-only AND BSD-3-Clause AND MIT Requires: redis%{?_isa} = %{version}-%{release} Provides: bundled(RedisModulesSDK) Provides: bundled(readies) Provides: bundled(t-digest-c) %description -n redisbloom RedisBloom, as shipped with Redis %{version}. Adds Bloom and cuckoo filters, count-min sketch, top-k and t-digest data types to Redis. Installing this package enables the module: it drops a loadmodule stub into %{redis_modules_cfg}, which redis.conf includes. %package -n redisearch Summary: Full-text search, vector similarity and indexing for Redis # - RediSearch and VectorSimilarity: AGPL-3.0-only (upstream offers RSALv2, # SSPLv1 or AGPLv3) # - bundled C and C++ libraries: Apache-2.0, BSD-2-Clause, BSD-3-Clause, # BSL-1.0, ISC, MIT # - the rest, including every parenthesised term: the Rust crates linked into # redisearch.so, as printed by %%cargo_license_summary in the build log. # Update them from there on every bump. License: %{shrink: AGPL-3.0-only AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND CDLA-Permissive-2.0 AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0 AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (LGPL-3.0-or-later OR MPL-2.0) AND (MIT OR Apache-2.0 OR LGPL-2.1-or-later) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) } Requires: redis%{?_isa} = %{version}-%{release} Provides: bundled(VectorSimilarity) Provides: bundled(hiredis) = 1.3.0 Provides: bundled(libuv) = 1.48.0 Provides: bundled(cpu_features) = %{cpu_features_ver} Provides: bundled(eve) = %{eve_ver} Provides: bundled(robin-map) = %{robinmap_ver} Provides: bundled(fmt) = %{fmt_ver} Provides: bundled(spdlog) = %{spdlog_ver} Provides: bundled(tomlplusplus) = %{toml_ver} %description -n redisearch RediSearch, as shipped with Redis %{version}. Adds secondary indexing, full-text search, vector similarity search and aggregations to Redis. Installing this package enables the module: it drops a loadmodule stub into %{redis_modules_cfg}, which redis.conf includes. %package -n redisjson Summary: JSON data type with JSONPath queries for Redis # - RedisJSON: AGPL-3.0-only (upstream offers RSALv2, SSPLv1 or AGPLv3) # - deps/RedisModulesSDK: BSD-3-Clause and MIT # - the rest: the Rust crates linked into rejson.so, as printed by # %%cargo_license_summary in the build log. Update them from there on # every bump. License: %{shrink: AGPL-3.0-only AND Apache-2.0 AND BSD-3-Clause AND MIT AND Unicode-3.0 AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR LGPL-2.1-or-later) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) } Requires: redis%{?_isa} = %{version}-%{release} Provides: bundled(RedisModulesSDK) Provides: bundled(readies) %description -n redisjson RedisJSON, as shipped with Redis %{version}. Adds a JSON data type with JSONPath queries to Redis. Installing this package enables the module: it drops a loadmodule stub into %{redis_modules_cfg}, which redis.conf includes. %package -n redistimeseries Summary: Time series data type for Redis # - RedisTimeSeries: AGPL-3.0-only (upstream offers RSALv2, SSPLv1 or AGPLv3) # - deps/LibMR with its libevent and hiredis: BSD-3-Clause and MIT # - deps/RedisModulesSDK: BSD-3-Clause and MIT # - deps/cpu_features: Apache-2.0 # - deps/dragonbox, deps/fast_double_parser: Apache-2.0 OR BSL-1.0 License: AGPL-3.0-only AND Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) Requires: redis%{?_isa} = %{version}-%{release} Provides: bundled(RedisModulesSDK) Provides: bundled(readies) Provides: bundled(LibMR) Provides: bundled(libevent) = 2.1.12 Provides: bundled(hiredis) = 1.2.0 Provides: bundled(cpu_features) = 0.10.1 Provides: bundled(fast_double_parser) Provides: bundled(dragonbox) Provides: bundled(minunit) %description -n redistimeseries RedisTimeSeries, as shipped with Redis %{version}. Adds a time series data type with downsampling, compaction and aggregation to Redis. Installing this package enables the module: it drops a loadmodule stub into %{redis_modules_cfg}, which redis.conf includes. %package devel Summary: Development header for Redis module development Provides: redis-static = %{version}-%{release} Requires: redis%{?_isa} = %{version}-%{release} # Both packages install redismodule.h. Conflicts: valkey-compat-redis-devel %description devel Header and RPM macros for building modules against this Redis. %prep %autosetup -n redis-%{upstream_ver} -p1 # Bundled licence texts, moved to the top level for %%license. mv deps/jemalloc/COPYING COPYING-jemalloc mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/hiredis/COPYING COPYING-hiredis mv deps/hdr_histogram/LICENSE.txt LICENSE-hdrhistogram mv deps/fpconv/LICENSE.txt LICENSE-fpconv mv deps/xxhash/LICENSE LICENSE-xxhash mv deps/tre/LICENSE LICENSE-tre mv deps/croaring/LICENSE LICENSE-croaring # --- RedisJSON: vendored crates ------------------------------------------- tar xzf %{SOURCE1} -C modules/redisjson/src mkdir -p modules/redisjson/src/.cargo cp -a modules/redisjson/src/vendor/.cargo/config.toml \ modules/redisjson/src/.cargo/config.toml # RedisJSON's Makefile moves the debug info out of rejson.so into a sidecar # file. rpm has to find it in the module to build the debuginfo package. grep -q 'extract_symbols_safe.sh' modules/redisjson/src/Makefile sed -i '/extract_symbols_safe.sh/d' modules/redisjson/src/Makefile # --- RediSearch: vendored crates and FetchContent dependencies ------------- tar xzf %{SOURCE2} -C modules/redisearch/src for s in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8}; do tar xzf "$s" -C modules/redisearch/src done # Some Rust build scripts find the workspace root by looking for .git. mkdir -p modules/redisearch/src/.git pushd modules/redisearch/src patch -p1 -d tomlplusplus-%{toml_ver} \ < deps/VectorSimilarity/deps/ScalableVectorSearch/cmake/patches/tomlplusplus_v330.patch # Fedora packages must not build with -Werror. find deps/VectorSimilarity -name CMakeLists.txt -exec sed -i 's/-Werror//g' {} + find . -name '._*' -delete popd # Architecture-specific jemalloc tuning (rhbz#2240293). %ifarch %ix86 %arm x86_64 s390x sed -e 's/--with-lg-quantum/--with-lg-page=12 --with-lg-quantum/' -i deps/Makefile %endif %ifarch ppc64 ppc64le aarch64 sed -e 's/--with-lg-quantum/--with-lg-page=16 --with-lg-quantum/' -i deps/Makefile %endif # Fail if upstream bumps the module API version. See docs/MAINTENANCE.md # before changing redis_modules_abi. api=$(sed -n -e 's/#define REDISMODULE_APIVER_[0-9][0-9]* //p' src/redismodule.h) if test "$api" != "%{redis_modules_abi}"; then : Error: Upstream API version is now ${api}, expecting %{redis_modules_abi}. exit 1 fi cat << 'EOF' | tee macros.redis %%redis_version %{upstream_ver} %%redis_modules_abi %redis_modules_abi %%redis_modules_dir %redis_modules_dir %%redis_modules_cfg %redis_modules_cfg EOF %build %global make_flags DEBUG="" V="echo" BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes export CARGO_NET_OFFLINE=true # Core and the three modules that build offline through upstream's own # `make build`. %make_build build redisbloom redisjson redistimeseries %{make_flags} PREFIX=%{_prefix} # RediSearch is built with %%cmake because its build.sh does not pass Fedora's # linker flags, and rpm then fails with "Missing build-id". # INLINE_LSE_ATOMICS=OFF keeps the module runnable on Armv8.0-a CPUs. pushd modules/redisearch/src RS_ROOT=$PWD export CXXFLAGS="%{optflags} -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable" # %%cmake defaults to BUILD_SHARED_LIBS=ON, which would turn RediSearch's # bundled libraries (VectorSimilarity, hiredis, fmt, ...) into separate shared # objects. Upstream links them statically into redisearch.so. %cmake \ -DBUILD_SHARED_LIBS=OFF \ -DCOORD_TYPE=oss \ -DBOOST_DIR=%{_includedir} \ -DREDISEARCH_BUILD_SHARED=ON \ -DBUILD_SEARCH_UNIT_TESTS=OFF \ -DVECSIM_BUILD_TESTS=OFF \ -DSVS_SHARED_LIB=OFF \ -DBUILD_INTEL_SVS_OPT=0 \ -DRUST_PROFILE=release \ -DREDISEARCH_GENERATE_HEADERS=OFF \ -DINLINE_LSE_ATOMICS=OFF \ -DFETCHCONTENT_SOURCE_DIR_CPU_FEATURES=$RS_ROOT/cpu_features-%{cpu_features_ver} \ -DFETCHCONTENT_SOURCE_DIR_EVE=$RS_ROOT/eve-%{eve_ver} \ -DFETCHCONTENT_SOURCE_DIR_ROBINMAP=$RS_ROOT/robin-map-%{robinmap_ver} \ -DFETCHCONTENT_SOURCE_DIR_FMT=$RS_ROOT/fmt-%{fmt_ver} \ -DFETCHCONTENT_SOURCE_DIR_SPDLOG=$RS_ROOT/spdlog-%{spdlog_ver} \ -DFETCHCONTENT_SOURCE_DIR_TOMLPLUSPLUS=$RS_ROOT/tomlplusplus-%{toml_ver} \ -DFETCHCONTENT_FULLY_DISCONNECTED=ON %cmake_build popd # List the vendored crates of each Rust module. An RPM generator turns the # cargo-vendor.txt a package ships into its bundled(crate()) Provides. The # licence summaries feed the License tags of redisjson and redisearch. for d in modules/redisjson/src modules/redisearch/src/src/redisearch_rs; do pushd $d %cargo_vendor_manifest %cargo_license_summary popd done %check test -x src/redis-server test -f modules/redisbloom/redisbloom.so test -f modules/redisjson/rejson.so test -f modules/redistimeseries/redistimeseries.so test -x modules/redisearch/src/%{__cmake_builddir}/redisearch.so %if %{with tests} ./runtest --clients 4 %endif %install %make_install -C src %{make_flags} PREFIX=%{buildroot}%{_prefix} install -d %{buildroot}%{redis_modules_dir} install -d %{buildroot}%{redis_modules_cfg} # --- modules built via upstream common.mk --------------------------------- install -pm 0755 modules/redisbloom/redisbloom.so %{buildroot}%{redis_modules_dir}/redisbloom.so install -pm 0755 modules/redisjson/rejson.so %{buildroot}%{redis_modules_dir}/rejson.so install -pm 0755 modules/redistimeseries/redistimeseries.so %{buildroot}%{redis_modules_dir}/redistimeseries.so # --- RediSearch ------------------------------------------------------------- install -pm 0755 modules/redisearch/src/%{__cmake_builddir}/redisearch.so \ %{buildroot}%{redis_modules_dir}/redisearch.so # --- loadmodule stubs ------------------------------------------------------- # One per module. redis.conf includes this directory (Patch0). for pair in redisbloom:redisbloom.so search:redisearch.so \ redisjson:rejson.so timeseries:redistimeseries.so; do name=${pair%%:*}; lib=${pair#*:} printf '# %s\nloadmodule %s/%s\n' "$name" "%{redis_modules_dir}" "$lib" \ > %{buildroot}%{redis_modules_cfg}/${name}.conf done # --- core system integration ---------------------------------------------- install -p -D -m 0644 %{SOURCE12} %{buildroot}%{_sysusersdir}/%{name}.conf install -pDm 0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} mkdir -p %{buildroot}%{_unitdir} install -pm 0644 %{SOURCE11} %{buildroot}%{_unitdir} install -pm 0644 %{SOURCE10} %{buildroot}%{_unitdir} install -d %{buildroot}%{_sharedstatedir}/%{name} install -d %{buildroot}%{_localstatedir}/log/%{name} install -pDm 0640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf install -pDm 0640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}/sentinel.conf chmod 755 %{buildroot}%{_bindir}/%{name}-* install -pDm 0644 src/redismodule.h %{buildroot}%{_includedir}/redismodule.h mkdir -p %{buildroot}%{_rpmmacrodir} install -pDm 0644 macros.redis %{buildroot}%{_rpmmacrodir}/macros.%{name} %post %systemd_post %{name}.service %systemd_post %{name}-sentinel.service %preun %systemd_preun %{name}.service %systemd_preun %{name}-sentinel.service %postun %systemd_postun_with_restart %{name}.service %systemd_postun_with_restart %{name}-sentinel.service # The server, and the directories the modules install into. %files %license LICENSE.txt %license COPYING-jemalloc %license COPYRIGHT-lua %license COPYING-hiredis %license LICENSE-hdrhistogram %license LICENSE-fpconv %license LICENSE-xxhash %license LICENSE-tre %license LICENSE-croaring %doc 00-RELEASENOTES README.md CONTRIBUTING.md MANIFESTO SECURITY.md %{_bindir}/%{name}-benchmark %{_bindir}/%{name}-check-aof %{_bindir}/%{name}-check-rdb %{_bindir}/%{name}-cli %{_bindir}/%{name}-sentinel %{_bindir}/%{name}-server %{_unitdir}/%{name}.service %{_unitdir}/%{name}-sentinel.service %{_sysusersdir}/%{name}.conf %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %attr(0750, redis, root) %dir %{_sysconfdir}/%{name} %attr(0750, redis, root) %dir %{redis_modules_cfg} %attr(0640, redis, redis) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf %attr(0640, redis, redis) %config(noreplace) %{_sysconfdir}/%{name}/sentinel.conf %dir %{_libdir}/%{name} %dir %{redis_modules_dir} %dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name} # redis:redis because the daemon creates its log file here as the redis user. %dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name} # One module each. The directories belong to redis. %files -n redisbloom %license modules/redisbloom/src/LICENSE.txt %{redis_modules_dir}/redisbloom.so %config(noreplace) %{redis_modules_cfg}/redisbloom.conf %files -n redisearch %license modules/redisearch/src/LICENSE.txt %license modules/redisearch/src/src/redisearch_rs/cargo-vendor.txt %{redis_modules_dir}/redisearch.so %config(noreplace) %{redis_modules_cfg}/search.conf %files -n redisjson %license modules/redisjson/src/LICENSE.txt %license modules/redisjson/src/cargo-vendor.txt %{redis_modules_dir}/rejson.so %config(noreplace) %{redis_modules_cfg}/redisjson.conf %files -n redistimeseries %license modules/redistimeseries/src/LICENSE.txt %{redis_modules_dir}/redistimeseries.so %config(noreplace) %{redis_modules_cfg}/timeseries.conf %files devel %{_includedir}/redismodule.h %{_rpmmacrodir}/macros.%{name} %changelog * Tue Nov 17 2026 Angel Yanev - 8.12~rc3-1 - Initial package