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: db8a2b45eafbf1ead4353044fb70f581
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 URL: http://www.redis.io/
29 %{?with_perftools:BuildRequires: gperftools-devel}
30 BuildRequires: jemalloc-static
32 BuildRequires: libatomic-devel
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}
39 Conflicts: logrotate < 3.8.0
40 ExcludeArch: sparc sparc64 alpha
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
81 # Remove integration tests
82 %{__sed} -i -e '/ integration\/replication/d' tests/test_helper.tcl
83 %{__sed} -i -e '/ unit\/memefficiency/d' tests/test_helper.tcl
85 # randomize port number so concurrent builds doesn't break
86 port=$((21110 + ${RANDOM:-$$} % 1000))
87 sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
90 mv deps/jemalloc{,-local}
91 install -d deps/jemalloc
92 ln -s %{_libdir} deps/jemalloc/lib
93 ln -s %{_includedir} deps/jemalloc/include
96 %define specflags -std=c99 -pedantic
97 %define _make_opts CC="%{__cc}" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" OPTIMIZATION="" DEBUG="" V=1 uname_M=%{_target_cpu}
106 rm -rf $RPM_BUILD_ROOT
107 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
108 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
109 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
110 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
111 $RPM_BUILD_ROOT%{_mandir}/man{1,5}
114 INSTALL="install -p" \
115 PREFIX=$RPM_BUILD_ROOT%{_prefix}
117 # Fix non-standard-executable-perm error
118 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
120 # Ensure redis-server location doesn't change
121 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
122 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
125 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
126 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
127 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
128 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
131 for man in man/man1/*; do
132 install $man $RPM_BUILD_ROOT%{_mandir}/man1
134 for man in man/man5/*; do
135 install $man $RPM_BUILD_ROOT%{_mandir}/man5
138 # sentinel can be symlinked
139 echo ".so man1/redis-server.1" > $RPM_BUILD_ROOT%{_mandir}/man1/redis-sentinel.1
140 echo ".so man5/redis.conf.5" > $RPM_BUILD_ROOT%{_mandir}/man5/redis-sentinel.conf.5
143 rm -rf $RPM_BUILD_ROOT
146 %groupadd -g 256 redis
147 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
150 /sbin/chkconfig --add redis
151 %service redis restart
154 if [ "$1" = 0 ]; then
156 /sbin/chkconfig --del redis
160 if [ "$1" = "0" ]; then
166 %defattr(644,root,root,755)
167 %doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md
168 %attr(755,root,root) %{_bindir}/redis-benchmark
169 %attr(755,root,root) %{_bindir}/redis-cli
170 %{_mandir}/man1/redis-benchmark.1*
171 %{_mandir}/man1/redis-cli.1*
174 %defattr(644,root,root,755)
175 %config(noreplace) %{_sysconfdir}/%{name}.conf
176 %attr(754,root,root) /etc/rc.d/init.d/%{name}
177 %attr(755,root,root) %{_sbindir}/redis-sentinel
178 %attr(755,root,root) %{_sbindir}/redis-server
179 %attr(755,root,root) %{_bindir}/redis-check-aof
180 %attr(755,root,root) %{_bindir}/redis-check-rdb
181 %config(noreplace) /etc/logrotate.d/%{name}
182 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
183 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
184 %dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name}
185 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
186 %{systemdtmpfilesdir}/%{name}.conf
187 %{_mandir}/man1/redis-sentinel.1*
188 %{_mandir}/man1/redis-server.1*
189 %{_mandir}/man1/redis-check-aof.1*
190 %{_mandir}/man1/redis-check-rdb.1*
191 %{_mandir}/man5/redis.conf.5*
192 %{_mandir}/man5/redis-sentinel.conf.5*