commit:     fdfbc484bade7fc9f2f8140c9f8e1e7bb2ec0e1f
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 15 12:47:22 2016 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Dec 15 12:47:59 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdfbc484

net-analyzer/prometheus-node_exporter: Initial version

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 net-analyzer/prometheus-node_exporter/Manifest     |  1 +
 .../files/prometheus-node_exporter.confd           |  2 +
 .../files/prometheus-node_exporter.initd           | 25 +++++++++++
 net-analyzer/prometheus-node_exporter/metadata.xml | 13 ++++++
 ...rometheus-node_exporter-0.13.0_p20161212.ebuild | 48 ++++++++++++++++++++++
 5 files changed, 89 insertions(+)

diff --git a/net-analyzer/prometheus-node_exporter/Manifest 
b/net-analyzer/prometheus-node_exporter/Manifest
new file mode 100644
index 00000000..a46787d
--- /dev/null
+++ b/net-analyzer/prometheus-node_exporter/Manifest
@@ -0,0 +1 @@
+DIST prometheus-node_exporter-0.13.0_p20161212.tar.gz 755620 SHA256 
221b2444dd895539c9028d04d6557583ae63a9f01377fe3cd6d2846b7411ec6d SHA512 
d01cb01c86162e645af9ac4df860e4ab9a63999f7fa10236e6419ac14661a985dbff73d8948ecaceab0565fdb3d4dd7c5081855752e9cdafaa1d1994b96827e4
 WHIRLPOOL 
38f8343f3549dce96c383bc10eb2c802ec7196f492539a9356a473f85100d3823c74bc17e7c55608d9aa5a8931f0f61ef9b5fa395ae692d2c5861cd9b4bc58da

diff --git 
a/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.confd 
b/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.confd
new file mode 100644
index 00000000..2ada24d
--- /dev/null
+++ b/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.confd
@@ -0,0 +1,2 @@
+# arguments for docker-registry
+command_args="--collector.textfile.directory=/etc/prometheus-exporter"

diff --git 
a/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd 
b/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd
new file mode 100644
index 00000000..7f2256c
--- /dev/null
+++ b/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Prometheus machine metrics exporter"
+pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
+user=${user:-prometheus-exporter}
+group=${group:-prometheus-exporter}
+
+command="/usr/bin/prometheus-node_exporter"
+command_args="${command_args:--collector.textfile.directory=/etc/prometheus-exporter}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+       --stdout /var/log/prometheus-exporter/${SVCNAME}.log \
+       --stderr /var/log/prometheus-exporter/${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/metadata.xml 
b/net-analyzer/prometheus-node_exporter/metadata.xml
new file mode 100644
index 00000000..db39297
--- /dev/null
+++ b/net-analyzer/prometheus-node_exporter/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <longdescription>
+       </longdescription>
+       <maintainer type="person">
+               <email>mr...@gentoo.org</email>
+               <name>Manuel Rüger</name>
+       </maintainer>
+       <upstream>
+               <remote-id 
type="github">prometheus/prometheus-node_exporter</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git 
a/net-analyzer/prometheus-node_exporter/prometheus-node_exporter-0.13.0_p20161212.ebuild
 
b/net-analyzer/prometheus-node_exporter/prometheus-node_exporter-0.13.0_p20161212.ebuild
new file mode 100644
index 00000000..d18e839
--- /dev/null
+++ 
b/net-analyzer/prometheus-node_exporter/prometheus-node_exporter-0.13.0_p20161212.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot
+
+EGO_PN="github.com/prometheus/node_exporter/..."
+EGIT_COMMIT="f09b9def25095c28164a4ec36749c752ea8cb03f"
+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 prometheus-exporter
+       enewuser prometheus-exporter -1 -1 -1 prometheus-exporter
+}
+
+src_prepare() {
+       default
+       sed -i -e "s/{{.Revision}}/${EGIT_COMMIT:0:7}/" 
src/${EGO_PN%/*}/.promu.yml || die
+}
+
+src_compile() {
+       pushd src/${EGO_PN%/*} || die
+       mkdir bin
+       GOPATH="${S}" promu build -v --prefix prometheus-node_exporter || die
+       popd || die
+}
+
+src_install() {
+       pushd src/${EGO_PN%/*} || die
+       dobin prometheus-node_exporter
+       dodoc {README,CHANGELOG,CONTRIBUTING}.md
+       popd || die
+       keepdir /etc/prometheus-exporter /var/log/prometheus-exporter
+       fowners prometheus-exporter:prometheus-exporter 
/etc/prometheus-exporter /var/log/prometheus-exporter
+       newinitd "${FILESDIR}"/prometheus-node_exporter.initd 
prometheus-node_exporter
+       newconfd "${FILESDIR}"/prometheus-node_exporter.confd 
prometheus-node_exporter
+}

Reply via email to