diff options
| author | nixfloyd <nixfloyd@gmail.com> | 2020-01-09 01:34:57 +0000 |
|---|---|---|
| committer | Leo <thinkabit.ukim@gmail.com> | 2020-01-09 17:45:18 +0100 |
| commit | 1ede2429aa9860742d0295ca99d2af40b0adfce2 (patch) | |
| tree | b697c2886f8f639e18c0baf116c4edb9185bedff /testing | |
| parent | 714870b02e5c92a0a1d12f67607377b8aadbb5eb (diff) | |
| download | aports-1ede2429aa9860742d0295ca99d2af40b0adfce2.tar.bz2 aports-1ede2429aa9860742d0295ca99d2af40b0adfce2.tar.xz | |
testing/prometheus-snmp-exporter: new aport
Diffstat (limited to 'testing')
6 files changed, 107 insertions, 0 deletions
diff --git a/testing/prometheus-snmp-exporter/APKBUILD b/testing/prometheus-snmp-exporter/APKBUILD new file mode 100644 index 0000000000..64c0a253f3 --- /dev/null +++ b/testing/prometheus-snmp-exporter/APKBUILD @@ -0,0 +1,57 @@ +# Maintainer: nixfloyd <nixfloyd@gmail.com> +pkgname="prometheus-snmp-exporter" +_pkgname="snmp_exporter" +pkgver="0.16.1" +pkgrel=0 +pkgdesc="Description" +url="https://github.com/prometheus/snmp_exporter" +arch="all" +license="Apache-2.0" +depends="" +makedepends="go net-snmp-dev" +install="$pkgname.pre-install $pkgname.post-install" +subpackages="$pkgname-openrc" +source=" + $pkgname-$pkgver.tar.gz::https://github.com/prometheus/snmp_exporter/archive/v$pkgver.tar.gz + disable-go-race-detector.patch + prometheus-snmp-exporter.initd + prometheus-snmp-exporter.confd + " +builddir="$srcdir/$_pkgname-$pkgver" + + +build() { + go build + cd generator + go build + cd .. +} + +check() { + go test +} + +package() { + # Replace with proper package command(s) + install -Dm755 snmp_exporter \ + "$pkgdir"/usr/bin/prometheus-snmp-exporter + install -Dm755 generator/generator \ + "$pkgdir"/usr/bin/prometheus-snmp-generator + install -Dm644 snmp.yml \ + "$pkgdir"/etc/prometheus/snmp.yml + install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus-snmp-exporter/ \ + README.md + install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus-snmp-exporter/examples/ \ + generator/generator.yml + install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus-snmp-exporter/generator/ \ + generator/README.md + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname +} + +sha512sums="ca82464e66c5ac44b46b790582508066e369bcdc1ec9fd06e6576762a8d7afd41bad279717b50f43e3eb7dad156e820432357e52cbbe17e2d87f1621b51e0df5 prometheus-snmp-exporter-0.16.1.tar.gz +36952039e5db39aa06a2ca16fa5d318f22eb967e3e9b1363508b2f3d3d0b14e5df111c77ce951bea2f65dd2be0a0a1582be245acfe4641623381a940204e53d9 disable-go-race-detector.patch +42fadcab29b0bac956dd547ca70bb0d3b92b151ba739b5fb94519157ef54f180e13e50a22cb11c701657631bc1c48f3bf5448459ec24bca98fee4f735b07397c prometheus-snmp-exporter.initd +489cb298e215bd9647aa5293d456106eb26a73f5fbd9d42fab68de26d273ebb612dba01ba113ce58521b543a2f82a10ad86dc35056ef8d0438b39e77be61f67e prometheus-snmp-exporter.confd" diff --git a/testing/prometheus-snmp-exporter/disable-go-race-detector.patch b/testing/prometheus-snmp-exporter/disable-go-race-detector.patch new file mode 100644 index 0000000000..ba3c4cf571 --- /dev/null +++ b/testing/prometheus-snmp-exporter/disable-go-race-detector.patch @@ -0,0 +1,33 @@ +From 5136eb5266b2ff022a44a3316a07d02b4dcc9e08 Mon Sep 17 00:00:00 2001 +From: Tiago Ilieve <tiago.myhro@gmail.com> +Date: Sun, 12 May 2019 11:21:01 +0200 +Subject: [PATCH] Disable Go race detector + +Go race detector is not supported on musl[1]. + +[1]: https://github.com/golang/go/issues/14481 +--- + Makefile.common | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/Makefile.common b/Makefile.common +index 4f18ea5..18085e4 100644 +--- a/Makefile.common ++++ b/Makefile.common +@@ -94,13 +94,6 @@ BUILD_DOCKER_ARCHS = $(addprefix common-docker-,$(DOCKER_ARCHS)) + PUBLISH_DOCKER_ARCHS = $(addprefix common-docker-publish-,$(DOCKER_ARCHS)) + TAG_DOCKER_ARCHS = $(addprefix common-docker-tag-latest-,$(DOCKER_ARCHS)) + +-ifeq ($(GOHOSTARCH),amd64) +- ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux freebsd darwin windows)) +- # Only supported on amd64 +- test-flags := -race +- endif +-endif +- + # This rule is used to forward a target like "build" to "common-build". This + # allows a new "build" target to be defined in a Makefile which includes this + # one and override "common-build" without override warnings. +-- +2.17.1 + diff --git a/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.confd b/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.confd new file mode 100644 index 0000000000..0aa409934f --- /dev/null +++ b/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.confd @@ -0,0 +1 @@ +command_args="--config.file=/etc/prometheus/snmp.yml --web.listen-address=':9116'" diff --git a/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.initd b/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.initd new file mode 100644 index 0000000000..969e149f40 --- /dev/null +++ b/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.initd @@ -0,0 +1,8 @@ +#!/sbin/openrc-run +name="prometheus-snmp-exporter" +description="prometheus monitoring system & time series database" +supervisor=supervise-daemon +command=/usr/bin/prometheus-snmp-exporter +command_args="$command_args" +command_user="prometheus:prometheus" + diff --git a/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.post-install b/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.post-install new file mode 100644 index 0000000000..0586fcd5c5 --- /dev/null +++ b/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.post-install @@ -0,0 +1,4 @@ +#!/bin/sh + +# add something which happends after install + diff --git a/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.pre-install b/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.pre-install new file mode 100644 index 0000000000..46079e0c04 --- /dev/null +++ b/testing/prometheus-snmp-exporter/prometheus-snmp-exporter.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh + +# add something which happends before install + |
