1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit java-pkg-2 user
11 DESCRIPTION="Tool for managing events and logs"
12 HOMEPAGE="https://www.elastic.co/products/logstash"
13 SRC_URI="x-pack? ( https://artifacts.elastic.co/downloads/${MY_PN}/${MY_P}.tar.gz )
14 !x-pack? ( https://artifacts.elastic.co/downloads/${MY_PN}/${MY_PN}-oss-${PV}.tar.gz )"
16 # source: LICENSE.txt and NOTICE.txt
17 LICENSE="Apache-2.0 MIT x-pack? ( Elastic )"
23 QA_PREBUILT="opt/logstash/vendor/jruby/lib/jni/*/libjffi*.so"
25 RDEPEND="virtual/jre:1.8"
27 S="${WORKDIR}/${MY_P}"
31 enewuser ${MY_PN} -1 -1 /var/lib/${MY_PN} ${MY_PN}
35 keepdir /etc/"${MY_PN}"/{conf.d,patterns,plugins}
36 keepdir "/var/lib/${MY_PN}"
37 keepdir "/var/log/${MY_PN}"
39 insinto "/usr/share/${MY_PN}"
40 newins "${FILESDIR}/agent.conf.sample" agent.conf
42 rm -v config/{pipelines.yml,startup.options} || die
45 doins "${FILESDIR}/pipelines.yml"
46 rm -rv config data || die
48 insinto "/opt/${MY_PN}"
50 fperms 0755 "/opt/${MY_PN}/bin/${MY_PN}" "/opt/${MY_PN}/vendor/jruby/bin/jruby" "/opt/${MY_PN}/bin/logstash-plugin"
52 newconfd "${FILESDIR}/${MY_PN}.confd-r2" "${MY_PN}"
53 newinitd "${FILESDIR}/${MY_PN}.initd-r2" "${MY_PN}"
55 insinto /usr/share/eselect/modules
56 doins "${FILESDIR}"/logstash-plugin.eselect
60 ewarn "Self installed plugins are removed during Logstash upgrades (Bug #622602)"
61 ewarn "Install the plugins via eselect module that will automatically re-install"
62 ewarn "all self installed plugins after Logstash upgrades."
64 elog "Installing plugins:"
65 elog "eselect logstash-plugin install logstash-output-gelf"
68 elog "Reinstalling self installed plugins (installed via eselect module):"
69 eselect logstash-plugin reinstall
72 elog "Sample configuration:"
73 elog "${EROOT%/}/usr/share/${MY_PN}"
75 elog "The default pipeline configuration expects the configuration(s) to be found in:"
76 elog "${EROOT%/}/etc/logstash/conf.d/*.conf"