diff options
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd | 15 | ||||
-rw-r--r-- | net-analyzer/prometheus-node_exporter/prometheus-node_exporter-0.14.0-r1.ebuild | 48 |
2 files changed, 53 insertions, 10 deletions
diff --git a/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd b/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd index 1f7338f964eb..57202a4ce47b 100644 --- a/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd +++ b/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd @@ -3,22 +3,17 @@ # Distributed under the terms of the GNU General Public License v2 description="Prometheus machine metrics exporter" -pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"} -user=${user:-${SVCNAME}} -group=${group:-${SVCNAME}} +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} command="/usr/bin/node_exporter" command_args="${command_args:--collector.textfile.directory=/var/lib/node_exporter/}" command_background="true" start_stop_daemon_args="--user ${user} --group ${group} \ - --stdout /var/log/node_exporter/${SVCNAME}.log \ - --stderr /var/log/node_exporter/${SVCNAME}.log" + --stdout /var/log/node_exporter/${RC_SVCNAME}.log \ + --stderr /var/log/node_exporter/${RC_SVCNAME}.log" depend() { - need net after net } - -start_pre() { - checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}" -} diff --git a/net-analyzer/prometheus-node_exporter/prometheus-node_exporter-0.14.0-r1.ebuild b/net-analyzer/prometheus-node_exporter/prometheus-node_exporter-0.14.0-r1.ebuild new file mode 100644 index 000000000000..48eb30aac765 --- /dev/null +++ b/net-analyzer/prometheus-node_exporter/prometheus-node_exporter-0.14.0-r1.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit user golang-build golang-vcs-snapshot + +EGO_PN="github.com/prometheus/node_exporter" +EGIT_COMMIT="v${PV/_rc/-rc.}" +NODE_EXPORTER_COMMIT="840ba5d" +ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +KEYWORDS="~amd64" + +DESCRIPTION="Prometheus exporter for machine metrics" +HOMEPAGE="https://github.com/prometheus/prometheus" +SRC_URI="${ARCHIVE_URI}" +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" + +DEPEND="dev-util/promu" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} +} + +src_prepare() { + default + sed -i -e "s/{{.Revision}}/${NODE_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 node_exporter || die + popd || die +} + +src_install() { + pushd src/${EGO_PN} || die + dobin node_exporter + dodoc {README,CHANGELOG,CONTRIBUTING}.md + popd || die + keepdir /var/lib/node_exporter /var/log/node_exporter + fowners ${PN}:${PN} /var/lib/node_exporter /var/log/node_exporter + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} +} |