Name: redisjson Version: 8.6.0 Release: 1%{?dist} Summary: JSON data type support module for Redis License: AGPL-3.0-only AND MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause URL: https://github.com/RedisJSON/RedisJSON Source0: https://github.com/AngelYanev/redisjson-fedora/releases/download/v%{version}/redisjson-%{version}.tar.gz Source1: https://github.com/AngelYanev/redisjson-fedora/releases/download/v%{version}/redisjson-vendor-%{version}.tar.gz %global redis_modules_dir %{_libdir}/redis/modules %global redis_confdir %{_sysconfdir}/redis/modules.d %global modso rejson.so %global cfgname redisjson.conf ExclusiveArch: %{rust_arches} BuildRequires: redis-devel BuildRequires: clang-devel BuildRequires: rust BuildRequires: cargo BuildRequires: rust-packaging BuildRequires: cargo-rpm-macros Provides: bundled(crate(common)) = 0.1.0+git.3ff28c8c2987 Provides: bundled(crate(ijson)) = 0.1.3+git.5676f5929863 Provides: bundled(crate(redis-module)) = 2.1.3+git.3ff28c8c2987 Provides: bundled(crate(redis-module-macros)) = 99.99.99+git.3ff28c8c2987 Provides: bundled(crate(redis-module-macros-internals)) = 99.99.99+git.3ff28c8c2987 Provides: bundled(crate(redis_json)) = 8.6.0 Supplements: redis %description RedisJSON is a Redis module that implements ECMA-404 (JSON) as a native data type. It allows storing, querying, and manipulating JSON documents within Redis using JSONPath syntax. The module provides atomic operations on JSON values, nested key access, and type-aware commands for arrays, objects, strings, and numbers. This package contains the shared library (rejson.so) that can be loaded into a Redis server with the MODULE LOAD command or via configuration. %prep %autosetup -n redisjson-%{version} -a 1 cat > %{cfgname} <<'EOF' loadmodule %{redis_modules_dir}/%{modso} EOF #-------------------------------- # Build module #-------------------------------- %build # Prepare vendored cargo config %cargo_prep -v vendor if [ -f vendor/.cargo/config.toml ]; then mkdir -p .cargo cp -a vendor/.cargo/config.toml .cargo/config.toml fi export CARGO_HOME=$PWD/.cargo cargo build --frozen --release #-------------------------------- # Install module #-------------------------------- %install mkdir -p %{buildroot}%{redis_modules_dir} # RedisJSON output naming can vary; install whatever was produced into the canonical name. if [ -f target/release/rejson.so ]; then install -Dpm755 target/release/rejson.so %{buildroot}%{redis_modules_dir}/%{modso} elif [ -f target/release/librejson.so ]; then install -Dpm755 target/release/librejson.so %{buildroot}%{redis_modules_dir}/%{modso} elif [ -f target/release/redisjson.so ]; then install -Dpm755 target/release/redisjson.so %{buildroot}%{redis_modules_dir}/%{modso} else echo "ERROR: Could not find module .so in target/release" ls -la target/release || true exit 1 fi # install config into buildroot for the -config subpackage install -D -m0644 %{cfgname} %{buildroot}%{redis_confdir}/%{cfgname} # ------------------------- # -config subpackage (opt-in) # ------------------------- %package -n %{name}-config Summary: Drop-in configuration to auto-load the RedisJSON module Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} %description -n %{name}-config This subpackage installs a drop-in configuration snippet into %{redis_confdir}/ that causes Redis to load the RedisJSON module automatically on startup. Install this package for hands-free module activation. If you prefer to manage module loading manually (e.g. via MODULE LOAD or your own Redis configuration), you do not need this package. %files %license LICENSE.txt %doc *.md %{redis_modules_dir}/%{modso} %files -n %{name}-config %config(noreplace) %{redis_confdir}/%{cfgname} %changelog * Mon Mar 02 2026 Angel Yanev - 8.6.0-0.1 - Initial package for RedisJSON module