memcached-vl.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. %bcond_with systemd
  2. Summary: a high-performance, distributed memory object caching system
  3. Summary(ja): ハイパフォーマンスな分散メモリオブジェクトキャッシングシステム
  4. Name: memcached
  5. Version: 1.6.5
  6. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  7. Group: Applications/Databases
  8. Vendor: Project Vine
  9. Distribution: Vine Linux
  10. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  11. License: modified BSD style License
  12. Url: https://memcached.org/
  13. Source0: http://www.memcached.org/files/memcached-%{version}.tar.gz
  14. Source1: memcached.sysconfig
  15. # Patches
  16. Patch1: memcached-unit.patch
  17. BuildRequires: libevent-devel
  18. BuildRequires: openssl-devel
  19. Requires(pre): shadow-utils
  20. %if %{with systemd}
  21. BuildRequires: systemd
  22. %{?systemd_requires}
  23. %else
  24. Requires(post): chkconfig
  25. Requires(preun): chkconfig
  26. Requires(preun): initscripts
  27. Requires(postun): initscripts
  28. %endif
  29. %description
  30. memcached is a high-performance, distributed memory object caching system,
  31. generic in nature, but intended for use in speeding up dynamic web
  32. applications by alleviating database load.
  33. %package devel
  34. Summary: Files needed for development using memcached protocol
  35. Summary(ja): memcached プロトコルを使用した開発に必要なファイル
  36. Group: Development/Libraries
  37. Requires: %{name} = %{version}-%{release}
  38. %description devel
  39. Install memcached-devel if you are developing C/C++ applications that require access to the
  40. memcached binary include files.
  41. %prep
  42. %setup -q
  43. %patch1 -p1 -b .unit
  44. %if !%{with systemd}
  45. perl -pi -e 's|/var/run/memcached\.pid|/var/run/memcached/memcached.pid|' scripts/memcached.sysv
  46. %endif
  47. %build
  48. %configure --enable-tls
  49. %__make %{?_smp_mflags}
  50. %install
  51. rm -rf %{buildroot}
  52. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  53. mkdir -p %{buildroot}%{_localstatedir}/run/memcached
  54. make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
  55. # remove memcached-debug
  56. rm -f %{buildroot}/%{_bindir}/memcached-debug
  57. # Perl script for monitoring memcached
  58. install -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool
  59. install -Dp -m0644 scripts/memcached-tool.1 \
  60. %{buildroot}%{_mandir}/man1/memcached-tool.1
  61. %if %{with systemd}
  62. # Unit file
  63. install -Dp -m0644 scripts/memcached.service \
  64. %{buildroot}%{_unitdir}/memcached.service
  65. %else
  66. mkdir -p %{buildroot}%{_initdir}
  67. install -m755 scripts/memcached.sysv %{buildroot}%{_initdir}/memcached
  68. %endif
  69. # Default configs
  70. install -Dp -m0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
  71. %clean
  72. rm -rf %{buildroot}
  73. %triggerprein -- memcached < 1.5.0
  74. /sbin/update-alternatives --remove memcached %{_bindir}/memcached.memcached ||:
  75. /sbin/update-alternatives --remove memcached %{_bindir}/memcached.repcached ||:
  76. rm -f %{_bindir}/memcached
  77. %pre
  78. getent group memcached >/dev/null || groupadd -r memcached
  79. getent passwd memcached >/dev/null || \
  80. useradd -r -g memcached -d %{_sysconfdir}/memcached -s /sbin/nologin \
  81. -c "memcached service" memcached
  82. exit 0
  83. %post
  84. %if %{with systemd}
  85. %systemd_post memcached.service
  86. %else
  87. /sbin/chkconfig --add %{name}
  88. %endif
  89. %preun
  90. %if %{with systemd}
  91. %systemd_preun memcached.service
  92. %else
  93. if [ "$1" -eq 0 -o -x /bin/systemctl ]; then
  94. /sbin/service %{name} stop >/dev/null 2>&1
  95. /sbin/chkconfig --del %{name}
  96. fi
  97. %endif
  98. %postun
  99. %if %{with systemd}
  100. %systemd_postun_with_restart memcached.service
  101. %else
  102. if [ "$1" -ge "1" -a ! -x /bin/systemctl ]; then
  103. /sbin/service %{name} condrestart ||:
  104. fi
  105. %endif
  106. %files
  107. %defattr(-,root,root)
  108. %license COPYING
  109. %doc AUTHORS* ChangeLog ChangeLog* NEWS README*
  110. %doc doc/CONTRIBUTORS doc/*.txt
  111. %config(noreplace) %{_sysconfdir}/sysconfig/memcached
  112. %{_bindir}/memcached
  113. %{_bindir}/memcached-tool
  114. %{_mandir}/man1/memcached.1*
  115. %{_mandir}/man1/memcached-tool.1*
  116. %if %{with systemd}
  117. %{_unitdir}/memcached.service
  118. %else
  119. %{_initdir}/memcached
  120. %dir %{_localstatedir}/run/memcached
  121. %endif
  122. %files devel
  123. %defattr(-,root,root,0755)
  124. %{_includedir}/memcached/*
  125. %changelog
  126. * Tue Apr 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.6.5-1
  127. - new upstream release.
  128. - built with libevent-2.1.11.
  129. - added systemd support (disabled as default).
  130. * Sun Nov 04 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.5.12-1
  131. - new upstream release.
  132. - built with libevent-2.1.8.
  133. - dropped repcached.
  134. * Mon Nov 23 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.25-1
  135. - new upstream release.
  136. * Mon Jul 27 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.24-1
  137. - new upstream release.
  138. * Fri Jan 10 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.17-1
  139. - new upstream release.
  140. * Fri May 11 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.13-2
  141. - fixed missing symlink.
  142. * Sat Apr 28 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.13-1
  143. - new upstream release.
  144. - made be able to choose between memcached and repcached by alternatives.
  145. * Sat Aug 20 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.7.repcached2.3.1-1
  146. - new upstream release.
  147. - updated repcached patch.
  148. - removed %%Patch0. (fixed in upstream)
  149. * Tue Feb 15 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.5.repcached2.3.1-1
  150. - updated repcached patch.
  151. * Mon Feb 14 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.5.repcached2.
  152. 3-1
  153. - applied the repcached patch.
  154. * Thu Feb 10 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.5-1
  155. - new upstream release
  156. - added Patch0 from Fedora
  157. - rebuilt with libevent-2.0.10
  158. - fixed &&files
  159. - splitted -devel package
  160. * Mon Jun 22 2009 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.2.8-1
  161. - new upstream release.
  162. - wrote spec in UTF-8.
  163. * Mon May 19 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 1.2.5-1
  164. - new upstream release.
  165. - added some scripts.
  166. * Mon Jul 16 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.1.12-0vl2
  167. - rebuilt with libevent-1.3b
  168. * Sun Aug 13 2006 IWAI, Masaharu <iwai@alib.jp> 1.1.12-0vl1
  169. - new package