2011-02-24 23:52:08 +01:00
|
|
|
# Copyright (c) 2011 SUSE LINUX Products 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.
|
|
|
|
#
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
|
2011-01-18 22:10:38 +01:00
|
|
|
%define _home_dir %{_var}/run/%{name}
|
|
|
|
%define _data_dir %{_var}/lib/%{name}
|
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
Name: redis
|
2011-02-24 23:52:08 +01:00
|
|
|
Version: 2.2.1
|
2010-02-24 23:49:48 +01:00
|
|
|
Release: 1
|
2011-01-18 22:10:38 +01:00
|
|
|
#
|
2010-02-24 23:49:48 +01:00
|
|
|
License: BSD License
|
|
|
|
Group: Productivity/Databases/Servers
|
2011-01-18 22:10:38 +01:00
|
|
|
Summary: Persistent key-value database
|
2011-02-24 23:52:08 +01:00
|
|
|
Url: http://redis.io/
|
2011-01-18 22:10:38 +01:00
|
|
|
#
|
2010-05-17 16:14:15 +02:00
|
|
|
Source: http://redis.googlecode.com/files/%{name}-%{version}.tar.bz2
|
2011-01-18 22:10:38 +01:00
|
|
|
Source1: %{name}.logrotate
|
2011-02-24 23:52:08 +01:00
|
|
|
Source4: redis.sysconfig
|
2011-01-18 22:10:38 +01:00
|
|
|
#
|
2010-02-24 23:49:48 +01:00
|
|
|
Patch0: %{name}-initscript.patch
|
2010-03-08 00:11:23 +01:00
|
|
|
Patch1: %{name}-conf.patch
|
2011-02-24 23:52:08 +01:00
|
|
|
Patch2: %{name}-linkargsorder.patch
|
|
|
|
Patch3: skip-aof-test.patch
|
2011-01-18 22:10:38 +01:00
|
|
|
#
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-02-24 23:49:48 +01:00
|
|
|
# for init script
|
2010-03-05 13:30:26 +01:00
|
|
|
Requires: netcat
|
2011-01-18 22:10:38 +01:00
|
|
|
Requires: logrotate
|
2010-02-24 23:49:48 +01:00
|
|
|
|
2011-02-24 23:52:08 +01:00
|
|
|
# for make test
|
|
|
|
BuildRequires: tcl
|
|
|
|
|
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.
|
|
|
|
|
2010-03-08 00:11:23 +01:00
|
|
|
%package doc
|
2011-01-18 22:10:38 +01:00
|
|
|
Summary: HTML documentation for redis
|
2010-03-08 14:40:39 +01:00
|
|
|
Group: Productivity/Databases/Servers
|
2010-03-08 00:11:23 +01:00
|
|
|
Requires: redis = %{version}
|
|
|
|
|
|
|
|
%description doc
|
2011-01-18 22:10:38 +01:00
|
|
|
HTML documentation for redis database.
|
2010-03-08 00:11:23 +01:00
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
%patch0
|
2010-03-08 00:11:23 +01:00
|
|
|
%patch1
|
2011-02-24 23:52:08 +01:00
|
|
|
%patch2
|
|
|
|
|
|
|
|
# skip-aof-test.patch
|
|
|
|
# Failures: - Fixed AOF: Server should have been started: Expected '1' to equal or match '0'
|
|
|
|
%patch3 -p1
|
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
mv doc html
|
|
|
|
|
|
|
|
%build
|
2010-05-17 16:14:15 +02:00
|
|
|
make PROF="%{optflags}" %{?jobs:-j%jobs}
|
2010-02-24 23:49:48 +01:00
|
|
|
|
|
|
|
%install
|
2011-01-18 22:10:38 +01:00
|
|
|
%{__install} -Dd -m 0755 \
|
|
|
|
%{buildroot}%{_sysconfdir}/init.d \
|
|
|
|
%{buildroot}%{_sysconfdir}/logrotate.d \
|
|
|
|
%{buildroot}%{_bindir} \
|
|
|
|
%{buildroot}%{_libdir} \
|
|
|
|
%{buildroot}%{_sbindir} \
|
2011-02-24 23:52:08 +01:00
|
|
|
%{buildroot}%{_data_dir}
|
2011-01-18 22:10:38 +01:00
|
|
|
|
2011-02-24 23:52:08 +01:00
|
|
|
%{__install} -m 0755 src/redis-benchmark %{buildroot}%{_bindir}/redis-benchmark
|
|
|
|
%{__install} -m 0755 src/redis-cli %{buildroot}%{_bindir}/redis-cli
|
|
|
|
%{__install} -m 0755 src/redis-check-dump %{buildroot}%{_bindir}/redis-check-dump
|
|
|
|
%{__install} -m 0755 src/redis-check-aof %{buildroot}%{_bindir}/redis-check-aof
|
|
|
|
%{__install} -m 0755 src/redis-server %{buildroot}%{_sbindir}/redis-server
|
|
|
|
%{__install} -m 0644 redis.conf %{buildroot}%{_sysconfdir}/redis.conf
|
|
|
|
## %{__install} -Dp -m 0755 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/redis
|
2011-01-18 22:10:38 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# init
|
|
|
|
#
|
|
|
|
%{__install} -m 0755 utils/redis_init_script %{buildroot}%{_sysconfdir}/init.d/redis
|
|
|
|
%{__ln_s} %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
|
|
|
|
|
|
|
|
#
|
|
|
|
# logrotate
|
|
|
|
#
|
|
|
|
%{__install} -m 0644 %{S:1} \
|
|
|
|
%{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
2010-02-24 23:49:48 +01:00
|
|
|
|
2011-02-24 23:52:08 +01:00
|
|
|
%check
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
---------------------------------------------------
|
|
|
|
The test suite often fails to start a server, with
|
|
|
|
'child process exited abnormally' -- sometimes it works.
|
|
|
|
---------------------------------------------------
|
|
|
|
EOF
|
|
|
|
make test && true
|
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%clean
|
2011-01-18 22:10:38 +01:00
|
|
|
rm -rf %{buildroot}
|
2010-02-24 23:49:48 +01:00
|
|
|
|
2010-05-17 16:27:43 +02:00
|
|
|
%pre
|
|
|
|
/usr/sbin/groupadd -r %{name} &>/dev/null || :
|
2011-01-18 22:10:38 +01:00
|
|
|
/usr/sbin/useradd -o -g %{name} -s /bin/false -r -c "User for Redis key-value store" -d %{_home_dir} %{name} &>/dev/null || :
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
%fillup_and_insserv %{name}
|
|
|
|
%restart_on_update %{name}
|
2011-02-24 23:52:08 +01:00
|
|
|
echo "To start the database server, do:"
|
|
|
|
echo " sudo rcredis start; insserv redis"
|
2010-03-08 00:42:36 +01:00
|
|
|
|
|
|
|
%preun
|
|
|
|
%stop_on_removal %{name}
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%insserv_cleanup
|
|
|
|
|
2010-02-24 23:49:48 +01:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2011-02-24 23:52:08 +01:00
|
|
|
%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING Changelog README TODO
|
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}
|
2010-05-17 16:15:23 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/init.d/redis
|
2010-05-17 16:27:43 +02:00
|
|
|
%config(noreplace) %attr(0640, %{name}, %{name}) %{_sysconfdir}/redis.conf
|
2011-01-18 22:10:38 +01:00
|
|
|
%dir %attr(0750, %{name}, %{name}) %{_data_dir}
|
2010-03-08 00:11:23 +01:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc html/
|
2010-02-24 23:49:48 +01:00
|
|
|
|
|
|
|
%changelog
|