2011-11-24 11:50:39 +01:00
|
|
|
#
|
2012-03-23 14:47:13 +01:00
|
|
|
# spec file for package redis
|
|
|
|
#
|
2021-01-13 07:23:01 +01:00
|
|
|
# Copyright (c) 2021 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
|
2021-03-03 08:12:30 +01:00
|
|
|
Version: 6.0.12
|
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-01-13 07:23:01 +01:00
|
|
|
Source0: https://download.redis.io/releases/redis-%{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
|
2020-05-11 07:21:40 +02:00
|
|
|
Patch1: getMcontextEip-return-value.patch
|
2019-12-31 09:22:02 +01:00
|
|
|
Patch3: reproducible.patch
|
2020-05-02 09:44:32 +02:00
|
|
|
Patch4: ppc-atomic.patch
|
2021-02-16 16:30:52 +01:00
|
|
|
BuildRequires: libopenssl-devel
|
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
|
2010-02-24 23:49:48 +01:00
|
|
|
%setup -q
|
|
|
|
%patch0
|
2020-05-11 07:21:40 +02:00
|
|
|
%patch1 -p1
|
2019-12-31 09:22:02 +01:00
|
|
|
%patch3 -p1
|
2020-05-02 09:44:32 +02:00
|
|
|
%patch4 -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
|
2021-02-16 16:30:52 +01:00
|
|
|
%make_build CFLAGS="%{optflags}" BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes
|
2019-12-31 09:22:02 +01:00
|
|
|
%sysusers_generate_pre %{SOURCE9} redis
|
2010-02-24 23:49:48 +01:00
|
|
|
|
|
|
|
%install
|
2015-04-01 18:53:07 +02:00
|
|
|
install -m 0750 -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
|
|
|
|
2017-10-09 09:34:28 +02:00
|
|
|
install -Dpm 0755 src/%{name}-benchmark %{buildroot}%{_bindir}/%{name}-benchmark
|
|
|
|
install -Dpm 0755 src/%{name}-cli %{buildroot}%{_bindir}/%{name}-cli
|
2018-09-06 17:10:22 +02:00
|
|
|
|
2017-10-09 09:34:28 +02:00
|
|
|
install -Dpm 0755 src/%{name}-server %{buildroot}%{_sbindir}/%{name}-server
|
2018-09-06 17:10:22 +02: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
|
|
|
|
install -Dm 0640 redis.conf %{buildroot}%{_conf_dir}/default.conf.example
|
2018-09-06 21:15:00 +02:00
|
|
|
install -Dm 0660 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
|
2018-01-04 17:11:41 +01:00
|
|
|
install -Dm 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysctl.d/00-%{name}.conf
|
2017-10-09 09:34:28 +02:00
|
|
|
install -Dm 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
|
|
|
install -Dm 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.target
|
|
|
|
install -Dm 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}@.service
|
2020-03-25 08:11:31 +01:00
|
|
|
install -Dm 0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
2018-09-06 21:15:00 +02:00
|
|
|
install -Dm 0644 %{SOURCE7} %{buildroot}%{_unitdir}/%{name}-sentinel@.service
|
|
|
|
install -Dm 0644 %{SOURCE8} %{buildroot}%{_unitdir}/%{name}-sentinel.target
|
|
|
|
|
2017-10-09 09:34:28 +02:00
|
|
|
ln -sf %{_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}
|
|
|
|
install -m 644 %{SOURCE9} %{buildroot}%{_sysusersdir}/
|
|
|
|
|
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
|
|
|
|
2019-12-31 09:22:02 +01:00
|
|
|
%pre -f redis.pre
|
2018-09-07 14:35:42 +02:00
|
|
|
%service_add_pre redis.target redis@.service redis-sentinel.target redis-sentinel@.service
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%post
|
2020-03-25 08:11:31 +01:00
|
|
|
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
|
2018-09-07 14:35:42 +02:00
|
|
|
%service_add_post redis.target redis@.service redis-sentinel.target redis-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
|
2018-09-07 14:35:42 +02:00
|
|
|
%service_del_preun redis.target redis@.service redis-sentinel.target redis-sentinel@.service
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%postun
|
2018-09-07 14:35:42 +02:00
|
|
|
%service_del_postun redis.target redis@.service redis-sentinel.target redis-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
|
|
|
|
%doc 00-RELEASENOTES BUGS CONTRIBUTING README.md
|
2011-01-18 22:10:38 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
2017-10-09 09:34:28 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/sysctl.d/00-%{name}.conf
|
|
|
|
%{_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
|
2019-12-31 09:22:02 +01:00
|
|
|
%{_sysusersdir}/redis-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}
|
2010-03-08 00:11:23 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%changelog
|