summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mozes <hydrapolic@gmail.com>2016-10-18 11:49:07 +0200
committerPatrice Clement <monsieurp@gentoo.org>2016-10-24 13:25:43 +0200
commit1ed462767bda5e7dcae6e78006cf150feca2d636 (patch)
tree8333ecf52ca00401a125f40fca08fd6914c34c3d /app-admin/filebeat
parentprofiles/features/prefix/make.defaults: disable user* features. (diff)
downloadgentoo-1ed462767bda5e7dcae6e78006cf150feca2d636.tar.gz
gentoo-1ed462767bda5e7dcae6e78006cf150feca2d636.tar.bz2
gentoo-1ed462767bda5e7dcae6e78006cf150feca2d636.zip
app-admin/filebeat: new package.
Filebeat is part of the Beats family by Elasticsearch. It's a lightweight log forwarder to Logstash & Elasticsearch. We already have a binary version of the package in tree, but this non-binary should eventually remove it. Package-Manager: portage-2.3.1 Closes: https://github.com/gentoo/gentoo/pull/2585 Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
Diffstat (limited to 'app-admin/filebeat')
-rw-r--r--app-admin/filebeat/Manifest1
-rw-r--r--app-admin/filebeat/filebeat-1.3.1.ebuild46
-rw-r--r--app-admin/filebeat/files/filebeat.confd12
-rw-r--r--app-admin/filebeat/files/filebeat.initd47
-rw-r--r--app-admin/filebeat/metadata.xml15
5 files changed, 121 insertions, 0 deletions
diff --git a/app-admin/filebeat/Manifest b/app-admin/filebeat/Manifest
new file mode 100644
index 000000000000..d9e426fc89d0
--- /dev/null
+++ b/app-admin/filebeat/Manifest
@@ -0,0 +1 @@
+DIST filebeat-1.3.1.tar.gz 10225540 SHA256 1d8e41b42a0b2dd59403795ff07cbfd8a9a76477731c38122aa9242b47b054e0 SHA512 60f6d4ae93bb01e74311d7ccc3d367707f888f58898b89a0ea7512c96b6e1369edf7dc2afe3615df97e8c311629d9fc1e9fc2f1abe8edcbb5bc5bcf47c82107c WHIRLPOOL 608b825fa4dc99d792deb9d23672eea0e66318461adb944dc484d42edc3d3acb1cf1f65cd4024cf0437dd5e5ed088ff5b5aeec967f7efad03b82f259793410f0
diff --git a/app-admin/filebeat/filebeat-1.3.1.ebuild b/app-admin/filebeat/filebeat-1.3.1.ebuild
new file mode 100644
index 000000000000..12dee30f9907
--- /dev/null
+++ b/app-admin/filebeat/filebeat-1.3.1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+DESCRIPTION="Lightweight log shipper for Logstash and Elasticsearch"
+HOMEPAGE="https://www.elastic.co/products/beats"
+SRC_URI="https://github.com/elastic/beats/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="dev-lang/go"
+RDEPEND="!app-admin/filebeat-bin"
+
+ELASTIC="${WORKDIR}/src/github.com/elastic"
+BEATS="${ELASTIC}/beats"
+S="${BEATS}"
+
+src_unpack() {
+ mkdir -p "${ELASTIC}" || die
+ unpack ${P}.tar.gz
+ mv beats-${PV} "${BEATS}" || die
+}
+
+src_compile() {
+ cd ${BEATS}/filebeat || die
+ GOPATH="${WORKDIR}" emake
+}
+
+src_install() {
+ keepdir /etc/${PN}
+ keepdir /var/lib/${PN}
+
+ fperms 0750 /var/lib/${PN}
+
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+
+ insinto /etc/${PN}
+ newins ${PN}/etc/${PN}.yml ${PN}.yml.example
+
+ dobin filebeat/filebeat
+}
diff --git a/app-admin/filebeat/files/filebeat.confd b/app-admin/filebeat/files/filebeat.confd
new file mode 100644
index 000000000000..88b7408d7bb0
--- /dev/null
+++ b/app-admin/filebeat/files/filebeat.confd
@@ -0,0 +1,12 @@
+# Run filebeat under this user/group
+#FILEBEAT_USER=""
+#FILEBEAT_GROUP=""
+
+# Configuration path
+#FILEBEAT_CONFIG=""
+
+# Path to state directory
+#FILEBEAT_STATEDIR=""
+
+# Additional arguments passed to filebeat
+#FILEBEAT_OPTS=""
diff --git a/app-admin/filebeat/files/filebeat.initd b/app-admin/filebeat/files/filebeat.initd
new file mode 100644
index 000000000000..3eb2fcafbf8b
--- /dev/null
+++ b/app-admin/filebeat/files/filebeat.initd
@@ -0,0 +1,47 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+FILEBEAT_USER="${FILEBEAT_USER:-root}"
+FILEBEAT_GROUP="${FILEBEAT_GROUP:-root}"
+FILEBEAT_CONFIG="${FILEBEAT_CONFIG:-/etc/filebeat/filebeat.yml}"
+FILEBEAT_STATEDIR="${FILEBEAT_STATEDIR:-/var/lib/filebeat}"
+FILEBEAT_OPTS="${FILEBEAT_OPTS:-}"
+
+command="/usr/bin/filebeat"
+command_args="-c ${FILEBEAT_CONFIG} ${FILEBEAT_OPTS}"
+extra_commands="checkconfig"
+command_background="true"
+start_stop_daemon_args="--user ${FILEBEAT_USER}:${FILEBEAT_GROUP} \
+ --chdir ${FILEBEAT_STATEDIR}"
+pidfile="/run/filebeat/filebeat.pid"
+
+depend() {
+ use net
+ after elasticsearch
+}
+
+checkconfig() {
+ if [[ ! -e ${FILEBEAT_CONFIG} ]]; then
+ eend "Please create a configuration file at ${FILEBEAT_CONFIG}"
+ return 1
+ fi
+
+ ebegin "Checking your configuration"
+ ${command} ${command_args} -configtest
+ eend $? "Configuration error. Please fix your configuration files."
+}
+
+start_pre() {
+ checkconfig || return 1
+
+ checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "$(dirname "${pidfile}")"
+ checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "${FILEBEAT_STATEDIR}"
+}
+
+stop() {
+ ebegin "Stopping filebeat"
+ start-stop-daemon --stop \
+ --pidfile=${pidfile} \
+ --retry=TERM/5/KILL/5
+}
diff --git a/app-admin/filebeat/metadata.xml b/app-admin/filebeat/metadata.xml
new file mode 100644
index 000000000000..cd032aa33d27
--- /dev/null
+++ b/app-admin/filebeat/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hydrapolic@gmail.com</email>
+ <name>Tomáš Mózes</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">elastic/beats</remote-id>
+ </upstream>
+</pkgmetadata>