memcached-vl.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. %define memcached_version 1.4.13
  2. %define repcached_version 2.3.1
  3. Summary: a high-performance, distributed memory object caching system
  4. Summary(ja): ハイパフォーマンスな分散メモリオブジェクトキャッシングシステム
  5. Name: memcached
  6. Version: %{memcached_version}
  7. Release: 2%{?_dist_release}
  8. Source0: http://www.danga.com/memcached/dist/%{name}-%{memcached_version}.tar.gz
  9. Source1: repcached-%{repcached_version}-%{memcached_version}.tar.gz
  10. # Patches
  11. # repcached patch
  12. Patch1: repcached-%{repcached_version}-%{memcached_version}.patch
  13. License: modified BSD style License
  14. Url: http://www.danga.com/memcached/
  15. Group: Applications/Databases
  16. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  17. BuildRequires: libevent-devel
  18. %description
  19. memcached is a high-performance, distributed memory object caching system,
  20. generic in nature, but intended for use in speeding up dynamic web
  21. applications by alleviating database load.
  22. %package devel
  23. Summary: Files needed for development using memcached protocol
  24. Summary(ja): memcached プロトコルを使用した開発に必要なファイル
  25. Group: Development/Libraries
  26. Requires: %{name} = %{version}-%{release}
  27. %description devel
  28. Install memcached-devel if you are developing C/C++ applications that require access to the
  29. memcached binary include files.
  30. %prep
  31. %setup -q -T -a 0 -c -n memcached-%{memcached_version}
  32. pushd memcached-%{memcached_version}
  33. popd
  34. %setup -q -D -T -a 1 -n memcached-%{memcached_version}
  35. pushd repcached-%{repcached_version}-%{memcached_version}
  36. popd
  37. %build
  38. pushd memcached-%{memcached_version}
  39. #sh ./autogen.sh
  40. %configure
  41. %__make %{?_smp_mflags}
  42. popd
  43. pushd repcached-%{repcached_version}-%{memcached_version}
  44. sh ./autogen.sh
  45. %configure --enable-replication
  46. %__make %{?_smp_mflags}
  47. popd
  48. %install
  49. rm -rf %{buildroot}
  50. mkdir -p %{buildroot}%{_initdir}
  51. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  52. mkdir -p %{buildroot}%{_localstatedir}/run/memcached
  53. pushd memcached-%{memcached_version}
  54. %makeinstall
  55. rm -f %{buildroot}%{_bindir}/memcached-debug
  56. install -m755 scripts/memcached.sysv %{buildroot}%{_initdir}/memcached
  57. install -m755 scripts/memcached-tool %{buildroot}%{_bindir}/
  58. popd
  59. pushd repcached-%{repcached_version}-%{memcached_version}
  60. cp -af AUTHORS COPYING ChangeLog ChangeLog.repcached NEWS README doc ../
  61. popd
  62. mv -f %{buildroot}%{_bindir}/memcached %{buildroot}%{_bindir}/memcached.memcached
  63. install -m755 repcached-%{repcached_version}-%{memcached_version}/memcached %{buildroot}%{_bindir}/memcached.repcached
  64. cat <<EOF > %{buildroot}%{_sysconfdir}/sysconfig/memcached
  65. PORT=11211
  66. USER=nobody
  67. MAXCONN=1024
  68. CACHESIZE=64
  69. OPTIONS=""
  70. #OPTIONS="-x peer.to.replicate"
  71. EOF
  72. %clean
  73. rm -rf %{buildroot}
  74. %post
  75. /sbin/update-alternatives --install %{_bindir}/memcached \
  76. memcached %{_bindir}/memcached.memcached 20
  77. /sbin/update-alternatives --install %{_bindir}/memcached \
  78. memcached %{_bindir}/memcached.repcached 10
  79. %preun
  80. if [ "$1" = 0 ]; then
  81. /sbin/update-alternatives --remove memcached %{_bindir}/memcached.memcached
  82. /sbin/update-alternatives --remove memcached %{_bindir}/memcached.repcached
  83. /sbin/update-alternatives --auto memcached ||:
  84. fi
  85. %triggerpostun -- memcached < 1.4.13
  86. /sbin/update-alternatives --auto memcached ||:
  87. %files
  88. %defattr(-,root,root)
  89. %doc AUTHORS COPYING ChangeLog ChangeLog.repcached NEWS README
  90. %doc doc/CONTRIBUTORS doc/*.txt
  91. %config(noreplace) %{_sysconfdir}/sysconfig/memcached
  92. %{_initdir}/memcached
  93. %{_bindir}/memcached.memcached
  94. %{_bindir}/memcached.repcached
  95. %{_bindir}/memcached-tool
  96. %{_mandir}/man1/memcached.1*
  97. %dir %{_localstatedir}/run/memcached
  98. %files devel
  99. %defattr(-,root,root,0755)
  100. %{_includedir}/memcached/*
  101. %changelog
  102. * Fri May 11 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.13-2
  103. - fixed missing symlink.
  104. * Sat Apr 28 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.13-1
  105. - new upstream release.
  106. - made be able to choose between memcached and repcached by alternatives.
  107. * Sat Aug 20 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.7.repcached2.3.1-1
  108. - new upstream release.
  109. - updated repcached patch.
  110. - removed %%Patch0. (fixed in upstream)
  111. * Tue Feb 15 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.5.repcached2.3.1-1
  112. - updated repcached patch.
  113. * Mon Feb 14 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.5.repcached2.
  114. 3-1
  115. - applied the repcached patch.
  116. * Thu Feb 10 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.5-1
  117. - new upstream release
  118. - added Patch0 from Fedora
  119. - rebuilt with libevent-2.0.10
  120. - fixed &&files
  121. - splitted -devel package
  122. * Mon Jun 22 2009 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.2.8-1
  123. - new upstream release.
  124. - wrote spec in UTF-8.
  125. * Mon May 19 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 1.2.5-1
  126. - new upstream release.
  127. - added some scripts.
  128. * Mon Jul 16 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.1.12-0vl2
  129. - rebuilt with libevent-1.3b
  130. * Sun Aug 13 2006 IWAI, Masaharu <iwai@alib.jp> 1.1.12-0vl1
  131. - new package