2011-11-24 11:50:39 +01:00
|
|
|
#
|
2012-03-23 14:47:13 +01:00
|
|
|
# spec file for package redis
|
|
|
|
#
|
2024-01-09 14:21:34 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2010-02-24 23:49:48 +01:00
|
|
|
#
|
|
|
|
# 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.
|
2012-03-23 14:47:13 +01:00
|
|
|
|
2018-11-26 17:50:24 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-02-24 23:49:48 +01:00
|
|
|
#
|
|
|
|
|
2018-09-06 17:10:22 +02:00
|
|
|
|
2016-06-30 12:52:49 +02:00
|
|
|
%define _data_dir %{_localstatedir}/lib/%{name}
|
|
|
|
%define _log_dir %{_localstatedir}/log/%{name}
|
|
|
|
%define _conf_dir %{_sysconfdir}/%{name}
|
2010-02-24 23:49:48 +01:00
|
|
|
Name: redis
|
2024-01-09 14:21:34 +01:00
|
|
|
Version: 7.2.4
|
2011-11-24 11:50:39 +01:00
|
|
|
Release: 0
|
2011-01-18 22:10:38 +01:00
|
|
|
Summary: Persistent key-value database
|
2012-03-23 14:47:13 +01:00
|
|
|
License: BSD-3-Clause
|
2018-01-28 18:49:54 +01:00
|
|
|
URL: https://redis.io
|
2021-03-03 08:13:07 +01:00
|
|
|
Source0: https://download.redis.io/releases/%{name}-%{version}.tar.gz
|
2011-01-18 22:10:38 +01:00
|
|
|
Source1: %{name}.logrotate
|
2017-10-09 09:34:28 +02:00
|
|
|
Source2: %{name}.target
|
|
|
|
Source3: %{name}@.service
|
|
|
|
Source4: %{name}.tmpfiles.d
|
2015-04-01 18:53:07 +02:00
|
|
|
Source5: README.SUSE
|
2017-06-23 13:36:02 +02:00
|
|
|
Source6: %{name}.sysctl
|
2018-09-06 21:15:00 +02:00
|
|
|
Source7: %{name}-sentinel@.service
|
|
|
|
Source8: %{name}-sentinel.target
|
2019-12-31 09:22:02 +01:00
|
|
|
Source9: %{name}-user.conf
|
2020-09-11 11:12:35 +02:00
|
|
|
Source10: https://raw.githubusercontent.com/redis/redis-hashes/master/README#/redis.hashes
|
2017-10-09 09:34:28 +02:00
|
|
|
# PATCH-MISSING-TAG -- See https://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
2019-12-31 09:22:02 +01:00
|
|
|
Patch0: %{name}-conf.patch
|
|
|
|
Patch3: reproducible.patch
|
2020-05-02 09:44:32 +02:00
|
|
|
Patch4: ppc-atomic.patch
|
2022-05-11 08:37:08 +02:00
|
|
|
BuildRequires: jemalloc-devel
|
2021-04-20 12:04:45 +02:00
|
|
|
BuildRequires: libopenssl-devel >= 1.1.1
|
2016-06-30 12:52:49 +02:00
|
|
|
BuildRequires: pkgconfig
|
2021-02-16 16:30:52 +01:00
|
|
|
BuildRequires: procps
|
2019-12-31 09:22:02 +01:00
|
|
|
BuildRequires: sysuser-shadow
|
|
|
|
BuildRequires: sysuser-tools
|
2021-02-16 16:30:52 +01:00
|
|
|
BuildRequires: tcl
|
2020-05-04 16:42:41 +02:00
|
|
|
BuildRequires: pkgconfig(libsystemd)
|
2018-01-04 17:11:41 +01:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
2021-02-16 16:30:52 +01:00
|
|
|
# there is no tcl-tls package yet, which is said to be needed for testing tls support
|
2019-12-31 09:22:02 +01:00
|
|
|
Recommends: logrotate
|
|
|
|
%sysusers_requires
|
2011-02-24 23:52:08 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%description
|
2017-10-09 09:34:28 +02:00
|
|
|
%{name} is an advanced key-value store. It is similar to memcached but the dataset
|
2010-02-24 23:49:48 +01:00
|
|
|
is not volatile, and values can be strings, exactly like in memcached,
|
|
|
|
but also lists, sets, and ordered sets. All this data types can be manipulated
|
|
|
|
with atomic operations to push/pop elements, add/remove elements, perform server
|
|
|
|
side union, intersection, difference between sets, and so forth. Redis supports
|
|
|
|
different kind of sorting abilities.
|
|
|
|
|
|
|
|
%prep
|
2020-05-01 10:17:12 +02:00
|
|
|
echo "`grep -F %{name}-%{version}.tar.gz %{SOURCE10} | cut -d' ' -f4` %{SOURCE0}" | sha256sum -c
|
2023-08-21 10:20:31 +02:00
|
|
|
%autosetup -p1
|
2011-02-24 23:52:08 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%build
|
2018-07-24 22:21:02 +02:00
|
|
|
export HOST=OBS # for reproducible builds
|
2022-05-11 08:37:08 +02:00
|
|
|
%make_build CFLAGS="%{optflags}" \
|
|
|
|
BUILD_WITH_SYSTEMD=yes \
|
2022-07-07 19:00:57 +02:00
|
|
|
BUILD_TLS=yes
|
2021-03-03 08:13:07 +01:00
|
|
|
%sysusers_generate_pre %{SOURCE9} %{name}
|
2010-02-24 23:49:48 +01:00
|
|
|
|
|
|
|
%install
|
2021-03-03 08:13:07 +01:00
|
|
|
install -pm0750 -d \
|
2018-09-06 17:10:22 +02:00
|
|
|
%{buildroot}%{_sbindir} \
|
2015-04-01 18:53:07 +02:00
|
|
|
%{buildroot}%{_log_dir} \
|
|
|
|
%{buildroot}%{_data_dir} \
|
|
|
|
%{buildroot}%{_conf_dir} \
|
|
|
|
%{buildroot}%{_log_dir}/default \
|
|
|
|
%{buildroot}%{_data_dir}/default
|
2011-11-24 11:50:39 +01:00
|
|
|
|
2021-03-03 08:13:07 +01:00
|
|
|
install -Dpm0755 src/%{name}-benchmark %{buildroot}%{_bindir}/%{name}-benchmark
|
|
|
|
install -Dpm0755 src/%{name}-cli %{buildroot}%{_bindir}/%{name}-cli
|
2018-09-06 17:10:22 +02:00
|
|
|
|
2021-03-03 08:13:07 +01:00
|
|
|
install -Dpm0755 src/%{name}-server %{buildroot}%{_sbindir}/%{name}-server
|
2018-09-06 17:10:22 +02:00
|
|
|
|
2021-03-03 08:13:07 +01:00
|
|
|
ln -sfv ../sbin/redis-server %{buildroot}%{_bindir}/%{name}-check-aof
|
|
|
|
ln -sfv ../sbin/redis-server %{buildroot}%{_bindir}/%{name}-check-rdb
|
|
|
|
ln -sfv ../sbin/redis-server %{buildroot}%{_sbindir}/%{name}-check-aof
|
|
|
|
ln -sfv ../sbin/redis-server %{buildroot}%{_sbindir}/%{name}-check-rdb
|
|
|
|
ln -sfv ../sbin/redis-server %{buildroot}%{_sbindir}/%{name}-sentinel
|
2012-11-20 13:09:48 +01:00
|
|
|
|
2017-10-09 09:34:28 +02:00
|
|
|
perl -p -i -e 's|daemonize yes|daemonize no|g' %{name}.conf
|
2021-03-03 08:13:07 +01:00
|
|
|
install -Dpm0640 redis.conf %{buildroot}%{_conf_dir}/default.conf.example
|
|
|
|
install -Dpm0660 sentinel.conf %{buildroot}%{_conf_dir}/sentinel.conf.example
|
2011-01-18 22:10:38 +01:00
|
|
|
|
2017-06-23 13:36:02 +02:00
|
|
|
# some sysctl stuff
|
2021-05-24 09:34:37 +02:00
|
|
|
install -Dpm0644 %{SOURCE6} %{buildroot}/%{_prefix}/lib/sysctl.d/00-%{name}.conf
|
2022-06-29 19:57:26 +02:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
mkdir -p %{buildroot}%{_distconfdir}/logrotate.d
|
|
|
|
install -Dpm0644 %{SOURCE1} %{buildroot}%{_distconfdir}/logrotate.d/%{name}
|
|
|
|
%else
|
2021-03-03 08:13:07 +01:00
|
|
|
install -Dpm0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
2022-06-29 19:57:26 +02:00
|
|
|
%endif
|
2021-03-03 08:13:07 +01:00
|
|
|
install -Dpm0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.target
|
|
|
|
install -Dpm0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}@.service
|
|
|
|
install -Dpm0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
|
|
|
install -Dpm0644 %{SOURCE7} %{buildroot}%{_unitdir}/%{name}-sentinel@.service
|
|
|
|
install -Dpm0644 %{SOURCE8} %{buildroot}%{_unitdir}/%{name}-sentinel.target
|
|
|
|
|
|
|
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
2016-06-30 12:52:49 +02:00
|
|
|
cp %{SOURCE5} README.SUSE
|
2010-02-24 23:49:48 +01:00
|
|
|
|
2019-12-31 09:22:02 +01:00
|
|
|
mkdir -p %{buildroot}%{_sysusersdir}
|
2021-03-03 08:13:07 +01:00
|
|
|
install -pm0644 %{SOURCE9} %{buildroot}%{_sysusersdir}/
|
2019-12-31 09:22:02 +01:00
|
|
|
|
2011-02-24 23:52:08 +01:00
|
|
|
%check
|
|
|
|
cat <<EOF
|
|
|
|
---------------------------------------------------
|
2011-11-24 11:50:39 +01:00
|
|
|
The test suite often fails to start a server, with
|
2011-02-24 23:52:08 +01:00
|
|
|
'child process exited abnormally' -- sometimes it works.
|
|
|
|
---------------------------------------------------
|
|
|
|
EOF
|
2021-02-16 16:30:52 +01:00
|
|
|
# Variable assignments need to match in all make invocations, otherwise it might recomplie. See https://github.com/redis/redis/issues/7337
|
|
|
|
%make_build test CFLAGS="%{optflags}" BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes || true
|
2011-02-24 23:52:08 +01:00
|
|
|
|
2021-03-03 08:13:07 +01:00
|
|
|
%pre -f %{name}.pre
|
|
|
|
%service_add_pre %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service
|
2022-10-06 11:53:23 +02:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
# Prepare for migration to /usr/etc; save any old .rpmsave
|
|
|
|
for i in logrotate.d/%{name} ; do
|
|
|
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
|
|
|
|
done
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%posttrans
|
|
|
|
# Migration to /usr/etc, restore just created .rpmsave
|
|
|
|
for i in logrotate.d/%{name} ; do
|
|
|
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
|
|
|
|
done
|
|
|
|
%endif
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%post
|
2020-03-25 08:11:31 +01:00
|
|
|
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
|
2021-03-03 08:13:07 +01:00
|
|
|
%service_add_post %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service
|
2017-10-09 09:34:28 +02:00
|
|
|
echo "See %{_docdir}/%{name}/README.SUSE to continue"
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%preun
|
2021-03-03 08:13:07 +01:00
|
|
|
%service_del_preun %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%postun
|
2021-03-03 08:13:07 +01:00
|
|
|
%service_del_postun %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service
|
2010-03-08 00:42:36 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%files
|
2018-08-17 09:30:30 +02:00
|
|
|
%license COPYING
|
2022-07-12 17:53:38 +02:00
|
|
|
%doc 00-RELEASENOTES BUGS README.md
|
2022-06-29 19:57:26 +02:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%{_distconfdir}/logrotate.d/%{name}
|
|
|
|
%else
|
2011-01-18 22:10:38 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
2022-06-29 19:57:26 +02:00
|
|
|
%endif
|
2021-05-24 09:34:37 +02:00
|
|
|
%{_prefix}/lib/sysctl.d/00-%{name}.conf
|
2017-10-09 09:34:28 +02:00
|
|
|
%{_bindir}/%{name}-*
|
|
|
|
%{_sbindir}/%{name}-*
|
2011-01-18 22:10:38 +01:00
|
|
|
%{_sbindir}/rc%{name}
|
2020-03-25 08:11:31 +01:00
|
|
|
%{_tmpfilesdir}/%{name}.conf
|
2021-03-03 08:13:07 +01:00
|
|
|
%{_sysusersdir}/%{name}-user.conf
|
2015-04-01 18:53:07 +02:00
|
|
|
%{_unitdir}/%{name}@.service
|
|
|
|
%{_unitdir}/%{name}.target
|
2018-09-06 21:15:00 +02:00
|
|
|
%{_unitdir}/%{name}-sentinel@.service
|
|
|
|
%{_unitdir}/%{name}-sentinel.target
|
2015-04-01 18:53:07 +02:00
|
|
|
%doc README.SUSE
|
2017-10-09 09:34:28 +02:00
|
|
|
%config(noreplace) %attr(-,root,%{name}) %{_conf_dir}/
|
|
|
|
%dir %attr(0750,%{name},%{name}) %{_data_dir}
|
|
|
|
%dir %attr(0750,%{name},%{name}) %{_data_dir}/default
|
|
|
|
%dir %attr(0750,%{name},%{name}) %{_log_dir}
|
2024-04-30 13:51:33 +02:00
|
|
|
%ghost %dir %attr(0755,%{name},%{name}) /run/%{name}
|
2010-03-08 00:11:23 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%changelog
|