summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-metrics/snmp_exporter/Manifest1
-rw-r--r--app-metrics/snmp_exporter/snmp_exporter-0.15.0.ebuild55
2 files changed, 56 insertions, 0 deletions
diff --git a/app-metrics/snmp_exporter/Manifest b/app-metrics/snmp_exporter/Manifest
index e97c6baf2ee5..4ad306428b4d 100644
--- a/app-metrics/snmp_exporter/Manifest
+++ b/app-metrics/snmp_exporter/Manifest
@@ -1,2 +1,3 @@
DIST snmp_exporter-0.13.0.tar.gz 4096479 BLAKE2B a41ad876ca73a997bc48ac6fcdbc3ca01ff1c689f2f908cf14874f948a50ecd846a2996fc0cbf7d86a473fb80e42e15a7aca1c1b57f2cb3ebfa68a62db8d13ac SHA512 6e4a607cb58e6721acfd77b570dc62589cba5b23d250c9f654659632c97039156869722e1e43bec2b0656f08021ff89b4089f6b91ef28229964f32a34e0067f3
DIST snmp_exporter-0.14.0.tar.gz 1458373 BLAKE2B 3251022b236b1da7c675fff1119bf358a7b19bec02c552357dde689654e655f7ab5569c5580db8d8cb587860dfb18a5111220bcb07041488ff2d02fe4d204d44 SHA512 58439e9ef8f05e48ebfb4ea82d42568e40968224e609485960f8a81c6e349ca18d16ec3f4eee469dfaa0b9fd50feb28c1e6a6a988fb251485748f10dbc4f8d12
+DIST snmp_exporter-0.15.0.tar.gz 1482592 BLAKE2B f7695eb37f2d702f3a6792337de7a1e878229ec20c8f4bea17d35e174219b71958aaf09bf91daaaffe12c5d03840887ce2ef3b37ce58a56352e8bcbb418bdb5f SHA512 1050a25d12a8201deab0ab7ea95dc35e250954a321d14251c10f87b016c879cf036e01f4043e3463607200381de63f12ea6bcf094dea2939707545f978c2675b
diff --git a/app-metrics/snmp_exporter/snmp_exporter-0.15.0.ebuild b/app-metrics/snmp_exporter/snmp_exporter-0.15.0.ebuild
new file mode 100644
index 000000000000..1c01a04e3bbe
--- /dev/null
+++ b/app-metrics/snmp_exporter/snmp_exporter-0.15.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2019 Gentoo Authors
+# 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/snmp_exporter"
+EGIT_COMMIT="v${PV/_rc/-rc.}"
+SNMP_EXPORTER_COMMIT="92a3da4"
+ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Prometheus exporter for snmp metrics"
+HOMEPAGE="https://github.com/prometheus/snmp_exporter"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND=">=dev-lang/go-1.11
+ dev-util/promu
+ net-analyzer/net-snmp"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+ default
+ sed -i -e "s/{{.Revision}}/${SNMP_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die
+}
+
+src_compile() {
+ pushd src/${EGO_PN} || die
+ GO111MODULE=on GOPATH="${S}" GOCACHE="${T}"/go-cache promu build -v || die
+ pushd generator || die
+ GO111MODULE=on GOPATH="${S}" GOCACHE="${T}"/go-cache go build -mod=vendor -o ../bin/generator . || die
+ popd || die
+}
+
+src_install() {
+ pushd src/${EGO_PN} || die
+ dobin bin/generator snmp_exporter
+ dodoc {README,CONTRIBUTING}.md generator/{FORMAT,README}.md generator/generator.yml
+ insinto /etc/snmp_exporter
+ newins snmp.yml snmp.yml.example
+ popd || die
+ keepdir /var/lib/snmp_exporter /var/log/snmp_exporter
+ fowners ${PN}:${PN} /var/lib/snmp_exporter /var/log/snmp_exporter
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotated" "${PN}"
+}