app-admin/logstash-bin: drop old
[gentoo.git] / app-admin / logstash-bin / logstash-bin-6.3.2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit java-pkg-2 user
7
8 MY_PN="${PN%-bin}"
9 MY_P="${MY_PN}-${PV}"
10
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 )"
15
16 # source: LICENSE.txt and NOTICE.txt
17 LICENSE="Apache-2.0 MIT x-pack? ( Elastic )"
18 SLOT="0"
19 KEYWORDS="~amd64"
20 IUSE="x-pack"
21
22 RESTRICT="strip"
23 QA_PREBUILT="opt/logstash/vendor/jruby/lib/jni/*/libjffi*.so"
24
25 RDEPEND="virtual/jre:1.8"
26
27 S="${WORKDIR}/${MY_P}"
28
29 pkg_setup() {
30         enewgroup ${MY_PN}
31         enewuser ${MY_PN} -1 -1 /var/lib/${MY_PN} ${MY_PN}
32 }
33
34 src_install() {
35         keepdir /etc/"${MY_PN}"/{conf.d,patterns,plugins}
36         keepdir "/var/lib/${MY_PN}"
37         keepdir "/var/log/${MY_PN}"
38
39         insinto "/usr/share/${MY_PN}"
40         newins "${FILESDIR}/agent.conf.sample" agent.conf
41
42         rm -v config/{pipelines.yml,startup.options} || die
43         insinto /etc/${MY_PN}
44         doins -r config/.
45         doins "${FILESDIR}/pipelines.yml"
46         rm -rv config data || die
47
48         insinto "/opt/${MY_PN}"
49         doins -r .
50         fperms 0755 "/opt/${MY_PN}/bin/${MY_PN}" "/opt/${MY_PN}/vendor/jruby/bin/jruby" "/opt/${MY_PN}/bin/logstash-plugin"
51
52         newconfd "${FILESDIR}/${MY_PN}.confd-r2" "${MY_PN}"
53         newinitd "${FILESDIR}/${MY_PN}.initd-r2" "${MY_PN}"
54
55         insinto /usr/share/eselect/modules
56         doins "${FILESDIR}"/logstash-plugin.eselect
57 }
58
59 pkg_postinst() {
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."
63         elog
64         elog "Installing plugins:"
65         elog "eselect logstash-plugin install logstash-output-gelf"
66         elog
67
68         elog "Reinstalling self installed plugins (installed via eselect module):"
69         eselect logstash-plugin reinstall
70
71         elog
72         elog "Sample configuration:"
73         elog "${EROOT%/}/usr/share/${MY_PN}"
74         elog
75         elog "The default pipeline configuration expects the configuration(s) to be found in:"
76         elog "${EROOT%/}/etc/logstash/conf.d/*.conf"
77 }