%global debug_package %{nil} %define _build_id_links none Name: valkey Version: 8.1.3 Release: 1%{?dist} Summary: A persistent key-value database # valkey: BSD-3-Clause # hiredis: BSD-3-Clause # hdrhistogram, jemalloc, lzf, linenoise: BSD-2-Clause # lua: MIT # fpconv: BSL-1.0 License: BSD-3-Clause AND BSD-2-Clause AND MIT AND BSL-1.0 URL: https://valkey.io Source0: https://github.com/valkey-io/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source3: %{name}.service Source4: %{name}.sysusers Source5: %{name}.tmpfiles Source8: macros.%{name} BuildRequires: make BuildRequires: gcc BuildRequires: pkgconfig(libsystemd) BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros BuildRequires: openssl-devel Provides: bundled(hiredis) = 1.0.3 # from deps/jemalloc/VERSION Provides: bundled(jemalloc) = 5.3.0 # from deps/lua/src/lua.h Provides: bundled(lua-libs) = 5.1.5 # from deps/linenoise/linenoise.h Provides: bundled(linenoise) = 1.0 Provides: bundled(lzf) # from deps/hdr_histogram/README.md Provides: bundled(hdr_histogram) = 0.11.0 # no version Provides: bundled(fpconv) %global valkey_modules_abi 1 %global valkey_modules_dir %{_libdir}/%{name}/modules Provides: valkey(modules_abi)%{?_isa} = %{valkey_modules_abi} ExcludeArch: %{ix86} %description Valkey is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set. In order to achieve its outstanding performance, Valkey works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log. Valkey also supports trivial-to-setup master-slave replication, with very fast non-blocking first synchronization, auto-reconnection on net split and so forth. Other features include Transactions, Pub/Sub, Lua scripting, Keys with a limited time-to-live, and configuration settings to make Valkey behave like a cache. You can use Valkey from most programming languages also. %package devel Summary: Development header for Valkey module development # Header-Only Library (https://fedoraproject.org/wiki/Packaging:Guidelines) Provides: %{name}-static = %{version}-%{release} %description devel Header file required for building loadable Valkey modules. %prep # no autosetup due to no support for multiple source extraction %setup -n %{name}-%{version} mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/jemalloc/COPYING COPYING-jemalloc mv deps/hiredis/COPYING COPYING-hiredis-BSD-3-Clause mv deps/hdr_histogram/LICENSE.txt LICENSE-hdrhistogram mv deps/hdr_histogram/COPYING.txt COPYING-hdrhistogram mv deps/fpconv/LICENSE.txt LICENSE-fpconv sed -e 's/--with-lg-quantum/--with-lg-page=12 --with-lg-quantum/' -i deps/Makefile # Module API version safety check api=`sed -n -e 's/#define VALKEYMODULE_APIVER_[0-9][0-9]* //p' src/valkeymodule.h` if test "$api" != "%{valkey_modules_abi}"; then : Error: Upstream API version is now ${api}, expecting %%{valkey_modules_abi}. : Update the valkey_modules_abi macro, the rpmmacros file, and rebuild. exit 1 fi %global make_flags DEBUG="" V="echo" PREFIX=%{buildroot}%{_prefix} BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes BUILD_RDMA=no USE_REDIS_SYMLINKS=no %build %make_build %{make_flags} %install %make_install %{make_flags} # remove sample confs rm -rf %{buildroot}%{_datadir}/%{name} # System user install -p -D -m 0644 %{S:4} %{buildroot}%{_sysusersdir}/%{name}.conf # Install tmpfiles.d file install -p -D -m 0644 %{S:5} %{buildroot}%{_tmpfilesdir}/%{name}.conf # Filesystem. install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_sharedstatedir}/%{name} install -d %{buildroot}%{_localstatedir}/log/%{name} install -d %{buildroot}%{_localstatedir}/run/%{name} install -d %{buildroot}%{valkey_modules_dir} # Install systemd unit files. mkdir -p %{buildroot}%{_unitdir} install -pm644 %{S:3} %{buildroot}%{_unitdir} # Fix non-standard-executable-perm error. chmod 755 %{buildroot}%{_bindir}/%{name}-* # Install valkey module header install -pDm644 src/%{name}module.h %{buildroot}%{_includedir}/%{name}module.h # Install rpm macros for valkey modules #mkdir -p %{buildroot}%{_rpmmacrodir} install -pDm644 %{S:8} %{buildroot}%{_rpmmacrodir}/macros.%{name} %check %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %attr(0750, valkey, root) %dir %{_sysconfdir}/%{name} %dir %{_libdir}/%{name} %dir %{valkey_modules_dir} %dir %attr(0750, valkey, valkey) %{_sharedstatedir}/%{name} %dir %attr(0750, valkey, valkey) %{_localstatedir}/log/%{name} %{_bindir}/%{name}-* %{_unitdir}/%{name}.service %dir %attr(0755, valkey, valkey) %ghost %{_localstatedir}/run/%{name} %{_sysusersdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf %files devel # main package is not required %license COPYING %{_includedir}/%{name}module.h %{_rpmmacrodir}/macros.%{name} %changelog