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="https://artifacts.elastic.co/downloads/${MY_PN}/${MY_P}.zip"
15 # source: LICENSE.txt and NOTICE.txt
16 LICENSE="Apache-2.0 MIT"
21 QA_PREBUILT="opt/logstash/vendor/jruby/lib/jni/*/libjffi*.so"
23 RDEPEND="virtual/jre:1.8"
25 S="${WORKDIR}/${MY_P}"
29 enewuser ${MY_PN} -1 -1 /var/lib/${MY_PN} ${MY_PN}
33 keepdir /etc/"${MY_PN}"/{conf.d,patterns,plugins}
34 keepdir "/var/lib/${MY_PN}"
35 keepdir "/var/log/${MY_PN}"
37 insinto "/usr/share/${MY_PN}"
38 newins "${FILESDIR}/agent.conf.sample" agent.conf
40 rm -v config/startup.options || die
43 rm -rv config data || die
45 insinto "/opt/${MY_PN}"
47 fperms 0755 "/opt/${MY_PN}/bin/${MY_PN}" "/opt/${MY_PN}/vendor/jruby/bin/jruby" "/opt/${MY_PN}/bin/logstash-plugin"
49 newconfd "${FILESDIR}/${MY_PN}.confd-r1" "${MY_PN}"
50 newinitd "${FILESDIR}/${MY_PN}.initd-r1" "${MY_PN}"
52 insinto /usr/share/eselect/modules
53 doins "${FILESDIR}"/logstash-plugin.eselect
57 ewarn "The default pidfile directory has been changed from /run/logstash to /run."
58 ewarn "Please ensure any running logstash processes are shut down cleanly."
60 ewarn "The default data directory has been moved from /opt/logstash/data to"
61 ewarn "/var/lib/logstash/data. Please check and move its contents as necessary."
63 ewarn "Self installed plugins are removed during Logstash upgrades (Bug #622602)"
64 ewarn "Install the plugins via eselect module that will automatically re-install"
65 ewarn "all self installed plugins after Logstash upgrades."
67 einfo "Installing plugins:"
68 einfo "eselect logstash-plugin install logstash-output-gelf"
71 einfo "Reinstalling self installed plugins (installed via eselect module):"
72 eselect logstash-plugin reinstall
75 einfo "Sample configuration:"
76 einfo "${EROOT%/}/usr/share/${MY_PN}"