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

Revision 12187, 12.1 KB checked in by tomop, 5 years ago (diff)

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