File redict.spec of Package redict

#
# spec file for package msktutil
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

Name:           redict
Version:        7.3.6
Release:        1
Summary:        A distributed key-value store
Group:          System/Management
License:        LGPL-3.0-only
URL:            https://codeberg.org/redict/redict
Source:         redict-7.3.6.tar.gz
Patch0:         redict-backport-fixes.patch

%if 0%{suse_version} >= 1600
%define pythons python3
%else
%{?sle15_python_module_pythons}
%endif
%define mypython %pythons
%define __mypython %{expand:%%__%{mypython}}

BuildRequires: %{mypython}

%if 0%{suse_version} < 1600
BuildRequires:  gcc13-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  libopenssl-3-devel
BuildRequires:  openssl-3
BuildRequires:  git
BuildRequires:  tcl
BuildRequires:  tls
BuildRequires:  procps

%description
Redict is a distributed key/value store (a remote dictionary, if you will).

Redict is an independent fork of RedisĀ®* OSS 7.2.4 licensed under the Lesser GNU General Public license (LGPL-3.0-only). Redict is not affiliated with RedisĀ®.


%prep
%autosetup -p1 -S git -n %{name}

%build
%if 0%{suse_version} < 1600
export CC=gcc-13
export CXX=g++-13
%endif

export CFLAGS="-O2 -g -m64 -pipe -fmessage-length=0 \
	-fstack-protector-strong -fcf-protection -fPIE -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 \
	-fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -ftrivial-auto-var-init=zero \
	-fstrict-flex-arrays=3 -fstack-clash-protection -Wformat=2 -Wtrampolines -Wimplicit-fallthrough \
	-Werror=format-security -D_GLIBCXX_ASSERTIONS -Wall -Wformat -Wconversion -Wno-error"

export LDFLAGS="-Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,-z,nodlopen -Wl,-z,noexecstack  -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -pie"

%make_build PREFIX=%{_prefix} MALLOC=libc USE_JEMALLOC=no BUILD_TLS=yes USE_SYSTEMD=no USE_WERROR=0 V=1

%check
./utils/gen-test-certs.sh
# Tests are sometimes flaky
timeout 600 ./runtest --tls || true

%install
%make_install PREFIX=%{_prefix} MALLOC=libc USE_JEMALLOC=no BUILD_TLS=yes USE_SYSTEMD=no USE_WERROR=0 V=1

%files
%{_bindir}/redict-benchmark
%{_bindir}/redict-check-aof
%{_bindir}/redict-check-rdb
%{_bindir}/redict-cli
%{_bindir}/redict-sentinel
%{_bindir}/redict-server
%dir %{_prefix}/share/redict/
%{_prefix}/share/redict/redict.conf
%{_prefix}/share/redict/sentinel.conf

%changelog
openSUSE Build Service is sponsored by