From 11597833642dc9e9b23daca48c90732b04fcf886 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 24 Jul 2025 10:33:25 +0200 Subject: initial package --- redis-json.spec | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 redis-json.spec (limited to 'redis-json.spec') 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 - 8.0.1-1 +- initial package -- cgit