app-admin/logstash-bin: bump to 5.6.4
[gentoo.git] / app-admin / logstash-bin / logstash-bin-5.6.3.ebuild
1 # Copyright 1999-2017 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="https://artifacts.elastic.co/downloads/${MY_PN}/${MY_P}.zip"
14
15 # source: LICENSE.txt and NOTICE.txt
16 LICENSE="Apache-2.0 MIT"
17 SLOT="0"
18 KEYWORDS="~amd64"
19
20 RESTRICT="strip"
21 QA_PREBUILT="opt/logstash/vendor/jruby/lib/jni/*/libjffi*.so"
22
23 RDEPEND="virtual/jre:1.8"
24
25 S="${WORKDIR}/${MY_P}"
26
27 pkg_setup() {
28         enewgroup ${MY_PN}
29         enewuser ${MY_PN} -1 -1 /var/lib/${MY_PN} ${MY_PN}
30 }
31
32 src_install() {
33         keepdir /etc/"${MY_PN}"/{conf.d,patterns,plugins}
34         keepdir "/var/lib/${MY_PN}"
35         keepdir "/var/log/${MY_PN}"
36
37         insinto "/usr/share/${MY_PN}"
38         newins "${FILESDIR}/agent.conf.sample" agent.conf
39
40         rm -v config/startup.options || die
41         insinto /etc/${MY_PN}
42         doins config/*
43         rm -rv config data || die
44
45         insinto "/opt/${MY_PN}"
46         doins -r .
47         fperms 0755 "/opt/${MY_PN}/bin/${MY_PN}" "/opt/${MY_PN}/vendor/jruby/bin/jruby" "/opt/${MY_PN}/bin/logstash-plugin"
48
49         newconfd "${FILESDIR}/${MY_PN}.confd-r1" "${MY_PN}"
50         newinitd "${FILESDIR}/${MY_PN}.initd-r1" "${MY_PN}"
51
52         insinto /usr/share/eselect/modules
53         doins "${FILESDIR}"/logstash-plugin.eselect
54 }
55
56 pkg_postinst() {
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."
59         ewarn
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."
62         ewarn
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."
66         einfo
67         einfo "Installing plugins:"
68         einfo "eselect logstash-plugin install logstash-output-gelf"
69         einfo
70
71         einfo "Reinstalling self installed plugins (installed via eselect module):"
72         eselect logstash-plugin reinstall
73
74         einfo
75         einfo "Sample configuration:"
76         einfo "${EROOT%/}/usr/share/${MY_PN}"
77 }