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: f63b54574c5211b77406001352b7de99
22 Source1: %{name}.logrotate
24 Source3: %{name}.tmpfiles
25 Patch0: %{name}.conf.patch
26 Patch1: %{name}-tcl.patch
27 Patch2: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
28 Patch3: 0002-install-redis-check-rdb-as-a-symlink-instead-of-dupl.patch
29 URL: http://www.redis.io/
30 %{?with_perftools:BuildRequires: gperftools-devel}
31 BuildRequires: jemalloc-static
32 BuildRequires: rpm >= 4.4.9-56
33 BuildRequires: rpmbuild(macros) >= 1.202
34 BuildRequires: sed >= 4.0
35 %{?with_tests:BuildRequires: tcl >= 8.5}
37 Conflicts: logrotate < 3.8.0
38 ExcludeArch: sparc sparc64 alpha
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
80 # Remove integration tests
81 %{__sed} -i -e '/ integration\/replication/d' tests/test_helper.tcl
82 %{__sed} -i -e '/ unit\/memefficiency/d' tests/test_helper.tcl
84 # randomize port number so concurrent builds doesn't break
85 port=$((21110 + ${RANDOM:-$$} % 1000))
86 sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
89 mv deps/jemalloc{,-local}
90 install -d deps/jemalloc
91 ln -s %{_libdir} deps/jemalloc/lib
92 ln -s %{_includedir} deps/jemalloc/include
95 %define specflags -std=c99 -pedantic
96 %define _make_opts CC="%{__cc}" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" OPTIMIZATION="" DEBUG="" V=1
105 rm -rf $RPM_BUILD_ROOT
106 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
107 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
108 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
109 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
110 $RPM_BUILD_ROOT%{_mandir}/man{1,5}
113 INSTALL="install -p" \
114 PREFIX=$RPM_BUILD_ROOT%{_prefix}
116 # Fix non-standard-executable-perm error
117 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
119 # Ensure redis-server location doesn't change
120 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
121 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
124 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
125 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
126 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
127 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
130 for man in man/man1/*; do
131 install $man $RPM_BUILD_ROOT%{_mandir}/man1
133 for man in man/man5/*; do
134 install $man $RPM_BUILD_ROOT%{_mandir}/man5
137 # sentinel can be symlinked
138 echo ".so man1/redis-server.1" > $RPM_BUILD_ROOT%{_mandir}/man1/redis-sentinel.1
139 echo ".so man5/redis.conf.5" > $RPM_BUILD_ROOT%{_mandir}/man5/redis-sentinel.conf.5
142 rm -rf $RPM_BUILD_ROOT
145 %groupadd -g 256 redis
146 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
149 /sbin/chkconfig --add redis
150 %service redis restart
153 if [ "$1" = 0 ]; then
155 /sbin/chkconfig --del redis
159 if [ "$1" = "0" ]; then
165 %defattr(644,root,root,755)
166 %doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md
167 %attr(755,root,root) %{_bindir}/redis-benchmark
168 %attr(755,root,root) %{_bindir}/redis-cli
169 %{_mandir}/man1/redis-benchmark.1*
170 %{_mandir}/man1/redis-cli.1*
173 %defattr(644,root,root,755)
174 %config(noreplace) %{_sysconfdir}/%{name}.conf
175 %attr(754,root,root) /etc/rc.d/init.d/%{name}
176 %attr(755,root,root) %{_sbindir}/redis-sentinel
177 %attr(755,root,root) %{_sbindir}/redis-server
178 %attr(755,root,root) %{_bindir}/redis-check-aof
179 %attr(755,root,root) %{_bindir}/redis-check-rdb
180 %config(noreplace) /etc/logrotate.d/%{name}
181 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
182 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
183 %dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name}
184 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
185 %{systemdtmpfilesdir}/%{name}.conf
186 %{_mandir}/man1/redis-sentinel.1*
187 %{_mandir}/man1/redis-server.1*
188 %{_mandir}/man1/redis-check-aof.1*
189 %{_mandir}/man1/redis-check-rdb.1*
190 %{_mandir}/man5/redis.conf.5*
191 %{_mandir}/man5/redis-sentinel.conf.5*