# remirepo/fedora spec file for valkey-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 # %global cfgname json.conf %global libname json.so # Github forge %global gh_vend valkey-io %global gh_proj valkey-json %global forgeurl https://github.com/%{gh_vend}/%{gh_proj} #global commit afe5de4ce52bb2b80af565a6f297bf330a65d0d8 %global tag %{version} # see CMakeLists.txt for commit ref # change will also require patch update %global rapidjson_url https://github.com/Tencent/rapidjson %global rapidjson_commit ebd87cb468fb4cb060b37e579718c4a4125416c1 Name: valkey-json Version: 1.0.1 %forgemeta Release: 2%{?dist} Summary: JSON as native data type # this module is BSD-3-Clause # RapidJSON is MIT License: BSD-3-Clause AND MIT URL: %{forgeurl} Source0: %{forgesource} Source1: %{rapidjson_url}/archive/%{rapidjson_commit}/rapidjson-%{rapidjson_commit}.tar.gz # use header from valkey-devel to avoid downloading valkey sources # use rapidjson git snapshot to avoid download Patch0: %{name}-offline.patch BuildRequires: valkey-devel >= 8.0 BuildRequires: cmake >= 3.17 BuildRequires: gcc-c++ Requires: valkey(modules_abi)%{?_isa} = %{valkey_modules_abi} Requires: valkey >= 8.0 Supplements: valkey Provides: bundled(RapidJSON) %description Valkey-json is a Valkey module written in C++ that provides native JSON (JavaScript Object Notation) support for Valkey. The implementation complies with RFC7159 and ECMA-404 JSON data interchange standards. Users can natively store, query, and modify JSON data structures using the JSONPath query language. The query expressions support advanced capabilities including wildcard selections, filter expressions, array slices, union operations, and recursive searches. Valkey-json leverages RapidJSON, a high-performance JSON parser and generator for C++, chosen for its small footprint and exceptional performance and memory efficiency. As a header-only library with no external dependencies, RapidJSON provides robust Unicode support while maintaining a compact memory profile of just 16 bytes per JSON value on most 32/64-bit machines. See https://rapidjson.org/ %prep %setup -q -n %{gh_proj}-%{version} -a1 %patch -P0 -p1 -b .offline : Configuration file cat << EOF | tee %{cfgname} # %{gh_proj} loadmodule %{valkey_modules_dir}/%{libname} EOF cp -p src/rapidjson/license.txt LICENSE.rapidjson %build %cmake \ -DVALKEY_VERSION=8.1 \ -DVALKEY_INCLUDE_DIR=%_includedir \ -DRAPIDJSON_SOURCE_DIR=$PWD/rapidjson-%{rapidjson_commit} \ -DBUILD_RELEASE:BOOL=ON \ -DENABLE_UNIT_TESTS:BOOL=OFF \ -DENABLE_INTEGRATION_TESTS:BOOL=OFF %cmake_build %install %if 0%{?rhel} == 8 install -Dpm755 src/*%{libname} %{buildroot}%{valkey_modules_dir}/%{libname} %else install -Dpm755 *build/src/*%{libname} %{buildroot}%{valkey_modules_dir}/%{libname} %endif install -Dpm640 %{cfgname} %{buildroot}%{valkey_modules_cfg}/%{cfgname} %files %license LICENSE* %doc *.md %attr(0640, valkey, root) %config(noreplace) %{valkey_modules_cfg}/%{cfgname} %{valkey_modules_dir}/%{libname} %changelog * Wed Aug 6 2025 Remi Collet - 1.0.1-2 - improve patch for offlilne build and submit upstream: https://github.com/valkey-io/valkey-json/pull/73 * Wed Aug 6 2025 Remi Collet - 1.0.1-1 - initial package