diff options
Diffstat (limited to 'app-admin')
-rw-r--r-- | app-admin/filebeat/Manifest | 3 | ||||
-rw-r--r-- | app-admin/filebeat/filebeat-6.0.0.ebuild | 60 | ||||
-rw-r--r-- | app-admin/filebeat/files/filebeat.initd.1 | 43 |
3 files changed, 105 insertions, 1 deletions
diff --git a/app-admin/filebeat/Manifest b/app-admin/filebeat/Manifest index e7aa9e2ca53e..c97deb69a4fb 100644 --- a/app-admin/filebeat/Manifest +++ b/app-admin/filebeat/Manifest @@ -1,2 +1,3 @@ DIST filebeat-5.5.2.tar.gz 18075191 SHA256 39e792324a35fe84ef9a63cd5324252bc71d1c665188e8d597e12ca170cfde7a SHA512 ad92b41a9ceaad6c6e6fc80d0adccd7fe03a7056d121484bcf35c6a46b2061a5ef6d32121dd12d59b51e7678769da5c405b1d549fa130631ae3f1989b78fba48 WHIRLPOOL 46d182bd339abd26f3c4cf3f8d3a716180fc00147458f571eec34aefcaa67d9e88a561988e37c47083528024e4e0559b255c7a17efa43e0e4b21b653a575f7fd -DIST filebeat-5.6.4.tar.gz 18145215 SHA256 c06f913af79bb54825483ba0ed4b31752db5784daf3717f53d83b6b12890c0a4 SHA512 1ae66b7dd81f04434d667ecc295a747f8c650ba1affb88d7ae358051c739634b75c64d9c52d55fe6ee0b65848ff1825e508426c03d7e822517f55602091e186a WHIRLPOOL 37dbff315872dbbd5237aec2e32004a962b3f729f53d77e1f4cf86a094b2c0673499a408483c9a9be2be1521097f5dedb244c340fd05fe700b9d40291e83e58b +DIST filebeat-5.6.4.tar.gz 18145215 BLAKE2B ff5c848a87365fd9c592a2a10d852cdca2e32206827c26e8f631c35015623c8fb85c49799d6bae91877a0d7e718f316856e8cf8833ef29694c7d1cef5d86b47c SHA512 1ae66b7dd81f04434d667ecc295a747f8c650ba1affb88d7ae358051c739634b75c64d9c52d55fe6ee0b65848ff1825e508426c03d7e822517f55602091e186a +DIST filebeat-6.0.0.tar.gz 15118739 BLAKE2B 5b4e4998c98c52f65ad239a1002e499e042a37ccd4d53acc21c3647bbc9fc7dee913c7c3393684eccc962892d93d4ff62a91957888a46f38b8b3430c11d99c42 SHA512 6dbeecb640fe2e39b81be90fdd05d03c1b3ffddd20ef06ab7c51805eede82035a8d0a00de3132edb77594383095bd5e7a79609e3bdf3d62377140cde7ed3fcd7 diff --git a/app-admin/filebeat/filebeat-6.0.0.ebuild b/app-admin/filebeat/filebeat-6.0.0.ebuild new file mode 100644 index 000000000000..3b7aa080920a --- /dev/null +++ b/app-admin/filebeat/filebeat-6.0.0.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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 ~x86" + +DEPEND=">=dev-lang/go-1.8.3" +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_test() { + cd ${BEATS}/filebeat || die + GOPATH="${WORKDIR}" emake check +} + +src_install() { + keepdir /var/{lib,log}/${PN} + + fperms 0750 /var/{lib,log}/${PN} + + newconfd "${FILESDIR}/${PN}.confd" ${PN} + newinitd "${FILESDIR}/${PN}.initd.1" ${PN} + + insinto "/usr/share/doc/${PF}/examples" + doins ${PN}/{filebeat.yml,filebeat.reference.yml} + + dobin filebeat/filebeat +} + +pkg_postinst() { + if [[ -n "${REPLACING_VERSIONS}" ]]; then + elog "Please read the migration guide at:" + elog "https://www.elastic.co/guide/en/beats/libbeat/6.0/upgrading.html" + elog "" + fi + + elog "Example configurations:" + elog "${EROOT%/}/usr/share/doc/${PF}/examples" +} diff --git a/app-admin/filebeat/files/filebeat.initd.1 b/app-admin/filebeat/files/filebeat.initd.1 new file mode 100644 index 000000000000..2cb33ba8ebc0 --- /dev/null +++ b/app-admin/filebeat/files/filebeat.initd.1 @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 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_DATADIR="${FILEBEAT_DATADIR:-/var/lib/filebeat}" +FILEBEAT_LOGDIR="${FILEBEAT_LOGDIR:-/var/log/filebeat}" +FILEBEAT_OPTS="${FILEBEAT_OPTS:-}" + +command="/usr/bin/filebeat" +command_args="-c ${FILEBEAT_CONFIG} ${FILEBEAT_OPTS} -path.config $(dirname $FILEBEAT_CONFIG) \ + -path.data ${FILEBEAT_DATADIR} -path.home ${FILEBEAT_DATADIR} -path.logs ${FILEBEAT_LOGDIR}" +command_background="true" +command_user="${FILEBEAT_USER}:${FILEBEAT_GROUP}" +extra_commands="checkconfig" +pidfile="/run/filebeat.pid" +retry="TERM/5/KILL/5" +start_stop_daemon_args="--chdir ${FILEBEAT_DATADIR}" + +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} test config + eend $? "Configuration error. Please fix your configuration files." +} + +start_pre() { + checkconfig || return 1 + + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "${FILEBEAT_DATADIR}" + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "${FILEBEAT_LOGDIR}" +} |