aerospike-server-community-9999.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. EGIT_REPO_URI="https://github.com/aerospike/aerospike-server.git"
  5. inherit git-2 systemd user
  6. DESCRIPTION="Flash-optimized, in-memory, nosql database"
  7. HOMEPAGE="http://www.aerospike.com"
  8. SRC_URI=""
  9. LICENSE="AGPL-3"
  10. SLOT="0"
  11. KEYWORDS=""
  12. IUSE="+tools"
  13. RDEPEND="app-crypt/gcr
  14. dev-libs/jansson
  15. dev-libs/jemalloc"
  16. DEPEND="${RDEPEND}"
  17. DOCS=(
  18. README.md
  19. )
  20. PATCHES=(
  21. "${FILESDIR}"/3.5.8-use-system-libs.patch
  22. )
  23. pkg_setup() {
  24. enewgroup aerospike
  25. enewuser aerospike -1 /bin/bash /opt/aerospike aerospike
  26. }
  27. src_prepare() {
  28. base_src_prepare
  29. git submodule update --init
  30. sed \
  31. -e 's/USE_SYSTEM_JEM = 0/USE_SYSTEM_JEM = 1/g' \
  32. -e 's/USE_SYSTEM_JANSSON = 0/USE_SYSTEM_JANSSON = 1/g' \
  33. -e 's/LD_CRYPTO = static/LD_CRYPTO = dynamic/g' \
  34. -e 's/LD_JANSSON = static/LD_JANSSON = dynamic/g' \
  35. -e 's/LD_JEM = static/LD_JEM = dynamic/g' \
  36. -i make_in/Makefile.vars || die
  37. rm -rf modules/jansson
  38. rm -rf modules/jemalloc
  39. }
  40. src_install() {
  41. base_src_install_docs
  42. dobin target/Linux-x86_64/bin/asd
  43. insinto /opt/aerospike/sys/udf/lua
  44. doins -r modules/lua-core/src/*
  45. if use tools; then
  46. insinto /opt/aerospike/bin
  47. doins tools/afterburner/afterburner.sh
  48. fperms +x /opt/aerospike/bin/afterburner.sh
  49. fi
  50. keepdir /opt/aerospike/usr/udf/lua
  51. keepdir /var/log/aerospike
  52. insinto /etc/aerospike
  53. for conf in aerospike.conf aerospike_mesh.conf aerospike_ssd.conf; do
  54. sed -e "s@/var/run/aerospike/asd.pid@/run/aerospike/aerospike.pid@g" -i as/etc/"${conf}" || die
  55. doins as/etc/"${conf}"
  56. done
  57. insinto /etc/logrotate.d
  58. newins as/etc/logrotate_asd aerospike
  59. newinitd "${FILESDIR}"/aerospike.init aerospike
  60. systemd_newunit as/etc/aerospike-server.service aerospike.service
  61. fowners -R aerospike:aerospike /opt/aerospike/
  62. fowners aerospike:aerospike /usr/bin/asd
  63. fowners -R aerospike:aerospike /var/log/aerospike
  64. }