2011-11-24 11:50:39 +01:00
|
|
|
#
|
2012-03-23 14:47:13 +01:00
|
|
|
# spec file for package redis
|
|
|
|
#
|
2018-01-04 17:11:41 +01:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
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-01-28 18:49:54 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org
|
2010-02-24 23:49:48 +01: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
|
2018-01-28 18:49:54 +01:00
|
|
|
Version: 4.0.7
|
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
|
2011-11-24 11:50:39 +01:00
|
|
|
Group: Productivity/Databases/Servers
|
2018-01-28 18:49:54 +01:00
|
|
|
URL: https://redis.io
|
2017-10-09 09:56:09 +02:00
|
|
|
Source0: http://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
|
2011-11-24 11:50:39 +01:00
|
|
|
# PATCH-FIX-OPENSUSE -- openSUSE-style init script
|
2010-02-24 23:49:48 +01:00
|
|
|
Patch0: %{name}-initscript.patch
|
2017-10-09 09:34:28 +02:00
|
|
|
# PATCH-MISSING-TAG -- See https://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
2010-03-08 00:11:23 +01:00
|
|
|
Patch1: %{name}-conf.patch
|
2017-10-09 09:34:28 +02:00
|
|
|
Patch2: %{name}-enable-bactrace-on-x86-and-ia64-only.patch
|
2016-06-30 12:52:49 +02:00
|
|
|
BuildRequires: pkgconfig
|
2013-08-07 16:40:05 +02:00
|
|
|
BuildRequires: procps
|
2014-11-11 18:17:40 +01:00
|
|
|
BuildRequires: tcl
|
2018-01-04 17:11:41 +01:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
2016-06-30 12:52:49 +02:00
|
|
|
Requires: logrotate
|
|
|
|
Requires: sudo
|
2016-10-24 10:53:17 +02:00
|
|
|
Requires(pre): shadow
|
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
|
|
|
|
%setup -q
|
|
|
|
%patch0
|
2010-03-08 00:11:23 +01:00
|
|
|
%patch1
|
2013-08-08 14:51:30 +02:00
|
|
|
%patch2
|
2011-02-24 23:52:08 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%build
|
2012-07-23 20:33:34 +02:00
|
|
|
make %{?_smp_mflags} CFLAGS="%{optflags}" V=1
|
2010-02-24 23:49:48 +01:00
|
|
|
|
|
|
|
%install
|
2015-04-01 18:53:07 +02:00
|
|
|
install -m 0750 -d \
|
|
|
|
%{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
|
|
|
|
install -Dpm 0755 src/%{name}-check-aof %{buildroot}%{_bindir}/%{name}-check-aof
|
|
|
|
install -Dpm 0755 src/%{name}-check-rdb %{buildroot}%{_bindir}/%{name}-check-rdb
|
|
|
|
install -Dpm 0755 src/%{name}-trib.rb %{buildroot}%{_bindir}/%{name}-trib.rb
|
|
|
|
install -Dpm 0755 src/%{name}-server %{buildroot}%{_sbindir}/%{name}-server
|
|
|
|
ln -sfv 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
|
|
|
|
install -Dm 0640 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
|
|
|
|
install -Dm 0644 %{SOURCE4} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
|
|
|
|
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
|
|
|
|
2011-02-24 23:52:08 +01:00
|
|
|
%check
|
2012-03-23 14:47:13 +01:00
|
|
|
%ifnarch ppc ppc64
|
2011-02-24 23:52:08 +01:00
|
|
|
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
|
2016-06-30 12:52:49 +02:00
|
|
|
make %{?_smp_mflags} test && true
|
2012-03-23 14:47:13 +01:00
|
|
|
%endif
|
2011-02-24 23:52:08 +01:00
|
|
|
|
2010-05-17 16:27:43 +02:00
|
|
|
%pre
|
2016-07-30 17:21:33 +02:00
|
|
|
getent group %{name} >/dev/null || %{_sbindir}/groupadd -r %{name} || :
|
|
|
|
getent passwd %{name} >/dev/null || \
|
|
|
|
%{_sbindir}/useradd -g %{name} -s /bin/false -r \
|
2017-10-09 09:34:28 +02:00
|
|
|
-c "User for %{name} key-value store" -d %{_data_dir} %{name} || :
|
2015-04-01 18:53:07 +02:00
|
|
|
%service_add_pre %{name}.target
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%post
|
2016-06-30 12:52:49 +02:00
|
|
|
systemd-tmpfiles --create %{_prefix}/lib/tmpfiles.d/%{name}.conf || true
|
2015-04-01 18:53:07 +02:00
|
|
|
%service_add_post %{name}.target
|
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
|
2015-04-01 18:53:07 +02:00
|
|
|
%service_del_preun %{name}.target
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%postun
|
2015-04-01 18:53:07 +02:00
|
|
|
%service_del_postun %{name}.target
|
2010-03-08 00:42:36 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%files
|
2016-06-30 12:52:49 +02:00
|
|
|
%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING 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}
|
2016-06-30 12:52:49 +02:00
|
|
|
%{_prefix}/lib/tmpfiles.d/%{name}.conf
|
2015-04-01 18:53:07 +02:00
|
|
|
%{_unitdir}/%{name}@.service
|
|
|
|
%{_unitdir}/%{name}.target
|
|
|
|
%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
|