Gentoo Archives: gentoo-commits

From: "Göktürk Yüksek" <gokturk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/filebeat/, app-admin/filebeat/files/
Date: Thu, 01 Dec 2016 04:20:42
Message-Id: 1480565885.71e932ff5637ded89cbe185fed323337dddeb84c.gokturk@gentoo
1 commit: 71e932ff5637ded89cbe185fed323337dddeb84c
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Sun Nov 6 06:27:49 2016 +0000
4 Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 1 04:18:05 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71e932ff
7
8 app-admin/filebeat: version bump to 5.0.0
9
10 app-admin/filebeat/Manifest | 1 +
11 app-admin/filebeat/filebeat-5.0.0.ebuild | 65 ++++++++++++++++++++++++++++++
12 app-admin/filebeat/files/filebeat.confd-r1 | 15 +++++++
13 app-admin/filebeat/files/filebeat.initd-r1 | 50 +++++++++++++++++++++++
14 4 files changed, 131 insertions(+)
15
16 diff --git a/app-admin/filebeat/Manifest b/app-admin/filebeat/Manifest
17 index d9e426f..dc72c57 100644
18 --- a/app-admin/filebeat/Manifest
19 +++ b/app-admin/filebeat/Manifest
20 @@ -1 +1,2 @@
21 DIST filebeat-1.3.1.tar.gz 10225540 SHA256 1d8e41b42a0b2dd59403795ff07cbfd8a9a76477731c38122aa9242b47b054e0 SHA512 60f6d4ae93bb01e74311d7ccc3d367707f888f58898b89a0ea7512c96b6e1369edf7dc2afe3615df97e8c311629d9fc1e9fc2f1abe8edcbb5bc5bcf47c82107c WHIRLPOOL 608b825fa4dc99d792deb9d23672eea0e66318461adb944dc484d42edc3d3acb1cf1f65cd4024cf0437dd5e5ed088ff5b5aeec967f7efad03b82f259793410f0
22 +DIST filebeat-5.0.0.tar.gz 15736495 SHA256 3e6b7cf2ee5f52e78ae87ef04ab9dd49977c89f86a09416586896aeaea844e34 SHA512 0838fb5e04d2266b15a6f21ebf1109626b60591a9154f4bb11cde73ae127a7695defb1e238a115ab59e0a7441bd9fa5642d4eb924663f00467b715224a3fa076 WHIRLPOOL a2b39bccfb45a32a25de9ae32ad881cd79e7a854280d6eb17614f4c274e9f92d956f8b811e6ff6371d16e7d723a98c59e82906d90029a25d079b33089142df5f
23
24 diff --git a/app-admin/filebeat/filebeat-5.0.0.ebuild b/app-admin/filebeat/filebeat-5.0.0.ebuild
25 new file mode 100644
26 index 00000000..34c08b5
27 --- /dev/null
28 +++ b/app-admin/filebeat/filebeat-5.0.0.ebuild
29 @@ -0,0 +1,65 @@
30 +# Copyright 1999-2016 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +# $Id$
33 +
34 +EAPI=6
35 +
36 +DESCRIPTION="Lightweight log shipper for Logstash and Elasticsearch"
37 +HOMEPAGE="https://www.elastic.co/products/beats"
38 +SRC_URI="https://github.com/elastic/beats/archive/v${PV}.tar.gz -> ${P}.tar.gz"
39 +
40 +LICENSE="Apache-2.0"
41 +SLOT="0"
42 +KEYWORDS="~amd64"
43 +
44 +DEPEND="dev-lang/go"
45 +RDEPEND="!app-admin/filebeat-bin"
46 +
47 +ELASTIC="${WORKDIR}/src/github.com/elastic"
48 +BEATS="${ELASTIC}/beats"
49 +S="${BEATS}"
50 +
51 +src_unpack() {
52 + mkdir -p "${ELASTIC}" || die
53 + unpack ${P}.tar.gz
54 + mv beats-${PV} "${BEATS}" || die
55 +}
56 +
57 +src_compile() {
58 + cd ${BEATS}/filebeat || die
59 + GOPATH="${WORKDIR}" emake
60 +}
61 +
62 +src_install() {
63 + keepdir /var/{lib,log}/${PN}
64 +
65 + fperms 0750 /var/{lib,log}/${PN}
66 +
67 + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
68 + newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
69 +
70 + insinto "/usr/share/doc/${PF}/examples"
71 + doins ${PN}/{filebeat.yml,filebeat.full.yml}
72 +
73 + insinto "/etc/${PN}"
74 + doins ${PN}/{filebeat.template.json,filebeat.template-es2x.json}
75 +
76 + exeinto "/usr/share/${PN}"
77 + doexe libbeat/scripts/migrate_beat_config_1_x_to_5_0.py
78 +
79 + dobin filebeat/filebeat
80 +}
81 +
82 +pkg_postinst() {
83 + if [[ -n "${REPLACING_VERSIONS}" ]]; then
84 + elog "Please read the migration guide at:"
85 + elog "https://www.elastic.co/guide/en/beats/libbeat/5.0/upgrading.html"
86 + elog ""
87 + elog "The migration script:"
88 + elog "${EROOT%/}/usr/share/filebeat/migrate_beat_config_1_x_to_5_0.py"
89 + elog ""
90 + fi
91 +
92 + elog "Example configurations:"
93 + elog "${EROOT%/}/usr/share/doc/${PF}/examples"
94 +}
95
96 diff --git a/app-admin/filebeat/files/filebeat.confd-r1 b/app-admin/filebeat/files/filebeat.confd-r1
97 new file mode 100644
98 index 00000000..2fcf41a
99 --- /dev/null
100 +++ b/app-admin/filebeat/files/filebeat.confd-r1
101 @@ -0,0 +1,15 @@
102 +# Run filebeat under this user/group
103 +#FILEBEAT_USER=""
104 +#FILEBEAT_GROUP=""
105 +
106 +# Configuration path
107 +#FILEBEAT_CONFIG=""
108 +
109 +# Path to data directory
110 +#FILEBEAT_DATADIR=""
111 +
112 +# Path to log directory
113 +#FILEBEAT_LOGDIR=""
114 +
115 +# Additional arguments passed to filebeat
116 +#FILEBEAT_OPTS=""
117
118 diff --git a/app-admin/filebeat/files/filebeat.initd-r1 b/app-admin/filebeat/files/filebeat.initd-r1
119 new file mode 100644
120 index 00000000..cec6142
121 --- /dev/null
122 +++ b/app-admin/filebeat/files/filebeat.initd-r1
123 @@ -0,0 +1,50 @@
124 +#!/sbin/openrc-run
125 +# Copyright 1999-2016 Gentoo Foundation
126 +# Distributed under the terms of the GNU General Public License v2
127 +
128 +FILEBEAT_USER="${FILEBEAT_USER:-root}"
129 +FILEBEAT_GROUP="${FILEBEAT_GROUP:-root}"
130 +FILEBEAT_CONFIG="${FILEBEAT_CONFIG:-/etc/filebeat/filebeat.yml}"
131 +FILEBEAT_DATADIR="${FILEBEAT_DATADIR:-/var/lib/filebeat}"
132 +FILEBEAT_LOGDIR="${FILEBEAT_LOGDIR:-/var/log/filebeat}"
133 +FILEBEAT_OPTS="${FILEBEAT_OPTS:-}"
134 +
135 +command="/usr/bin/filebeat"
136 +command_args="-c ${FILEBEAT_CONFIG} ${FILEBEAT_OPTS} -path.config $(dirname $FILEBEAT_CONFIG) \
137 + -path.data ${FILEBEAT_DATADIR} -path.home ${FILEBEAT_DATADIR} -path.logs ${FILEBEAT_LOGDIR}"
138 +extra_commands="checkconfig"
139 +command_background="true"
140 +start_stop_daemon_args="--user ${FILEBEAT_USER}:${FILEBEAT_GROUP} \
141 + --chdir ${FILEBEAT_DATADIR}"
142 +pidfile="/run/filebeat/filebeat.pid"
143 +
144 +depend() {
145 + use net
146 + after elasticsearch
147 +}
148 +
149 +checkconfig() {
150 + if [[ ! -e ${FILEBEAT_CONFIG} ]]; then
151 + eend "Please create a configuration file at ${FILEBEAT_CONFIG}"
152 + return 1
153 + fi
154 +
155 + ebegin "Checking your configuration"
156 + ${command} ${command_args} -configtest
157 + eend $? "Configuration error. Please fix your configuration files."
158 +}
159 +
160 +start_pre() {
161 + checkconfig || return 1
162 +
163 + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "$(dirname "${pidfile}")"
164 + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "${FILEBEAT_DATADIR}"
165 + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "${FILEBEAT_LOGDIR}"
166 +}
167 +
168 +stop() {
169 + ebegin "Stopping filebeat"
170 + start-stop-daemon --stop \
171 + --pidfile=${pidfile} \
172 + --retry=TERM/5/KILL/5
173 +}