2 # - Check for status of man pages http://code.google.com/p/redis/issues/detail?id=202
3 # - use shared jemalloc?
6 %if "%{pld_release}" == "ac"
7 %bcond_with tests # build without tests
8 %bcond_with perftools # google perftools
10 %bcond_without tests # build without tests
11 %bcond_without perftools # google perftools
14 %ifnarch %{ix86} %{x8664} ppc
15 # available only on selected architectures
16 %undefine with_perftools
19 Summary: A persistent key-value database
24 Group: Applications/Databases
25 URL: http://www.redis.io/
26 Source0: http://redis.googlecode.com/files/%{name}-%{version}.tar.gz
27 # Source0-md5: c4b0b5e4953a11a503cb54cf6b09670e
28 Source1: %{name}.logrotate
30 Patch0: %{name}.conf.patch
31 %{?with_perftools:BuildRequires: google-perftools-devel}
32 BuildRequires: jemalloc-static
33 BuildRequires: rpm >= 4.4.9-56
34 BuildRequires: rpmbuild(macros) >= 1.202
35 BuildRequires: sed >= 4.0
36 %{?with_tests:BuildRequires: tcl >= 8.5}
37 ExcludeArch: sparc sparc64 alpha
38 Obsoletes: %{name}-doc
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 Redis is an advanced key-value store. It is similar to memcached but
43 the data set is not volatile, and values can be strings, exactly like
44 in memcached, but also lists, sets, and ordered sets. All this data
45 types can be manipulated with atomic operations to push/pop elements,
46 add/remove elements, perform server side union, intersection,
47 difference between sets, and so forth. Redis supports different kind
51 Summary: Persistent key-value database with network interface
52 Group: Applications/Databases
53 Requires(post,preun): /sbin/chkconfig
54 Requires(postun): /usr/sbin/groupdel
55 Requires(postun): /usr/sbin/userdel
56 Requires(pre): /bin/id
57 Requires(pre): /usr/bin/getgid
58 Requires(pre): /usr/sbin/groupadd
59 Requires(pre): /usr/sbin/useradd
61 Provides: group(redis)
65 Redis is a key-value database in a similar vein to memcache but the
66 dataset is non-volatile. Redis additionally provides native support
67 for atomically manipulating and querying data structures such as lists
70 The dataset is stored entirely in memory and periodically flushed to
76 # Remove integration tests
77 %{__sed} -i -e '/ execute_tests "integration\/replication"/d' tests/test_helper.tcl
78 %{__sed} -i -e '/ execute_tests "integration\/aof"/d' tests/test_helper.tcl
80 # use unversioned tclsh
81 %{__sed} -i -e 's,tclsh8.5,tclsh', ./runtest tests/test_helper.tcl
84 mv deps/jemalloc{,-local}
85 install -d deps/jemalloc
86 ln -s %{_libdir} deps/jemalloc/lib
87 ln -s %{_includedir} deps/jemalloc/include
92 CFLAGS="%{rpmcflags} -std=c99" \
96 tclsh tests/test_helper.tcl
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT%{_sysconfdir}
103 PREFIX=$RPM_BUILD_ROOT%{_prefix}
105 # Fix non-standard-executable-perm error
106 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
108 # Ensure redis-server location doesn't change
109 install -d $RPM_BUILD_ROOT%{_sbindir}
110 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
113 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d}
114 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
115 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
116 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
117 install -d $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}}
120 rm -rf $RPM_BUILD_ROOT
123 %groupadd -g 256 redis
124 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
127 /sbin/chkconfig --add redis
128 %service redis restart
131 if [ "$1" = 0 ]; then
133 /sbin/chkconfig --del redis
137 if [ "$1" = "0" ]; then
143 %defattr(644,root,root,755)
144 %doc COPYING 00-RELEASENOTES BUGS Changelog README TODO
145 %attr(755,root,root) %{_bindir}/redis-benchmark
146 %attr(755,root,root) %{_bindir}/redis-check-aof
147 %attr(755,root,root) %{_bindir}/redis-check-dump
148 %attr(755,root,root) %{_bindir}/redis-cli
151 %defattr(644,root,root,755)
152 %config(noreplace) %{_sysconfdir}/%{name}.conf
153 %attr(754,root,root) /etc/rc.d/init.d/%{name}
154 %attr(755,root,root) %{_sbindir}/redis-server
155 %config(noreplace) /etc/logrotate.d/%{name}
156 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
157 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
158 %dir %{_localstatedir}/log/archive/%{name}
159 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}