]>
Commit | Line | Data |
---|---|---|
9702f891 | 1 | # TODO |
9702f891 ER |
2 | # - Check for status of man pages http://code.google.com/p/redis/issues/detail?id=202 |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_without tests # build without tests | |
09689a83 | 6 | %bcond_without perftools # google perftools |
7672de0d | 7 | %bcond_without systemd # systemd support |
157344ba | 8 | %bcond_without system_jemalloc # use embedded jemalloc |
09689a83 ER |
9 | |
10 | %ifnarch %{ix86} %{x8664} ppc | |
11 | # available only on selected architectures | |
12 | %undefine with_perftools | |
a5485691 | 13 | %endif |
9702f891 ER |
14 | |
15 | Summary: A persistent key-value database | |
16 | Name: redis | |
e264e5f1 | 17 | Version: 6.2.5 |
e8c09b65 | 18 | Release: 1 |
9702f891 ER |
19 | License: BSD |
20 | Group: Applications/Databases | |
190145c5 | 21 | Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz |
e264e5f1 | 22 | # Source0-md5: db8a2b45eafbf1ead4353044fb70f581 |
9702f891 ER |
23 | Source1: %{name}.logrotate |
24 | Source2: %{name}.init | |
1eb17a34 | 25 | Source3: %{name}.tmpfiles |
0315028e | 26 | Source4: %{name}.service |
12dbec18 | 27 | Patch0: %{name}.conf.patch |
8a8bf4c5 | 28 | Patch1: %{name}-tcl.patch |
e7e3392b | 29 | Patch2: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch |
34f87d6a | 30 | Patch3: arm-arch-check.patch |
157344ba | 31 | Patch4: system-jemalloc.patch |
ad526ad6 | 32 | URL: http://www.redis.io/ |
190145c5 | 33 | %{?with_perftools:BuildRequires: gperftools-devel} |
cd613153 | 34 | %ifnarch %{arm} |
157344ba | 35 | BuildRequires: jemalloc-devel |
cd613153 | 36 | %endif |
63ba1b73 JP |
37 | %ifarch %{arm} |
38 | BuildRequires: libatomic-devel | |
39 | %endif | |
7672de0d JP |
40 | BuildRequires: openssl-devel |
41 | BuildRequires: pkgconfig | |
12dbec18 | 42 | BuildRequires: rpm >= 4.4.9-56 |
0315028e | 43 | BuildRequires: rpmbuild(macros) >= 2.011 |
9702f891 | 44 | BuildRequires: sed >= 4.0 |
7672de0d | 45 | %{?with_systemd:BuildRequires: systemd-devel} |
a5485691 | 46 | %{?with_tests:BuildRequires: tcl >= 8.5} |
58882d01 | 47 | Obsoletes: redis-doc |
84e4e437 | 48 | Conflicts: logrotate < 3.8.0 |
a1bbaa95 | 49 | ExcludeArch: sparc sparc64 alpha |
9702f891 ER |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
52 | %description | |
53 | Redis is an advanced key-value store. It is similar to memcached but | |
54 | the data set is not volatile, and values can be strings, exactly like | |
55 | in memcached, but also lists, sets, and ordered sets. All this data | |
56 | types can be manipulated with atomic operations to push/pop elements, | |
57 | add/remove elements, perform server side union, intersection, | |
58 | difference between sets, and so forth. Redis supports different kind | |
59 | of sorting abilities. | |
60 | ||
12dbec18 ER |
61 | %package server |
62 | Summary: Persistent key-value database with network interface | |
63 | Group: Applications/Databases | |
64 | Requires(post,preun): /sbin/chkconfig | |
65 | Requires(postun): /usr/sbin/groupdel | |
66 | Requires(postun): /usr/sbin/userdel | |
67 | Requires(pre): /bin/id | |
68 | Requires(pre): /usr/bin/getgid | |
69 | Requires(pre): /usr/sbin/groupadd | |
70 | Requires(pre): /usr/sbin/useradd | |
71 | Requires: rc-scripts | |
72 | Provides: group(redis) | |
73 | Provides: user(redis) | |
74 | ||
75 | %description server | |
76 | Redis is a key-value database in a similar vein to memcache but the | |
77 | dataset is non-volatile. Redis additionally provides native support | |
78 | for atomically manipulating and querying data structures such as lists | |
79 | and sets. | |
80 | ||
81 | The dataset is stored entirely in memory and periodically flushed to | |
82 | disk. | |
83 | ||
9702f891 ER |
84 | %prep |
85 | %setup -q | |
86 | %patch0 -p1 | |
8a8bf4c5 | 87 | %patch1 -p1 |
e7e3392b | 88 | %patch2 -p1 |
34f87d6a | 89 | %patch3 -p1 |
157344ba | 90 | %patch4 -p1 |
9702f891 | 91 | |
190145c5 JR |
92 | # Remove integration tests |
93 | %{__sed} -i -e '/ integration\/replication/d' tests/test_helper.tcl | |
94 | %{__sed} -i -e '/ unit\/memefficiency/d' tests/test_helper.tcl | |
3f86b561 | 95 | |
f3aa83eb | 96 | # randomize port number so concurrent builds doesn't break |
fc0d370a | 97 | port=$((21110 + ${RANDOM:-$$} % 1000)) |
f3aa83eb ER |
98 | sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl |
99 | ||
157344ba | 100 | %{__rm} -r deps/jemalloc |
3f86b561 | 101 | |
9702f891 | 102 | %build |
7674df1b | 103 | %define specflags -std=c99 -pedantic |
7672de0d JP |
104 | %define _make_opts \\\ |
105 | CC="%{__cc}" \\\ | |
106 | CFLAGS="%{rpmcflags}" \\\ | |
107 | LDFLAGS="%{rpmldflags}" \\\ | |
108 | OPTIMIZATION="" \\\ | |
109 | DEBUG="" \\\ | |
110 | BUILD_TLS=yes \\\ | |
111 | USE_SYSTEMD=%{?with_systemd:yes}%{!?with_systemd:no} \\\ | |
112 | V=1 \\\ | |
113 | uname_M=%{_target_cpu} | |
8234af62 | 114 | |
0d272681 | 115 | %{__make} -C src all |
9702f891 ER |
116 | |
117 | %if %{with tests} | |
0d272681 | 118 | %{__make} test |
9702f891 ER |
119 | %endif |
120 | ||
121 | %install | |
122 | rm -rf $RPM_BUILD_ROOT | |
1eb17a34 JR |
123 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \ |
124 | $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \ | |
125 | $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \ | |
0315028e | 126 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} $RPM_BUILD_ROOT%{systemdunitdir} \ |
e7e3392b | 127 | $RPM_BUILD_ROOT%{_mandir}/man{1,5} |
1eb17a34 | 128 | |
09689a83 | 129 | %{__make} install \ |
7674df1b | 130 | INSTALL="install -p" \ |
09689a83 ER |
131 | PREFIX=$RPM_BUILD_ROOT%{_prefix} |
132 | ||
133 | # Fix non-standard-executable-perm error | |
134 | chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-* | |
135 | ||
136 | # Ensure redis-server location doesn't change | |
3f86b561 | 137 | mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server |
58882d01 | 138 | mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel |
7ca0dec6 | 139 | |
9702f891 | 140 | # Install misc other |
09689a83 | 141 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
f9adb8fa ER |
142 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
143 | cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir} | |
da96ac2f | 144 | %if %{with systemd} |
58882d01 | 145 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf |
da96ac2f JP |
146 | %{__sed} -e 's;@sbindir@;%{_sbindir};' -e 's;@localstatedir@;%{_localstatedir};' %{SOURCE4} > $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service |
147 | %endif | |
9702f891 | 148 | |
e7e3392b AG |
149 | # man-pages |
150 | for man in man/man1/*; do | |
151 | install $man $RPM_BUILD_ROOT%{_mandir}/man1 | |
152 | done | |
153 | for man in man/man5/*; do | |
154 | install $man $RPM_BUILD_ROOT%{_mandir}/man5 | |
155 | done | |
156 | ||
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 | |
160 | ||
9702f891 | 161 | %clean |
ff1a4646 | 162 | rm -rf $RPM_BUILD_ROOT |
9702f891 | 163 | |
12dbec18 | 164 | %pre server |
5d17b48f | 165 | %groupadd -g 256 redis |
c4a51acc ER |
166 | %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis |
167 | ||
12dbec18 | 168 | %post server |
c4a51acc ER |
169 | /sbin/chkconfig --add redis |
170 | %service redis restart | |
0315028e | 171 | %{?with_systemd:%systemd_post %{name}.service} |
9702f891 | 172 | |
12dbec18 | 173 | %preun server |
9702f891 ER |
174 | if [ "$1" = 0 ]; then |
175 | %service redis stop | |
176 | /sbin/chkconfig --del redis | |
177 | fi | |
178 | ||
12dbec18 | 179 | %postun server |
c4a51acc ER |
180 | if [ "$1" = "0" ]; then |
181 | %userremove redis | |
182 | %groupremove redis | |
183 | fi | |
0315028e JP |
184 | %{?with_systemd:%systemd_reload} |
185 | ||
186 | %triggerpostun server -- redis-server < 6.2.5-2 | |
187 | %{?with_systemd?%systemd_trigger %{name}.service} | |
c4a51acc | 188 | |
9702f891 ER |
189 | %files |
190 | %defattr(644,root,root,755) | |
0d272681 | 191 | %doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md |
12dbec18 | 192 | %attr(755,root,root) %{_bindir}/redis-benchmark |
12dbec18 | 193 | %attr(755,root,root) %{_bindir}/redis-cli |
e7e3392b AG |
194 | %{_mandir}/man1/redis-benchmark.1* |
195 | %{_mandir}/man1/redis-cli.1* | |
12dbec18 ER |
196 | |
197 | %files server | |
198 | %defattr(644,root,root,755) | |
9702f891 ER |
199 | %config(noreplace) %{_sysconfdir}/%{name}.conf |
200 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
31dd1a80 | 201 | %attr(755,root,root) %{_sbindir}/redis-sentinel |
12dbec18 | 202 | %attr(755,root,root) %{_sbindir}/redis-server |
5fddefbf AG |
203 | %attr(755,root,root) %{_bindir}/redis-check-aof |
204 | %attr(755,root,root) %{_bindir}/redis-check-rdb | |
9702f891 ER |
205 | %config(noreplace) /etc/logrotate.d/%{name} |
206 | %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name} | |
207 | %dir %attr(755,redis,root) %{_localstatedir}/log/%{name} | |
33ba1b5a | 208 | %dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name} |
9702f891 | 209 | %dir %attr(755,redis,root) %{_localstatedir}/run/%{name} |
da96ac2f | 210 | %if %{with systemd} |
58882d01 | 211 | %{systemdtmpfilesdir}/%{name}.conf |
da96ac2f JP |
212 | %{systemdunitdir}/%{name}.service |
213 | %endif | |
e7e3392b AG |
214 | %{_mandir}/man1/redis-sentinel.1* |
215 | %{_mandir}/man1/redis-server.1* | |
216 | %{_mandir}/man1/redis-check-aof.1* | |
217 | %{_mandir}/man1/redis-check-rdb.1* | |
218 | %{_mandir}/man5/redis.conf.5* | |
219 | %{_mandir}/man5/redis-sentinel.conf.5* |