summaryrefslogtreecommitdiffstats
path: root/redis-json.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-07-24 10:33:25 +0200
committerRemi Collet <remi@php.net>2025-07-24 10:33:25 +0200
commit11597833642dc9e9b23daca48c90732b04fcf886 (patch)
tree911cdfcb96e176e39e095bf61ff442faf1210a69 /redis-json.spec
initial package
Diffstat (limited to 'redis-json.spec')
-rw-r--r--redis-json.spec126
1 files changed, 126 insertions, 0 deletions
diff --git a/redis-json.spec b/redis-json.spec
new file mode 100644
index 0000000..a87e32b
--- /dev/null
+++ b/redis-json.spec
@@ -0,0 +1,126 @@
+# remirepo/fedora spec file for redis-json
+#
+# SPDX-FileCopyrightText: Copyright 2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+#
+# Please, preserve the changelog entries
+#
+
+# Github forge
+%global gh_vend RedisJSON
+%global gh_proj RedisJSON
+%global forgeurl https://github.com/%{gh_vend}/%{gh_proj}
+#global commit afe5de4ce52bb2b80af565a6f297bf330a65d0d8
+%global tag v%{version}
+# for EL-8 to avoid TAG usage
+%global archivename %{gh_proj}-%{version}
+
+Name: redis-json
+Version: 8.0.1
+%forgemeta
+Release: 1%{?dist}
+Summary: JSON as native data type
+# Starting with Redis 8, RedisJSON is licensed under your choice of:
+# (i) Redis Source Available License 2.0 (RSALv2);
+# (ii) the Server Side Public License v1 (SSPLv1); or
+# (iii) the GNU Affero General Public License version 3 (AGPLv3).
+License: AGPL-3.0-only
+URL: %{forgeurl}
+Source0: %{forgesource}
+Source1: makedeps.sh
+Source2: %{gh_proj}-deps-%{version}.tgz
+
+BuildRequires: redis-devel
+%if 0%{?fedora} || 0%{?rhel} >= 9
+BuildRequires: cargo-rpm-macros >= 24
+%endif
+BuildRequires: cargo >= 1.73
+BuildRequires: rust >= 1.73
+BuildRequires: clang-devel
+
+Provides: redis(modules_abi)%{?_isa} = %{redis_modules_abi}
+Requires: (redis >= 8.0 with redis < 8.1)
+Supplements: redis
+
+
+%description
+RedisJSON is a Redis module that implements ECMA-404 The JSON Data Interchange
+Standard as a native data type. It allows storing, updating, and fetching JSON
+values from Redis keys (documents).
+
+%prep
+%setup -q -a2 -n %{gh_proj}-%{version}
+
+: Configuration file
+cat << EOF | tee json.conf
+# %{gh_proj}
+loadmodule %{redis_modules_dir}/librejson.so
+EOF
+
+: Create cargo configuration to use vendor directory
+cat << EOF | tee .cargo/config.toml
+[build]
+jobs = %(echo %{?_smp_mflags} | sed 's/\-j//')
+rustc = "%{_bindir}/rustc"
+
+[profile.rpm]
+inherits = "release"
+opt-level = 3
+codegen-units = 1
+debug = 2
+strip = "none"
+
+[env]
+CFLAGS = "%{build_cflags}"
+CXXFLAGS = "%{build_cxxflags}"
+LDFLAGS = "%{build_ldflags}"
+
+[term]
+verbose = true
+
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source."git+https://github.com/RedisJSON/ijson?rev=881b96e7941b8dc335863746ac108f6d9ed0b98a"]
+git = "https://github.com/RedisJSON/ijson"
+rev = "881b96e7941b8dc335863746ac108f6d9ed0b98a"
+replace-with = "vendored-sources"
+
+[source."git+https://github.com/RedisLabsModules/redismodule-rs?tag=v2.1.2"]
+git = "https://github.com/RedisLabsModules/redismodule-rs"
+tag = "v2.1.2"
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "$PWD/mycargo"
+EOF
+
+: Required rust version
+grep -h rust-version mycargo/*/Cargo.toml Cargo.toml | sort -u | tail -n 8
+
+
+%build
+%if 0%{?fedora} || 0%{?rhel} >= 9
+%cargo_build
+%else
+cargo build %{?_smp_mflags} --profile rpm
+%endif
+
+
+%install
+install -Dpm755 target/rpm/librejson.so %{buildroot}%{redis_modules_dir}/librejson.so
+install -Dpm640 json.conf %{buildroot}%{redis_modules_cfg}/json.conf
+
+
+%files
+%license LICENSE.txt
+%license licenses/AGPLv3.txt
+%doc *.md
+%attr(0640, redis, root) %config(noreplace) %{redis_modules_cfg}/json.conf
+%{redis_modules_dir}/librejson.so
+
+
+%changelog
+* Wed Jul 23 2025 Remi Collet <remi@remirepo.net> - 8.0.1-1
+- initial package