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

Revision 12421, 12.5 KB checked in by tomop, 4 years ago (diff)

updated 3 packages

freerdp-2.1.2-1

redis-6.0.5-1

sqlite3-3.32.3-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 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:          6.0.5
21Release:          1%{?_dist_release}%{?with_systemd:.systemd}
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://github.com/redis-io/redis/archive/%{version}.tar.gz#/%{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/redis-io/%{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 -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
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%else
251if [ $1 -gt 0 ]; then
252        if [ -x /sbin/systemctl ]; then
253                /sbin/service %{name} stop ||:
254        else
255                /sbin/service %{name} condrestart ||:
256        fi
257fi
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* Thu Jul 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.0.5-1
305- new upstream release.
306
307* Fri Apr 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.8-1
308- new upstream release.
309
310* Sun Sep 08 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.5-1
311- new upstream release.
312
313* Mon Mar 11 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.10-1
314- update to 2.6.10
315
316* Sat Oct 27 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.15-1
317- initial build for Vine Linux
318
319* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.15-3
320- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
321
322* Sun Jul 08 2012 Silas Sewell <silas@sewell.org> - 2.4.15-2
323- Remove TODO from docs
324
325* Sun Jul 08 2012 Silas Sewell <silas@sewell.org> - 2.4.15-1
326- Update to redis 2.4.15
327
328* Sat May 19 2012 Silas Sewell <silas@sewell.org> - 2.4.13-1
329- Update to redis 2.4.13
330
331* Sat Mar 31 2012 Silas Sewell <silas@sewell.org> - 2.4.10-1
332- Update to redis 2.4.10
333
334* Fri Feb 24 2012 Silas Sewell <silas@sewell.org> - 2.4.8-1
335- Update to redis 2.4.8
336
337* Sat Feb 04 2012 Silas Sewell <silas@sewell.org> - 2.4.7-1
338- Update to redis 2.4.7
339
340* Wed Feb 01 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-4
341- Fixed a typo in the spec
342
343* Tue Jan 31 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-3
344- Fix .service file, to match config (Type=simple).
345
346* Tue Jan 31 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-2
347- Fix .service file, credits go to Timon.
348
349* Thu Jan 12 2012 Fabian Deutsch <fabiand@fedoraproject.org> - 2.4.6-1
350- Update to 2.4.6
351- systemd unit file added
352- Compiler flags changed to compile 2.4.6
353- Remove doc/ and Changelog
354
355* Sun Jul 24 2011 Silas Sewell <silas@sewell.org> - 2.2.12-1
356- Update to redis 2.2.12
357
358* Fri May 06 2011 Dan Horák <dan[at]danny.cz> - 2.2.5-2
359- google-perftools exists only on selected architectures
360
361* Sat Apr 23 2011 Silas Sewell <silas@sewell.ch> - 2.2.5-1
362- Update to redis 2.2.5
363
364* Sat Mar 26 2011 Silas Sewell <silas@sewell.ch> - 2.2.2-1
365- Update to redis 2.2.2
366
367* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.4-2
368- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
369
370* Sun Dec 19 2010 Silas Sewell <silas@sewell.ch> - 2.0.4-1
371- Update to redis 2.0.4
372
373* Tue Oct 19 2010 Silas Sewell <silas@sewell.ch> - 2.0.3-1
374- Update to redis 2.0.3
375
376* Fri Oct 08 2010 Silas Sewell <silas@sewell.ch> - 2.0.2-1
377- Update to redis 2.0.2
378- Disable checks section for el5
379
380* Sat Sep 11 2010 Silas Sewell <silas@sewell.ch> - 2.0.1-1
381- Update to redis 2.0.1
382
383* Sat Sep 04 2010 Silas Sewell <silas@sewell.ch> - 2.0.0-1
384- Update to redis 2.0.0
385
386* Thu Sep 02 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-3
387- Add Fedora build flags
388- Send all scriplet output to /dev/null
389- Remove debugging flags
390- Add redis.conf check to init script
391
392* Mon Aug 16 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-2
393- Don't compress man pages
394- Use patch to fix redis.conf
395
396* Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 1.2.6-1
397- Initial package
Note: See TracBrowser for help on using the repository browser.