2 # - Check for status of man pages http://code.google.com/p/redis/issues/detail?id=202
3 # - use shared jemalloc?
6 %bcond_without tests # build without tests
7 %bcond_without perftools # google perftools
9 %ifnarch %{ix86} %{x8664} ppc
10 # available only on selected architectures
11 %undefine with_perftools
14 Summary: A persistent key-value database
19 Group: Applications/Databases
20 Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz
21 # Source0-md5: 7b6eb6e4ccc050c351df8ae83c55a035
22 Source1: %{name}.logrotate
24 Source3: %{name}.tmpfiles
25 Patch0: %{name}.conf.patch
26 Patch1: %{name}-tcl.patch
27 URL: http://www.redis.io/
28 %{?with_perftools:BuildRequires: gperftools-devel}
29 BuildRequires: jemalloc-static
30 BuildRequires: rpm >= 4.4.9-56
31 BuildRequires: rpmbuild(macros) >= 1.202
32 BuildRequires: sed >= 4.0
33 %{?with_tests:BuildRequires: tcl >= 8.5}
35 Conflicts: logrotate < 3.8.0
36 ExcludeArch: sparc sparc64 alpha
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 Redis is an advanced key-value store. It is similar to memcached but
41 the data set is not volatile, and values can be strings, exactly like
42 in memcached, but also lists, sets, and ordered sets. All this data
43 types can be manipulated with atomic operations to push/pop elements,
44 add/remove elements, perform server side union, intersection,
45 difference between sets, and so forth. Redis supports different kind
49 Summary: Persistent key-value database with network interface
50 Group: Applications/Databases
51 Requires(post,preun): /sbin/chkconfig
52 Requires(postun): /usr/sbin/groupdel
53 Requires(postun): /usr/sbin/userdel
54 Requires(pre): /bin/id
55 Requires(pre): /usr/bin/getgid
56 Requires(pre): /usr/sbin/groupadd
57 Requires(pre): /usr/sbin/useradd
59 Provides: group(redis)
63 Redis is a key-value database in a similar vein to memcache but the
64 dataset is non-volatile. Redis additionally provides native support
65 for atomically manipulating and querying data structures such as lists
68 The dataset is stored entirely in memory and periodically flushed to
76 # Remove integration tests
77 %{__sed} -i -e '/ integration\/replication/d' tests/test_helper.tcl
78 %{__sed} -i -e '/ unit\/memefficiency/d' tests/test_helper.tcl
81 mv deps/jemalloc{,-local}
82 install -d deps/jemalloc
83 ln -s %{_libdir} deps/jemalloc/lib
84 ln -s %{_includedir} deps/jemalloc/include
87 %define specflags -std=c99 -pedantic
88 %define _make_opts CC="%{__cc}" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" OPTIMIZATION="" DEBUG="" V=1
90 %{__make} -j1 -C src all
97 rm -rf $RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
99 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
100 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
101 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
104 INSTALL="install -p" \
105 PREFIX=$RPM_BUILD_ROOT%{_prefix}
107 # Fix non-standard-executable-perm error
108 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
110 # Ensure redis-server location doesn't change
111 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
112 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
115 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
116 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
117 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
118 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
121 rm -rf $RPM_BUILD_ROOT
124 %groupadd -g 256 redis
125 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
128 /sbin/chkconfig --add redis
129 %service redis restart
132 if [ "$1" = 0 ]; then
134 /sbin/chkconfig --del redis
138 if [ "$1" = "0" ]; then
144 %defattr(644,root,root,755)
145 %doc COPYING 00-RELEASENOTES BUGS README
146 %attr(755,root,root) %{_bindir}/redis-benchmark
147 %attr(755,root,root) %{_bindir}/redis-check-aof
148 %attr(755,root,root) %{_bindir}/redis-check-dump
149 %attr(755,root,root) %{_bindir}/redis-cli
152 %defattr(644,root,root,755)
153 %config(noreplace) %{_sysconfdir}/%{name}.conf
154 %attr(754,root,root) /etc/rc.d/init.d/%{name}
155 %attr(755,root,root) %{_sbindir}/redis-sentinel
156 %attr(755,root,root) %{_sbindir}/redis-server
157 %config(noreplace) /etc/logrotate.d/%{name}
158 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
159 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
160 %dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name}
161 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
162 %{systemdtmpfilesdir}/%{name}.conf