2 # - Check for status of man pages http://code.google.com/p/redis/issues/detail?id=202
5 %bcond_without tests # build without tests
6 %bcond_without perftools # google perftools
7 %bcond_without systemd # systemd support
8 %bcond_without system_jemalloc # use embedded jemalloc
10 %ifnarch %{ix86} %{x8664} ppc
11 # available only on selected architectures
12 %undefine with_perftools
15 Summary: A persistent key-value database
20 Group: Applications/Databases
21 Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz
22 # Source0-md5: 63ed5185723511200f7c0e2a811730dc
23 Source1: %{name}.logrotate
25 Source3: %{name}.tmpfiles
26 Source4: %{name}.service
27 Source5: %{name}.sysconfig
28 Patch0: %{name}.conf.patch
29 Patch1: %{name}-tcl.patch
30 Patch2: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
31 Patch3: arm-arch-check.patch
32 Patch4: system-jemalloc.patch
33 URL: http://www.redis.io/
34 %{?with_perftools:BuildRequires: gperftools-devel}
36 BuildRequires: jemalloc-devel
39 BuildRequires: libatomic-devel
41 BuildRequires: openssl-devel
42 BuildRequires: pkgconfig
43 BuildRequires: rpm >= 4.4.9-56
44 BuildRequires: rpmbuild(macros) >= 2.011
45 BuildRequires: sed >= 4.0
46 %{?with_systemd:BuildRequires: systemd-devel}
47 %{?with_tests:BuildRequires: tcl >= 8.5}
49 Conflicts: logrotate < 3.8.0
50 ExcludeArch: sparc sparc64 alpha
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 Redis is an advanced key-value store. It is similar to memcached but
55 the data set is not volatile, and values can be strings, exactly like
56 in memcached, but also lists, sets, and ordered sets. All this data
57 types can be manipulated with atomic operations to push/pop elements,
58 add/remove elements, perform server side union, intersection,
59 difference between sets, and so forth. Redis supports different kind
63 Summary: Persistent key-value database with network interface
64 Group: Applications/Databases
65 Requires(post,preun): /sbin/chkconfig
66 Requires(postun): /usr/sbin/groupdel
67 Requires(postun): /usr/sbin/userdel
68 Requires(pre): /bin/id
69 Requires(pre): /usr/bin/getgid
70 Requires(pre): /usr/sbin/groupadd
71 Requires(pre): /usr/sbin/useradd
73 Provides: group(redis)
77 Redis is a key-value database in a similar vein to memcache but the
78 dataset is non-volatile. Redis additionally provides native support
79 for atomically manipulating and querying data structures such as lists
82 The dataset is stored entirely in memory and periodically flushed to
93 # Remove integration tests
94 %{__sed} -i -e '/ integration\/replication/d' tests/test_helper.tcl
95 %{__sed} -i -e '/ unit\/memefficiency/d' tests/test_helper.tcl
97 # randomize port number so concurrent builds doesn't break
98 port=$((21110 + ${RANDOM:-$$} % 1000))
99 sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
101 %{__rm} -r deps/jemalloc
104 %define specflags -std=c99 -pedantic
105 %define _make_opts \\\
107 CFLAGS="%{rpmcflags}" \\\
108 LDFLAGS="%{rpmldflags}" \\\
112 USE_SYSTEMD=%{?with_systemd:yes}%{!?with_systemd:no} \\\
114 uname_M=%{_target_cpu}
123 rm -rf $RPM_BUILD_ROOT
124 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/sysconfig,%{_sbindir}} \
125 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
126 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
127 $RPM_BUILD_ROOT%{systemdtmpfilesdir} $RPM_BUILD_ROOT%{systemdunitdir} \
128 $RPM_BUILD_ROOT%{_mandir}/man{1,5}
131 INSTALL="install -p" \
132 PREFIX=$RPM_BUILD_ROOT%{_prefix}
134 # Fix non-standard-executable-perm error
135 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
137 # Ensure redis-server location doesn't change
138 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
139 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
142 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
143 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
144 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
145 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
146 %{?with_systemd:%{__sed} -e 's;@sbindir@;%{_sbindir};' -e 's;@localstatedir@;%{_localstatedir};' %{SOURCE4} > $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service}
147 %{__sed} -e 's;@sysconfdir@;%{_sysconfdir};' %{SOURCE5} > $RPM_BUILD_ROOT/etc/sysconfig/%{name}
150 for man in man/man1/*; do
151 install $man $RPM_BUILD_ROOT%{_mandir}/man1
153 for man in man/man5/*; do
154 install $man $RPM_BUILD_ROOT%{_mandir}/man5
157 # sentinel can be symlinked
158 echo ".so man1/redis-server.1" > $RPM_BUILD_ROOT%{_mandir}/man1/redis-sentinel.1
159 echo ".so man5/redis.conf.5" > $RPM_BUILD_ROOT%{_mandir}/man5/redis-sentinel.conf.5
162 rm -rf $RPM_BUILD_ROOT
165 %groupadd -g 256 redis
166 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
169 /sbin/chkconfig --add redis
170 %service redis restart
171 %{?with_systemd:%systemd_post %{name}.service}
174 if [ "$1" = 0 ]; then
176 /sbin/chkconfig --del redis
180 if [ "$1" = "0" ]; then
184 %{?with_systemd:%systemd_reload}
186 %triggerpostun server -- redis-server < 6.2.5-2
187 %{?with_systemd?%systemd_trigger %{name}.service}
190 %defattr(644,root,root,755)
191 %doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md
192 %attr(755,root,root) %{_bindir}/redis-benchmark
193 %attr(755,root,root) %{_bindir}/redis-cli
194 %{_mandir}/man1/redis-benchmark.1*
195 %{_mandir}/man1/redis-cli.1*
198 %defattr(644,root,root,755)
199 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
200 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
201 %attr(754,root,root) /etc/rc.d/init.d/%{name}
202 %attr(755,root,root) %{_sbindir}/redis-sentinel
203 %attr(755,root,root) %{_sbindir}/redis-server
204 %attr(755,root,root) %{_bindir}/redis-check-aof
205 %attr(755,root,root) %{_bindir}/redis-check-rdb
206 %config(noreplace) /etc/logrotate.d/%{name}
207 %dir %attr(750,redis,redis) %{_localstatedir}/lib/%{name}
208 %dir %attr(750,redis,redis) %{_localstatedir}/log/%{name}
209 %dir %attr(750,redis,redis) %{_localstatedir}/log/archive/%{name}
210 %dir %attr(750,redis,redis) %{_localstatedir}/run/%{name}
211 %{systemdtmpfilesdir}/%{name}.conf
212 %{?with_systemd:%{systemdunitdir}/%{name}.service}
213 %{_mandir}/man1/redis-sentinel.1*
214 %{_mandir}/man1/redis-server.1*
215 %{_mandir}/man1/redis-check-aof.1*
216 %{_mandir}/man1/redis-check-rdb.1*
217 %{_mandir}/man5/redis.conf.5*
218 %{_mandir}/man5/redis-sentinel.conf.5*