aports/testing/prometheus-smartctl-exporter/APKBUILD

44 lines
1.5 KiB
Text

# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=prometheus-smartctl-exporter
_pkgname=smartctl_exporter
pkgver=0.14.0
pkgrel=0
pkgdesc="Prometheus smartctl exporter"
url="https://github.com/prometheus-community/smartctl_exporter"
arch="all"
license="Apache-2.0"
depends="smartmontools jq"
makedepends="go"
install="$pkgname.pre-install"
subpackages="$pkgname-openrc"
source="$_pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz
smartctl-exporter.initd
smartctl-exporter.confd
"
builddir="$srcdir/$_pkgname-$pkgver"
options="net"
build() {
GOLDFLAGS="-X main.Version=$pkgver"
go build \
-tags netgo \
-ldflags "$GOLDFLAGS" \
-o smartctl-exporter
}
check() {
go test -cover ./...
}
package() {
install -Dm755 smartctl-exporter "$pkgdir"/usr/bin/smartctl-exporter
install -Dm755 "$srcdir"/smartctl-exporter.initd "$pkgdir"/etc/init.d/smartctl-exporter
install -Dm644 "$srcdir"/smartctl-exporter.confd "$pkgdir"/etc/conf.d/smartctl-exporter
}
sha512sums="
ceecbe22191565f4e036057f439d0e56dc923f6777f48f0c65fb5426437a799630b16b1098386e278db08bd0b376434bdad97411bf9caac064553bd3a462cae0 smartctl_exporter-0.14.0.tar.gz
605e753b3f90bf20c035798af9702f60d7f39d600e96a5d5b6cc8909334c2e6adb8fae6f6f3a7cfb4b097e2ceeb90257d9041d41aefa891e25aabf7cc2cac9e2 smartctl-exporter.initd
cd46f20e8b479331e4e831da1dd36fcd93990904560555b5ba67d2344dc50405d8d8e4a3b03c32b1aaf969fed0a2a176c5248e671495604112fafb6dc325b999 smartctl-exporter.confd
"