diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2018-03-30 16:31:08 +0200 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2018-03-30 16:31:08 +0200 |
commit | 12478f60d64e9f5a8762ee284e1e4fb6e639b8b5 (patch) | |
tree | 92806202c147e3ed2baee64d10e788fea2ae289a /app-metrics | |
parent | app-metrics/node_exporter: Fix Manifest (diff) | |
download | gentoo-12478f60d64e9f5a8762ee284e1e4fb6e639b8b5.tar.gz gentoo-12478f60d64e9f5a8762ee284e1e4fb6e639b8b5.tar.bz2 gentoo-12478f60d64e9f5a8762ee284e1e4fb6e639b8b5.zip |
app-metrics/blackbox_exporter: Move package from net-analyzer/prometheus-blackbox_exporter
Diffstat (limited to 'app-metrics')
5 files changed, 87 insertions, 0 deletions
diff --git a/app-metrics/blackbox_exporter/Manifest b/app-metrics/blackbox_exporter/Manifest new file mode 100644 index 000000000000..70b2683ee33a --- /dev/null +++ b/app-metrics/blackbox_exporter/Manifest @@ -0,0 +1 @@ +DIST blackbox_exporter-0.12.0.tar.gz 2202465 BLAKE2B e3b082f8a491b531b0caf3331ecd391bf8734df0915ccbb7988ac1e67e57436bd45169aa403d5511fbb44eb176f89836ad8c04c491f5194f90f9f8a3b686a656 SHA512 2c98c0f4127bdd04ac54eb182c5468fd38121558f85aa8b4bec860f783f266b144df3153da0b028fdb84a4131a4e374a969bb09ce3a781ddf95f0a008c11bbb6 diff --git a/app-metrics/blackbox_exporter/blackbox_exporter-0.12.0.ebuild b/app-metrics/blackbox_exporter/blackbox_exporter-0.12.0.ebuild new file mode 100644 index 000000000000..24aa268f15a2 --- /dev/null +++ b/app-metrics/blackbox_exporter/blackbox_exporter-0.12.0.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit fcaps user golang-build golang-vcs-snapshot + +EGO_PN="github.com/prometheus/blackbox_exporter" +EGIT_COMMIT="v${PV/_rc/-rc.}" +BLACKBOX_EXPORTER_COMMIT="4a22506" +ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +KEYWORDS="~amd64" + +DESCRIPTION="Prometheus exporter for blackbox probing via HTTP, HTTPS, DNS, TCP and ICMP" +HOMEPAGE="https://github.com/prometheus/blackbox_exporter" +SRC_URI="${ARCHIVE_URI}" +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" + +DEPEND="dev-util/promu" + +FILECAPS=( + cap_net_raw usr/bin/blackbox_exporter +) + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} +} + +src_prepare() { + default + sed -i -e "s/{{.Revision}}/${BLACKBOX_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die +} + +src_compile() { + pushd src/${EGO_PN} || die + mkdir -p bin || die + GOPATH="${S}" promu build -v --prefix blackbox_exporter || die + popd || die +} + +src_install() { + pushd src/${EGO_PN} || die + dobin blackbox_exporter/blackbox_exporter + dodoc {README,CONFIGURATION}.md blackbox.yml + insinto /etc/blackbox_exporter + newins example.yml blackbox.yml.example + popd || die + keepdir /var/lib/blackbox_exporter /var/log/blackbox_exporter + fowners ${PN}:${PN} /var/lib/blackbox_exporter /var/log/blackbox_exporter + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} +} diff --git a/app-metrics/blackbox_exporter/files/blackbox_exporter.confd b/app-metrics/blackbox_exporter/files/blackbox_exporter.confd new file mode 100644 index 000000000000..39887477dff9 --- /dev/null +++ b/app-metrics/blackbox_exporter/files/blackbox_exporter.confd @@ -0,0 +1,2 @@ +# arguments for prometheus blackbox exporter +command_args="--config.file=/etc/blackbox_exporter/blackbox.yml" diff --git a/app-metrics/blackbox_exporter/files/blackbox_exporter.initd b/app-metrics/blackbox_exporter/files/blackbox_exporter.initd new file mode 100644 index 000000000000..ab001d41abe9 --- /dev/null +++ b/app-metrics/blackbox_exporter/files/blackbox_exporter.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 2016-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Prometheus blackbox exporter" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/bin/blackbox_exporter" +command_args="${command_args:---config.file=/etc/blackbox_exporter/blackbox.yml}" +command_background="true" +start_stop_daemon_args="--user ${user} --group ${group} \ + --stdout /var/log/blackbox_exporter/${RC_SVCNAME}.log \ + --stderr /var/log/blackbox_exporter/${RC_SVCNAME}.log" + +depend() { + after net +} diff --git a/app-metrics/blackbox_exporter/metadata.xml b/app-metrics/blackbox_exporter/metadata.xml new file mode 100644 index 000000000000..5d0a20fee17b --- /dev/null +++ b/app-metrics/blackbox_exporter/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>mrueg@gentoo.org</email> + <name>Manuel Rüger</name> + </maintainer> + <upstream> + <remote-id type="github">prometheus/blackbox_exporter</remote-id> + </upstream> +</pkgmetadata> |