diff options
Diffstat (limited to 'app-admin/filebeat')
-rw-r--r-- | app-admin/filebeat/Manifest | 5 | ||||
-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, 107 insertions, 1 deletions
diff --git a/app-admin/filebeat/Manifest b/app-admin/filebeat/Manifest index 8e5389d6d586..d9b06a876fc9 100644 --- a/app-admin/filebeat/Manifest +++ b/app-admin/filebeat/Manifest @@ -1,7 +1,10 @@ AUX filebeat.confd 269 BLAKE2B f9cc2a3d96be870d755c41606a274e94d6f6a2a5be71aeb3fc10f989d58b1bb5cc3683b38ede75f7e34937daa4189eccdd30c306b20e219c91bc90ac22d21b40 SHA512 89f2a8ead476750b3fd9a94dcc84311503907e78e66c70d151f27c7fdc8835e7bae6667a6aed0b6470a8f9b42c850396973fd09b1b6aec2d170e3774c8cfddff AUX filebeat.initd 1388 BLAKE2B 2a427750a15e6910344dee1d2707773b01961360ae3a7e3337a761b759b2c9fcd9a914385e8ff6292841ad6c07781af3b5cf059f1338a6f2f33bda576bb125cc SHA512 9b08635b9ba6e180881780de0fa9d6c8c1b2e7496fc803c2b38127fee13d13ca5d00792132cdc8bd4073018e3f6e374d4164a86e450a1dbeb68b2694fa0dbb12 +AUX filebeat.initd.1 1388 BLAKE2B 6ca4f3f4d50bba2a036a35b8e74bfa92d5b03ccaf8548df215d3d68ba9a2eaf9e2996374d49011f9e4380bc59f6307e262eee1367801bfb8279eb0b1639b83c4 SHA512 374b466b39feb832b414d0491510190758007079b6c865823878db00d5c17235f657deb0822066f124e3f07616dc4ff3237e87f6f35785e071815ec4e533b1dd 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 EBUILD filebeat-5.5.2.ebuild 1646 BLAKE2B 37f6ac540ed27b471021be5666233d00ceacdcbdf6a32954c5987fa85c957223d84536dd5c0e93bf6acd988b01a061008cffff005806d8b2d8cee7f722884f33 SHA512 4b36e36a4f95c893bca863c4510e903f6265e4950fa000cae61896915c558beb4d8c4b10d8aa78d154bef7eb67886628f499153f988ff66e5b1066cb949b2029 EBUILD filebeat-5.6.4.ebuild 1647 BLAKE2B 85c4d12afa9a40f972ea2521c38f905de1f0d2546a96b54999db6dce650a49e6e7cf6682f76b9b3b4523c720e52a85c1002dc3f39bb11f59a292653734486cbc SHA512 b64da8481ef50ffc13f51dc82ae0d4cf0101b6b27f502e3341a6513d62984c23b31bcf0ca0f8c4a214f133b19c4eb73d83dcb5ad0c73dc54d8a8131caf866c9c +EBUILD filebeat-6.0.0.ebuild 1337 BLAKE2B f3442e1b92e856b00352873630a9846430c83e5d02c564c87ba4a0b1392f82d5e49e2b24144df9fed7dfd38f271d59b0f7d69fbbd444695f8e09f64a2c22fed4 SHA512 0dd483c416b765fb6c7ca70a7ae14767bcc88e482c7201c54c09a96c035a3eb6b3c62da6120a66cc14f16f5299cb1e33d2a25105b72fa4b251634858e9ddd08e MISC metadata.xml 461 BLAKE2B 8bd064daf5ee2d3fe746a73bf36f01926fee1f9796b29499a7fb1db844aface3be7dfd137ed31f606e78834c1d7a135d0119f400244ba33ce3feb81fa792eb6e SHA512 903c43c9cf4b371e34afffd0b425086d5fba6f37af0d761fc0065d114dc843ea0dcdd439682e48749bdf2f9138bfc3dc6cfcc6490503daeb7a71ce5706a779d8 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}" +} |