diff options
author | Michael Aldridge <michael.aldridge@betterhelp.com> | 2020-02-11 21:51:33 -0800 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-02-12 17:15:16 -0300 |
commit | e43c2c7582aaa5de534ce83f2da2a540f4a0f78c (patch) | |
tree | a63574ac5b18598e2a829bcc07719a42b73f4604 /testing/prometheus-wireguard-exporter | |
parent | e464383d4442e0a10542f78450b774c2e2a29d5b (diff) | |
download | aports-e43c2c7582aaa5de534ce83f2da2a540f4a0f78c.tar.bz2 aports-e43c2c7582aaa5de534ce83f2da2a540f4a0f78c.tar.xz |
testing/prometheus-wireguard-exporter: new aport
Diffstat (limited to 'testing/prometheus-wireguard-exporter')
3 files changed, 50 insertions, 0 deletions
diff --git a/testing/prometheus-wireguard-exporter/APKBUILD b/testing/prometheus-wireguard-exporter/APKBUILD new file mode 100644 index 0000000000..234c6135ad --- /dev/null +++ b/testing/prometheus-wireguard-exporter/APKBUILD @@ -0,0 +1,38 @@ +# Maintainer: Michael Aldridge <aldridge.mac@gmail.com> +pkgname=prometheus-wireguard-exporter +pkgver=3.2.1 +pkgrel=0 +pkgdesc="A Prometheus exporter for WireGuard, written in Rust" +url="https://github.com/MindFlavor/prometheus_wireguard_exporter" +arch="all !s390x !ppc64le" #Crypto is broken (https://github.com/briansmith/ring/issues/389) +license="MIT" +makedepends="cargo" +subpackages="$pkgname-openrc" +source="$pkgname-$pkgver.tar.gz::https://github.com/MindFlavor/prometheus_wireguard_exporter/archive/$pkgver.tar.gz + prometheus-wireguard-exporter.initd + prometheus-wireguard-exporter.confd" + +builddir="$srcdir"/prometheus_wireguard_exporter-"$pkgver" + +build() { + cargo build --release +} + +check() { + cargo test --release +} + +package() { + cargo install --path . --root="$pkgdir"/usr + rm -f "$pkgdir"/usr/.crates2.json + rm -f "$pkgdir"/usr/.crates.toml + + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname + + install -m755 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname +} +sha512sums="45de52b3bd30719407093fe562f44302dd34184b23ce63c1855ac6df064fd73dcac982aef3dfb03aa749fe9f207fa26f262583f76741081b8600d0298cda6101 prometheus-wireguard-exporter-3.2.1.tar.gz +f611bb81839735075f19e80155e9eb9e18da284ef2bada06eb6c5b9b06fc706a6b21d463f52027ba7dbe81b76e3f4771401265fe8a20d512082ec35358f091a3 prometheus-wireguard-exporter.initd +876f7f5a8c5092980783aa9f60eb7b3497d93ab66c1aa6780bf4988f720187d437c8b951f938f012956ed1ac1971eab85e972521750d1a25d41fc7fcf0357188 prometheus-wireguard-exporter.confd" diff --git a/testing/prometheus-wireguard-exporter/prometheus-wireguard-exporter.confd b/testing/prometheus-wireguard-exporter/prometheus-wireguard-exporter.confd new file mode 100644 index 0000000000..68d8b23e5d --- /dev/null +++ b/testing/prometheus-wireguard-exporter/prometheus-wireguard-exporter.confd @@ -0,0 +1 @@ +export INTERFACE=wg0 diff --git a/testing/prometheus-wireguard-exporter/prometheus-wireguard-exporter.initd b/testing/prometheus-wireguard-exporter/prometheus-wireguard-exporter.initd new file mode 100644 index 0000000000..9b2efd98dc --- /dev/null +++ b/testing/prometheus-wireguard-exporter/prometheus-wireguard-exporter.initd @@ -0,0 +1,11 @@ +#!/sbin/openrc-run + +description="Prometheus Wireguard Exporter" +supervisor=supervise-daemon +command=/usr/bin/prometheus_wireguard_exporter +command_args="-n /etc/wireguard/${INTERFACE}.conf" +pidfile="/run/${RC_SVCNAME}.pid" + +depend() { + need net +} |