source: projects/specs/trunk/r/redis/redis-vl.spec @ 12515

Revision 12515, 12.7 KB checked in by tomop, 3 years ago (diff)

updated 5 packages

glib2-2.66.4-1

initscripts-8.91.16-5

memcached-1.6.9-1

p11-kit-0.23.22-1

redis-6.0.9-1

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