redis-vl.spec 15 KB

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