memcached-1.4.33.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils flag-o-matic systemd user
  5. MY_PV="${PV/_rc/-rc}"
  6. MY_P="${PN}-${MY_PV}"
  7. DESCRIPTION="High-performance, distributed memory object caching system"
  8. HOMEPAGE="http://memcached.org/"
  9. SRC_URI="https://www.memcached.org/files/${MY_P}.tar.gz
  10. https://www.memcached.org/files/old/${MY_P}.tar.gz"
  11. LICENSE="BSD"
  12. SLOT="0"
  13. KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
  14. IUSE="test slabs-reassign debug sasl selinux" # hugetlbfs later
  15. RDEPEND=">=dev-libs/libevent-1.4
  16. dev-lang/perl
  17. sasl? ( dev-libs/cyrus-sasl )
  18. selinux? ( sec-policy/selinux-memcached )"
  19. DEPEND="${RDEPEND}
  20. test? ( virtual/perl-Test-Harness >=dev-perl/Cache-Memcached-1.24 )"
  21. S="${WORKDIR}/${MY_P}"
  22. src_prepare() {
  23. epatch "${FILESDIR}/${PN}-1.2.2-fbsd.patch"
  24. # Handled different upstream
  25. #epatch "${FILESDIR}/${PN}-1.3.3-gcc4-slab-fixup.patch"
  26. epatch "${FILESDIR}/${PN}-1.4.0-fix-as-needed-linking.patch"
  27. epatch "${FILESDIR}/${PN}-1.4.4-as-needed.patch"
  28. epatch "${FILESDIR}/${PN}-1.4.17-EWOULDBLOCK.patch"
  29. sed -i -e 's,-Werror,,g' configure.ac || die
  30. sed -i -e 's,AM_CONFIG_HEADER,AC_CONFIG_HEADERS,' configure.ac || die
  31. eautoreconf
  32. use slabs-reassign && append-flags -DALLOW_SLABS_REASSIGN
  33. }
  34. src_configure() {
  35. econf \
  36. --disable-docs \
  37. $(use_enable sasl)
  38. # The xml2rfc tool to build the additional docs requires TCL :-(
  39. # `use_enable doc docs`
  40. }
  41. src_compile() {
  42. # There is a heavy degree of per-object compile flags
  43. # Users do NOT know better than upstream. Trying to compile the testapp and
  44. # the -debug version with -DNDEBUG _WILL_ fail.
  45. append-flags -UNDEBUG -pthread
  46. emake testapp memcached-debug CFLAGS="${CFLAGS}"
  47. filter-flags -UNDEBUG
  48. emake
  49. }
  50. src_install() {
  51. emake DESTDIR="${D}" install
  52. dobin scripts/memcached-tool
  53. use debug && dobin memcached-debug
  54. dodoc AUTHORS ChangeLog NEWS README.md doc/{CONTRIBUTORS,*.txt}
  55. newconfd "${FILESDIR}/memcached.confd" memcached
  56. newinitd "${FILESDIR}/memcached.init2" memcached
  57. systemd_dounit "${FILESDIR}/memcached.service"
  58. }
  59. pkg_postinst() {
  60. enewuser memcached -1 -1 /dev/null daemon
  61. elog "With this version of Memcached Gentoo now supports multiple instances."
  62. elog "To enable this you should create a symlink in /etc/init.d/ for each instance"
  63. elog "to /etc/init.d/memcached and create the matching conf files in /etc/conf.d/"
  64. elog "Please see Gentoo bug #122246 for more info"
  65. }
  66. src_test() {
  67. emake -j1 test
  68. }