2011-11-24 11:50:39 +01:00
|
|
|
#
|
2012-03-23 14:47:13 +01:00
|
|
|
# spec file for package redis
|
|
|
|
#
|
2016-02-17 15:30:43 +01:00
|
|
|
# Copyright (c) 2016 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
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2015-05-17 03:44: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}
|
2015-04-01 18:53:07 +02:00
|
|
|
%if 0%{?suse_version} > 1230
|
|
|
|
%bcond_without systemd
|
|
|
|
%else
|
|
|
|
%bcond_with systemd
|
|
|
|
%endif
|
2010-02-24 23:49:48 +01:00
|
|
|
Name: redis
|
2016-08-06 08:39:53 +02:00
|
|
|
Version: 3.2.3
|
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
|
2012-03-23 14:47:13 +01:00
|
|
|
Url: http://redis.io/
|
2014-07-25 17:14:08 +02:00
|
|
|
Source: http://download.redis.io/releases/redis-%{version}.tar.gz
|
2011-01-18 22:10:38 +01:00
|
|
|
Source1: %{name}.logrotate
|
2015-04-01 18:53:07 +02:00
|
|
|
Source2: redis.target
|
|
|
|
Source3: redis@.service
|
|
|
|
Source4: redis.tmpfiles.d
|
|
|
|
Source5: README.SUSE
|
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
|
2011-11-24 11:50:39 +01:00
|
|
|
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
2010-03-08 00:11:23 +01:00
|
|
|
Patch1: %{name}-conf.patch
|
2016-06-30 12:52:49 +02:00
|
|
|
Patch2: redis-enable-bactrace-on-x86-and-ia64-only.patch
|
|
|
|
BuildRequires: pkgconfig
|
2013-08-07 16:40:05 +02:00
|
|
|
BuildRequires: procps
|
2014-11-11 18:17:40 +01:00
|
|
|
BuildRequires: tcl
|
2016-07-30 17:21:33 +02:00
|
|
|
Requires(pre): shadow
|
2016-06-30 12:52:49 +02:00
|
|
|
Requires: logrotate
|
|
|
|
Requires: sudo
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2015-04-01 18:53:07 +02:00
|
|
|
%if %{with systemd}
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
%{?systemd_requires}
|
|
|
|
%else
|
2016-06-30 12:52:49 +02:00
|
|
|
# FIXME: use proper Requires(pre/post/preun/...)
|
|
|
|
PreReq: %insserv_prereq %fillup_prereq
|
2015-04-01 18:53:07 +02:00
|
|
|
%endif
|
2011-02-24 23:52:08 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%description
|
|
|
|
Redis is an advanced key-value store. It is similar to memcached but the dataset
|
|
|
|
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
|
|
|
|
|
|
|
install -D -m 0755 src/redis-benchmark %{buildroot}%{_bindir}/redis-benchmark
|
2015-04-01 18:53:07 +02:00
|
|
|
install -m 0755 src/redis-cli %{buildroot}%{_bindir}/redis-cli
|
|
|
|
install -m 0755 src/redis-check-aof %{buildroot}%{_bindir}/redis-check-aof
|
2016-06-30 12:52:49 +02:00
|
|
|
install -m 0755 src/redis-check-rdb %{buildroot}%{_bindir}/redis-check-rdb
|
|
|
|
install -m 0755 src/redis-trib.rb %{buildroot}%{_bindir}/redis-trib.rb
|
2011-11-24 11:50:39 +01:00
|
|
|
install -D -m 0755 src/redis-server %{buildroot}%{_sbindir}/redis-server
|
2015-09-25 10:39:38 +02:00
|
|
|
ln -sfv redis-server %{buildroot}%{_sbindir}/redis-sentinel
|
2012-11-20 13:09:48 +01:00
|
|
|
|
2015-04-01 18:53:07 +02:00
|
|
|
%if %{with systemd}
|
|
|
|
perl -p -i -e 's|daemonize yes|daemonize no|g' redis.conf
|
|
|
|
%endif
|
2012-11-20 13:09:48 +01:00
|
|
|
install -D -m 0640 redis.conf %{buildroot}%{_conf_dir}/default.conf.example
|
2015-09-25 10:39:38 +02:00
|
|
|
install -D -m 0640 sentinel.conf %{buildroot}%{_conf_dir}/sentinel.conf.example
|
2011-01-18 22:10:38 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# init
|
|
|
|
#
|
2015-04-01 18:53:07 +02:00
|
|
|
%if %{with systemd}
|
2016-06-30 12:52:49 +02:00
|
|
|
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/redis.target
|
|
|
|
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/redis@.service
|
|
|
|
install -D -m 0644 %{SOURCE4} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
|
|
|
|
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
|
|
|
cp %{SOURCE5} README.SUSE
|
2015-04-01 18:53:07 +02:00
|
|
|
%else
|
2011-11-24 11:50:39 +01:00
|
|
|
install -D -m 0755 utils/redis_init_script %{buildroot}%{_sysconfdir}/init.d/redis
|
|
|
|
ln -s %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
|
2015-04-01 18:53:07 +02:00
|
|
|
%endif
|
2011-01-18 22:10:38 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# logrotate
|
|
|
|
#
|
2011-11-24 11:50:39 +01:00
|
|
|
install -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
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 \
|
|
|
|
-c "User for Redis key-value store" -d %{_data_dir} %{name} || :
|
2015-04-01 18:53:07 +02:00
|
|
|
%if %{with systemd}
|
|
|
|
%service_add_pre %{name}.target
|
|
|
|
%endif
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%post
|
2015-04-01 18:53:07 +02:00
|
|
|
%if %{with systemd}
|
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
|
2016-06-30 12:52:49 +02:00
|
|
|
echo "See %{_docdir}/redis/README.SUSE to continue"
|
2015-04-01 18:53:07 +02:00
|
|
|
%else
|
2012-11-20 13:09:48 +01:00
|
|
|
echo "To start the database server, create your configuration"
|
2016-06-30 12:52:49 +02:00
|
|
|
echo "starting from %{_sysconfdir}/redis/default.conf.example, place it"
|
|
|
|
echo "in %{_sysconfdir}/redis and do: "
|
2013-01-22 12:17:07 +01:00
|
|
|
echo " sudo rcredis start; sudo chkconfig redis on"
|
2015-04-01 18:53:07 +02:00
|
|
|
%endif
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%preun
|
2015-04-01 18:53:07 +02:00
|
|
|
%if %{with systemd}
|
|
|
|
%service_del_preun %{name}.target
|
|
|
|
%else
|
2010-03-08 00:42:36 +01:00
|
|
|
%stop_on_removal %{name}
|
2015-04-01 18:53:07 +02:00
|
|
|
%endif
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%postun
|
2015-04-01 18:53:07 +02:00
|
|
|
%if %{with systemd}
|
|
|
|
%service_del_postun %{name}.target
|
|
|
|
%else
|
|
|
|
%restart_on_update %{name}
|
2010-03-08 00:42:36 +01:00
|
|
|
%insserv_cleanup
|
2015-04-01 18:53:07 +02:00
|
|
|
%endif
|
2010-03-08 00:42:36 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%files
|
2011-11-24 11:50:39 +01:00
|
|
|
%defattr(-,root,root,-)
|
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}
|
2011-02-24 23:52:08 +01:00
|
|
|
%{_bindir}/redis-*
|
|
|
|
%{_sbindir}/redis-*
|
2011-01-18 22:10:38 +01:00
|
|
|
%{_sbindir}/rc%{name}
|
2015-04-01 18:53:07 +02:00
|
|
|
%if %{with systemd}
|
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
|
|
|
|
%else
|
|
|
|
%config(noreplace) %{_sysconfdir}/init.d/%{name}
|
|
|
|
%endif
|
|
|
|
%config(noreplace) %attr(-, root, %{name}) %{_conf_dir}/
|
|
|
|
#
|
2011-01-18 22:10:38 +01:00
|
|
|
%dir %attr(0750, %{name}, %{name}) %{_data_dir}
|
2012-11-20 13:09:48 +01:00
|
|
|
%dir %attr(0750, %{name}, %{name}) %{_data_dir}/default
|
2011-04-15 20:35:16 +02:00
|
|
|
%dir %attr(0750, %{name}, %{name}) %{_log_dir}
|
2010-03-08 00:11:23 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%changelog
|