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: e62d3793f86a6a0021609c9f905cb960
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
80 # randomize port number so concurrent builds doesn't break
81 port=$((21110 + ${RANDOM:-$$} % 1000))
82 sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
85 mv deps/jemalloc{,-local}
86 install -d deps/jemalloc
87 ln -s %{_libdir} deps/jemalloc/lib
88 ln -s %{_includedir} deps/jemalloc/include
91 %define specflags -std=c99 -pedantic
92 %define _make_opts CC="%{__cc}" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" OPTIMIZATION="" DEBUG="" V=1
101 rm -rf $RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
103 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
104 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
105 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
108 INSTALL="install -p" \
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
116 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
119 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
120 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
121 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
122 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{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 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md
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-rdb
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-sentinel
160 %attr(755,root,root) %{_sbindir}/redis-server
161 %config(noreplace) /etc/logrotate.d/%{name}
162 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
163 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
164 %dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name}
165 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
166 %{systemdtmpfilesdir}/%{name}.conf