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 Source3: %{name}.tmpfiles
31 Patch0: %{name}.conf.patch
32 %{?with_perftools:BuildRequires: google-perftools-devel}
33 BuildRequires: jemalloc-static
34 BuildRequires: rpm >= 4.4.9-56
35 BuildRequires: rpmbuild(macros) >= 1.202
36 BuildRequires: sed >= 4.0
37 %{?with_tests:BuildRequires: tcl >= 8.5}
38 Conflicts: logrotate < 3.8.0
39 ExcludeArch: sparc sparc64 alpha
40 Obsoletes: %{name}-doc
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 Redis is an advanced key-value store. It is similar to memcached but
45 the data set is not volatile, and values can be strings, exactly like
46 in memcached, but also lists, sets, and ordered sets. All this data
47 types can be manipulated with atomic operations to push/pop elements,
48 add/remove elements, perform server side union, intersection,
49 difference between sets, and so forth. Redis supports different kind
53 Summary: Persistent key-value database with network interface
54 Group: Applications/Databases
55 Requires(post,preun): /sbin/chkconfig
56 Requires(postun): /usr/sbin/groupdel
57 Requires(postun): /usr/sbin/userdel
58 Requires(pre): /bin/id
59 Requires(pre): /usr/bin/getgid
60 Requires(pre): /usr/sbin/groupadd
61 Requires(pre): /usr/sbin/useradd
63 Provides: group(redis)
67 Redis is a key-value database in a similar vein to memcache but the
68 dataset is non-volatile. Redis additionally provides native support
69 for atomically manipulating and querying data structures such as lists
72 The dataset is stored entirely in memory and periodically flushed to
78 # Remove integration tests
79 %{__sed} -i -e '/ execute_tests "integration\/replication"/d' tests/test_helper.tcl
80 %{__sed} -i -e '/ execute_tests "integration\/aof"/d' tests/test_helper.tcl
82 # use unversioned tclsh
83 %{__sed} -i -e 's,tclsh8.5,tclsh', ./runtest tests/test_helper.tcl
86 mv deps/jemalloc{,-local}
87 install -d deps/jemalloc
88 ln -s %{_libdir} deps/jemalloc/lib
89 ln -s %{_includedir} deps/jemalloc/include
94 CFLAGS="%{rpmcflags} -std=c99" \
98 tclsh tests/test_helper.tcl
102 rm -rf $RPM_BUILD_ROOT
103 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
104 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
105 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
106 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
109 PREFIX=$RPM_BUILD_ROOT%{_prefix}
111 # Fix non-standard-executable-perm error
112 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
114 # Ensure redis-server location doesn't change
115 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
118 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
119 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
120 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
122 install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
125 rm -rf $RPM_BUILD_ROOT
128 %groupadd -g 256 redis
129 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
132 /sbin/chkconfig --add redis
133 %service redis restart
136 if [ "$1" = 0 ]; then
138 /sbin/chkconfig --del redis
142 if [ "$1" = "0" ]; then
148 %defattr(644,root,root,755)
149 %doc COPYING 00-RELEASENOTES BUGS Changelog README TODO
150 %attr(755,root,root) %{_bindir}/redis-benchmark
151 %attr(755,root,root) %{_bindir}/redis-check-aof
152 %attr(755,root,root) %{_bindir}/redis-check-dump
153 %attr(755,root,root) %{_bindir}/redis-cli
156 %defattr(644,root,root,755)
157 %config(noreplace) %{_sysconfdir}/%{name}.conf
158 %attr(754,root,root) /etc/rc.d/init.d/%{name}
159 %attr(755,root,root) %{_sbindir}/redis-server
160 %config(noreplace) /etc/logrotate.d/%{name}
161 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
162 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
163 %dir %{_localstatedir}/log/archive/%{name}
164 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
165 /usr/lib/tmpfiles.d/%{name}.conf