maxscale-1.2.0.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils cmake-utils multilib user
  5. MY_PN="MaxScale"
  6. MY_P="${MY_PN}-${PV}"
  7. DESCRIPTION="A content aware, plug-able MySQL proxy server"
  8. HOMEPAGE="http://mariadb.com/MaxScale"
  9. SRC_URI="https://github.com/mariadb-corporation/${MY_PN}/archive/${PV}.tar.gz -> ${MY_P}.tar.gz"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE="jemalloc rabbitmq tcmalloc"
  14. REQUIRED_USE="?? ( jemalloc tcmalloc )"
  15. DEPEND="
  16. dev-libs/libaio
  17. >=dev-libs/libpcre-8.35
  18. dev-libs/openssl:0
  19. net-misc/curl
  20. virtual/mysql[embedded]
  21. jemalloc? ( dev-libs/jemalloc )
  22. rabbitmq? ( net-libs/rabbitmq-c )
  23. tcmalloc? ( dev-util/google-perftools:= )
  24. "
  25. RDEPEND="${DEPEND}"
  26. S="${WORKDIR}/${MY_P}"
  27. PATCHES=( "${FILESDIR}/${PN}-1.2.0-rpath.patch" )
  28. pkg_setup() {
  29. enewgroup maxscale
  30. enewuser maxscale -1 -1 -1 maxscale
  31. }
  32. src_configure() {
  33. # -DEMBEDDED_LIB=/usr/$(get_libdir)/mysql
  34. local mycmakeargs=(
  35. -DSTATIC_EMBEDDED=OFF
  36. -DWITH_SCRIPTS=OFF
  37. $(cmake-utils_use_with jemalloc JEMALLOC)
  38. $(cmake-utils_use_build rabbitmq RABBITMQ)
  39. $(cmake-utils_use_with tcmalloc TCMALLOC)
  40. -DMODULE_INSTALL_PATH=$(get_libdir)/${PN}
  41. )
  42. cmake-utils_src_configure
  43. }
  44. src_install() {
  45. local DOCS=( README README.md "${BUILD_DIR}"/Changelog.txt "${BUILD_DIR}"/ReleaseNotes.txt )
  46. cmake-utils_src_install
  47. # Remove badly placed documents
  48. rm "${D}usr/share/${PN}/README" "${D}usr/share/${PN}/Changelog.txt" \
  49. "${D}usr/share/${PN}/LICENSE" "${D}usr/share/${PN}/COPYRIGHT" \
  50. "${D}usr/share/${PN}/ReleaseNotes.txt" || die
  51. newinitd "${FILESDIR}/${PN}-init.d" ${PN}
  52. keepdir /var/log/maxscale /var/lib/maxscale/data \
  53. /var/cache/maxscale
  54. fowners maxscale:maxscale /var/log/maxscale \
  55. /var/lib/maxscale/data \
  56. /var/lib/maxscale \
  57. /var/cache/maxscale
  58. }