graylog2-2.1.2.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit user
  5. DESCRIPTION="Free and open source log management"
  6. HOMEPAGE="https://graylog.org"
  7. SRC_URI="https://packages.graylog2.org/releases/graylog/graylog-${PV}.tgz"
  8. LICENSE="GPL-3"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~ppc64 ~x86"
  11. IUSE=""
  12. MY_PN="graylog"
  13. S="${WORKDIR}/${MY_PN}-${PV}"
  14. QA_PREBUILT="/usr/share/graylog2/lib/sigar/libsigar*"
  15. RESTRICT="strip"
  16. DEPEND=""
  17. RDEPEND="virtual/jdk:1.8"
  18. INSTALL_DIR="/usr/share/graylog2"
  19. pkg_setup() {
  20. enewgroup graylog
  21. enewuser graylog -1 -1 -1 graylog
  22. }
  23. src_prepare() {
  24. default
  25. # graylogctl is replaced by our own initd
  26. rm -r bin
  27. # Stick to architecture of build host
  28. if ! use amd64; then
  29. rm -r lib/sigar/libsigar-amd64-*.so || die "Failed in removing AMD64 support libraries"
  30. fi
  31. if ! use ppc64; then
  32. rm -r lib/sigar/libsigar-ppc64-*.so || die "Failed in removing PPC64 support libraries"
  33. fi
  34. if ! use x86; then
  35. rm -r lib/sigar/libsigar-x86-*.so || die "Failed in removing X86 support libraries"
  36. fi
  37. # Currently unsupported platforms
  38. # QA warning galore but testing/patches welcome
  39. rm -r lib/sigar/libsigar-ia64-*.so || die "Failed in removing IA64 support libraries"
  40. rm -r lib/sigar/libsigar-ppc-*.so || die "Failed in removing PPC support libraries"
  41. rm -r lib/sigar/libsigar-*-freebsd-*.so || die "Failed in removing FreeBSD support libraries"
  42. rm -r lib/sigar/libsigar-pa-*.sl || die "Failed in removing HPPA support libraries"
  43. rm -r lib/sigar/libsigar-*-solaris.so || die "Failed in removing Solaris support libraries"
  44. }
  45. src_compile() {
  46. einfo "Nothing to compile; upstream supplies JAR only"
  47. }
  48. src_install() {
  49. insinto /etc/graylog2
  50. doins graylog.conf.example
  51. insinto "${INSTALL_DIR}"
  52. doins *
  53. newinitd "${FILESDIR}/initd" graylog2
  54. newconfd "${FILESDIR}/confd" graylog2
  55. }