1 | %bcond_with systemd |
---|
2 | |
---|
3 | # Check for status of man pages |
---|
4 | # http://code.google.com/p/redis/issues/detail?id=202 |
---|
5 | |
---|
6 | # Commit IDs for the (unversioned) redis-doc repository |
---|
7 | # https://fedoraproject.org/wiki/Packaging:SourceURL "Commit Revision" |
---|
8 | %global doc_commit abfe8e0698564af7260b4c1a0ea4d21424d14a88 |
---|
9 | %global short_doc_commit %(c=%{doc_commit}; echo ${c:0:7}) |
---|
10 | |
---|
11 | # %%{rpmmacrodir} not usable on EL-6 |
---|
12 | %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) |
---|
13 | |
---|
14 | %ifarch %{ix86} x86_64 ppc |
---|
15 | # available only on selected architectures |
---|
16 | %global with_perftools 1 |
---|
17 | %endif |
---|
18 | |
---|
19 | Name: redis |
---|
20 | Version: 5.0.8 |
---|
21 | Release: 1%{?_dist_release}%{?with_systemd:.systemd} |
---|
22 | Summary: A persistent in-memory key-value database |
---|
23 | Summary(ja): 永続化可能なキー・バリュー型インメモリデータベース |
---|
24 | |
---|
25 | Group: Applications/Databases |
---|
26 | License: BSD |
---|
27 | URL: https://redis.io |
---|
28 | |
---|
29 | Vendor: Project Vine |
---|
30 | Distribution: Vine Linux |
---|
31 | Packager: daisuke |
---|
32 | |
---|
33 | Source0: https://github.com/antirez/redis/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz |
---|
34 | Source1: %{name}.logrotate |
---|
35 | Source2: %{name}-sentinel.service |
---|
36 | Source3: %{name}.service |
---|
37 | Source4: %{name}-sentinel.init |
---|
38 | Source5: %{name}.init |
---|
39 | Source6: %{name}-shutdown |
---|
40 | Source7: %{name}-limit-systemd |
---|
41 | Source8: %{name}-limit-init |
---|
42 | Source9: macros.%{name} |
---|
43 | Source10: https://github.com/antirez/%{name}-doc/archive/%{doc_commit}/%{name}-doc-%{short_doc_commit}.tar.gz |
---|
44 | |
---|
45 | # To refresh patches: |
---|
46 | # tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%%{version} baseline" |
---|
47 | # git am %%{patches} |
---|
48 | # Then refresh your patches |
---|
49 | # git format-patch HEAD~<number of expected patches> |
---|
50 | # Update configuration for Fedora |
---|
51 | # https://github.com/antirez/redis/pull/3491 - man pages |
---|
52 | Patch0001: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch |
---|
53 | # https://github.com/antirez/redis/pull/3494 - symlink |
---|
54 | Patch0002: 0002-install-redis-check-rdb-as-a-symlink-instead-of-dupl.patch |
---|
55 | |
---|
56 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
57 | %if %{?with_perftools} |
---|
58 | BuildRequires: gperftools-devel |
---|
59 | %endif |
---|
60 | |
---|
61 | Requires: logrotate |
---|
62 | %if %{with systemd} |
---|
63 | BuildRequires: systemd |
---|
64 | Requires(post): systemd |
---|
65 | Requires(preun): systemd |
---|
66 | Requires(postun): systemd |
---|
67 | %else |
---|
68 | Requires(post): chkconfig |
---|
69 | Requires(postun): initscripts |
---|
70 | Requires(preun): chkconfig |
---|
71 | Requires(preun): initscripts |
---|
72 | %endif |
---|
73 | Requires(pre): shadow-utils |
---|
74 | |
---|
75 | |
---|
76 | %global redis_modules_abi 1 |
---|
77 | %global redis_modules_dir %{_libdir}/%{name}/modules |
---|
78 | Provides: redis(modules_abi)%{?_isa} = %{redis_modules_abi} |
---|
79 | |
---|
80 | %description |
---|
81 | Redis is an advanced key-value store. It is similar to memcached but the data |
---|
82 | set is not volatile, and values can be strings, exactly like in memcached, but |
---|
83 | also lists, sets, and ordered sets. All this data types can be manipulated with |
---|
84 | atomic operations to push/pop elements, add/remove elements, perform server side |
---|
85 | union, intersection, difference between sets, and so forth. Redis supports |
---|
86 | different kind of sorting abilities. |
---|
87 | |
---|
88 | |
---|
89 | %package devel |
---|
90 | Summary: Development header for Redis module development |
---|
91 | # Header-Only Library (https://fedoraproject.org/wiki/Packaging:Guidelines) |
---|
92 | Provides: %{name}-static = %{version}-%{release} |
---|
93 | |
---|
94 | %description devel |
---|
95 | Header file required for building loadable Redis modules. Detailed |
---|
96 | API documentation is available in the redis-doc package. |
---|
97 | |
---|
98 | |
---|
99 | %package doc |
---|
100 | Summary: Documentation for Redis including man pages |
---|
101 | License: CC-BY-SA |
---|
102 | BuildArch: noarch |
---|
103 | |
---|
104 | # http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages" |
---|
105 | Conflicts: redis < 4.0 |
---|
106 | |
---|
107 | %description doc |
---|
108 | Manual pages and detailed documentation for many aspects of Redis use, |
---|
109 | administration and development. |
---|
110 | |
---|
111 | |
---|
112 | %prep |
---|
113 | %setup -q -b 10 |
---|
114 | %setup -q |
---|
115 | mv ../%{name}-doc-%{doc_commit} doc |
---|
116 | %patch0001 -p1 |
---|
117 | %patch0002 -p1 |
---|
118 | |
---|
119 | mv deps/lua/COPYRIGHT COPYRIGHT-lua |
---|
120 | mv deps/hiredis/COPYING COPYING-hiredis |
---|
121 | |
---|
122 | # Configuration file changes |
---|
123 | sed -i -e 's|^logfile .*$|logfile /var/log/redis/redis.log|g' redis.conf |
---|
124 | sed -i -e 's|^logfile .*$|logfile /var/log/redis/sentinel.log|g' sentinel.conf |
---|
125 | sed -i -e 's|^dir .*$|dir /var/lib/redis|g' redis.conf |
---|
126 | |
---|
127 | sed -i -e 's|^daemonize no$|daemonize yes|g' redis.conf |
---|
128 | sed -i -e 's|^protected-mode no$|protected-mode yes|g' redis.conf |
---|
129 | sed -i -e 's|^# bind 127\.0\.0\.1$|bind 127.0.0.1|g' redis.conf |
---|
130 | |
---|
131 | # Module API version safety check |
---|
132 | api=`sed -n -e 's/#define REDISMODULE_APIVER_[0-9][0-9]* //p' src/redismodule.h` |
---|
133 | if test "$api" != "%{redis_modules_abi}"; then |
---|
134 | : Error: Upstream API version is now ${api}, expecting %%{redis_modules_abi}. |
---|
135 | : Update the redis_modules_abi macro, the rpmmacros file, and rebuild. |
---|
136 | exit 1 |
---|
137 | fi |
---|
138 | |
---|
139 | %global make_flags DEBUG="" V="echo" LDFLAGS="%{?__global_ldflags}" CFLAGS+="%{optflags} -fPIC" INSTALL="install -p" PREFIX=%{buildroot}%{_prefix} |
---|
140 | |
---|
141 | |
---|
142 | %build |
---|
143 | make %{?_smp_mflags} %{make_flags} all |
---|
144 | |
---|
145 | %check |
---|
146 | # make test |
---|
147 | |
---|
148 | %install |
---|
149 | make %{make_flags} install |
---|
150 | |
---|
151 | # Filesystem. |
---|
152 | install -d %{buildroot}%{_sharedstatedir}/%{name} |
---|
153 | install -d %{buildroot}%{_localstatedir}/log/%{name} |
---|
154 | install -d %{buildroot}%{_localstatedir}/run/%{name} |
---|
155 | install -d %{buildroot}%{redis_modules_dir} |
---|
156 | |
---|
157 | # Install logrotate file. |
---|
158 | install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} |
---|
159 | |
---|
160 | # Install configuration files. |
---|
161 | mkdir -p %{buildroot}%{_sysconfdir}/%{name} |
---|
162 | install -pDm640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf |
---|
163 | install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}-sentinel.conf |
---|
164 | |
---|
165 | %if %{with systemd} |
---|
166 | # Install systemd unit files. |
---|
167 | mkdir -p %{buildroot}%{_unitdir} |
---|
168 | install -pm644 %{S:3} %{buildroot}%{_unitdir} |
---|
169 | install -pm644 %{S:2} %{buildroot}%{_unitdir} |
---|
170 | |
---|
171 | # Install systemd limit files (requires systemd >= 204) |
---|
172 | install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf |
---|
173 | install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf |
---|
174 | %else |
---|
175 | mkdir -p %{buildroot}%{_initdir} |
---|
176 | install -pm755 %{S:4} %{buildroot}%{_initdir}/%{name}-sentinel |
---|
177 | install -pm755 %{S:5} %{buildroot}%{_initdir}/%{name} |
---|
178 | install -pm755 %{S:8} %{buildroot}%{_initdir}/%{name}-limit |
---|
179 | %endif |
---|
180 | |
---|
181 | |
---|
182 | # Fix non-standard-executable-perm error. |
---|
183 | chmod 755 %{buildroot}%{_bindir}/%{name}-* |
---|
184 | |
---|
185 | # Install redis-shutdown |
---|
186 | install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown |
---|
187 | |
---|
188 | # Install redis module header |
---|
189 | install -pDm644 src/%{name}module.h %{buildroot}%{_includedir}/%{name}module.h |
---|
190 | |
---|
191 | # Install man pages |
---|
192 | man=$(dirname %{buildroot}%{_mandir}) |
---|
193 | for page in man/man?/*; do |
---|
194 | install -Dpm644 $page $man/$page |
---|
195 | done |
---|
196 | ln -s redis-server.1 %{buildroot}%{_mandir}/man1/redis-sentinel.1 |
---|
197 | ln -s redis.conf.5 %{buildroot}%{_mandir}/man5/redis-sentinel.conf.5 |
---|
198 | |
---|
199 | # Install documentation and html pages |
---|
200 | doc=$(echo %{buildroot}/%{_docdir}/%{name}) |
---|
201 | for page in 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO; do |
---|
202 | install -Dpm644 $page $doc/$page |
---|
203 | done |
---|
204 | for page in $(find doc -name \*.md | sed -e 's|.md$||g'); do |
---|
205 | base=$(echo $page | sed -e 's|doc/||g') |
---|
206 | install -Dpm644 $page.md $doc/$base.md |
---|
207 | done |
---|
208 | |
---|
209 | # Install rpm macros for redis modules |
---|
210 | mkdir -p %{buildroot}%{macrosdir} |
---|
211 | install -pDm644 %{S:9} %{buildroot}%{macrosdir}/macros.%{name} |
---|
212 | |
---|
213 | |
---|
214 | %post |
---|
215 | %if %{with systemd} |
---|
216 | %systemd_post %{name}.service |
---|
217 | %systemd_post %{name}-sentinel.service |
---|
218 | %else |
---|
219 | if [ $1 -eq 1 ]; then |
---|
220 | /sbin/chkconfig --add %{name} |
---|
221 | /sbin/chkconfig --add %{name}-sentinel |
---|
222 | fi |
---|
223 | %endif |
---|
224 | |
---|
225 | %pre |
---|
226 | getent group %{name} &> /dev/null || \ |
---|
227 | groupadd -r %{name} &> /dev/null |
---|
228 | getent passwd %{name} &> /dev/null || \ |
---|
229 | useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \ |
---|
230 | -c 'Redis Database Server' %{name} &> /dev/null |
---|
231 | exit 0 |
---|
232 | |
---|
233 | %preun |
---|
234 | %if %{with systemd} |
---|
235 | %systemd_preun %{name}.service |
---|
236 | %systemd_preun %{name}-sentinel.service |
---|
237 | %else |
---|
238 | if [ $1 -eq 0 -o -x /sbin/systemctl ]; then |
---|
239 | /sbin/service %{name} stop ||: |
---|
240 | /sbin/service %{name}-sentinel stop ||: |
---|
241 | /sbin/chkconfig --del %{name} |
---|
242 | /sbin/chkconfig --del %{name}-sentinel |
---|
243 | fi |
---|
244 | %endif |
---|
245 | |
---|
246 | %postun |
---|
247 | %if %{with systemd} |
---|
248 | %systemd_postun_with_restart %{name}.service |
---|
249 | %systemd_postun_with_restart %{name}-sentinel.service |
---|
250 | %else |
---|
251 | if [ $1 -gt 0 ]; then |
---|
252 | if [ -x /sbin/systemctl ]; then |
---|
253 | /sbin/service %{name} stop ||: |
---|
254 | else |
---|
255 | /sbin/service %{name} condrestart ||: |
---|
256 | fi |
---|
257 | fi |
---|
258 | %endif |
---|
259 | |
---|
260 | |
---|
261 | %files |
---|
262 | %{!?_licensedir:%global license %%doc} |
---|
263 | %license COPYING |
---|
264 | %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} |
---|
265 | %dir %{_sysconfdir}/%{name} |
---|
266 | %attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf |
---|
267 | %attr(0640, redis, root) %config(noreplace) %{_sysconfdir}/%{name}/%{name}-sentinel.conf |
---|
268 | %dir %attr(0750, redis, redis) %{_libdir}/%{name} |
---|
269 | %dir %attr(0750, redis, redis) %{redis_modules_dir} |
---|
270 | %dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name} |
---|
271 | %dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name} |
---|
272 | %exclude %{macrosdir} |
---|
273 | %exclude %{_includedir} |
---|
274 | %exclude %{_docdir}/%{name}/* |
---|
275 | %{_bindir}/%{name}-* |
---|
276 | %{_libexecdir}/%{name}-* |
---|
277 | %{_mandir}/man1/%{name}* |
---|
278 | %{_mandir}/man5/%{name}* |
---|
279 | %if %{with systemd} |
---|
280 | %{_unitdir}/%{name}.service |
---|
281 | %{_unitdir}/%{name}-sentinel.service |
---|
282 | %dir %{_sysconfdir}/systemd/system/%{name}.service.d |
---|
283 | %config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf |
---|
284 | %dir %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d |
---|
285 | %config(noreplace) %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf |
---|
286 | %else |
---|
287 | %{_initdir}/* |
---|
288 | %endif |
---|
289 | %dir %attr(0755, redis, redis) %{_localstatedir}/run/%{name} |
---|
290 | |
---|
291 | %files devel |
---|
292 | %license COPYING |
---|
293 | %license COPYRIGHT-lua |
---|
294 | %license COPYING-hiredis |
---|
295 | %{_includedir}/%{name}module.h |
---|
296 | %{macrosdir}/* |
---|
297 | |
---|
298 | %files doc |
---|
299 | %docdir %{_docdir}/%{name} |
---|
300 | %{_docdir}/%{name} |
---|
301 | |
---|
302 | |
---|
303 | %changelog |
---|
304 | * Fri Apr 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.8-1 |
---|
305 | - new upstream release. |
---|
306 | |
---|
307 | * Sun Sep 08 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.5-1 |
---|
308 | - new upstream release. |
---|
309 | |
---|
310 | * Mon Mar 11 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.10-1 |
---|
311 | - update to 2.6.10 |
---|
312 | |
---|
313 | * Sat Oct 27 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.15-1 |
---|
314 | - initial build for Vine Linux |
---|
315 | |
---|
316 | * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.15-3 |
---|
317 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild |
---|
318 | |
---|
319 | * Sun Jul 08 2012 Silas Sewell <silas@sewell.org> - 2.4.15-2 |
---|
320 | - Remove TODO from docs |
---|
321 | |
---|
322 | * Sun Jul 08 2012 Silas Sewell <silas@sewell.org> - 2.4.15-1 |
---|
323 | - Update to redis 2.4.15 |
---|
324 | |
---|
325 | * Sat May 19 2012 Silas Sewell <silas@sewell.org> - 2.4.13-1 |
---|
326 | - Update to redis 2.4.13 |
---|
327 | |
---|
328 | * Sat Mar 31 2012 Silas Sewell <silas@sewell.org> - 2.4.10-1 |
---|
329 | - Update to redis 2.4.10 |
---|
330 | |
---|
331 | * Fri Feb 24 2012 Silas Sewell <silas@sewell.org> - 2.4.8-1 |
---|
332 | - Update to redis 2.4.8 |
---|
333 | |
---|
334 | * Sat Feb 04 2012 Silas Sewell <silas@sewell.org> - 2.4.7-1 |
---|
335 | - Update to redis 2.4.7 |
---|
336 | |
---|
337 | * Wed Feb 01 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-4 |
---|
338 | - Fixed a typo in the spec |
---|
339 | |
---|
340 | * Tue Jan 31 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-3 |
---|
341 | - Fix .service file, to match config (Type=simple). |
---|
342 | |
---|
343 | * Tue Jan 31 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-2 |
---|
344 | - Fix .service file, credits go to Timon. |
---|
345 | |
---|
346 | * Thu Jan 12 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-1 |
---|
347 | - Update to 2.4.6 |
---|
348 | - systemd unit file added |
---|
349 | - Compiler flags changed to compile 2.4.6 |
---|
350 | - Remove doc/ and Changelog |
---|
351 | |
---|
352 | * Sun Jul 24 2011 Silas Sewell <silas@sewell.org> - 2.2.12-1 |
---|
353 | - Update to redis 2.2.12 |
---|
354 | |
---|
355 | * Fri May 06 2011 Dan Horák <dan[at]danny.cz> - 2.2.5-2 |
---|
356 | - google-perftools exists only on selected architectures |
---|
357 | |
---|
358 | * Sat Apr 23 2011 Silas Sewell <silas@sewell.ch> - 2.2.5-1 |
---|
359 | - Update to redis 2.2.5 |
---|
360 | |
---|
361 | * Sat Mar 26 2011 Silas Sewell <silas@sewell.ch> - 2.2.2-1 |
---|
362 | - Update to redis 2.2.2 |
---|
363 | |
---|
364 | * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.4-2 |
---|
365 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild |
---|
366 | |
---|
367 | * Sun Dec 19 2010 Silas Sewell <silas@sewell.ch> - 2.0.4-1 |
---|
368 | - Update to redis 2.0.4 |
---|
369 | |
---|
370 | * Tue Oct 19 2010 Silas Sewell <silas@sewell.ch> - 2.0.3-1 |
---|
371 | - Update to redis 2.0.3 |
---|
372 | |
---|
373 | * Fri Oct 08 2010 Silas Sewell <silas@sewell.ch> - 2.0.2-1 |
---|
374 | - Update to redis 2.0.2 |
---|
375 | - Disable checks section for el5 |
---|
376 | |
---|
377 | * Sat Sep 11 2010 Silas Sewell <silas@sewell.ch> - 2.0.1-1 |
---|
378 | - Update to redis 2.0.1 |
---|
379 | |
---|
380 | * Sat Sep 04 2010 Silas Sewell <silas@sewell.ch> - 2.0.0-1 |
---|
381 | - Update to redis 2.0.0 |
---|
382 | |
---|
383 | * Thu Sep 02 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-3 |
---|
384 | - Add Fedora build flags |
---|
385 | - Send all scriplet output to /dev/null |
---|
386 | - Remove debugging flags |
---|
387 | - Add redis.conf check to init script |
---|
388 | |
---|
389 | * Mon Aug 16 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-2 |
---|
390 | - Don't compress man pages |
---|
391 | - Use patch to fix redis.conf |
---|
392 | |
---|
393 | * Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-1 |
---|
394 | - Initial package |
---|