aports/testing/prometheus-smartctl-exporter/APKBUILD
2025-03-16 14:15:03 +01:00

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.13.0
pkgrel=3
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="
1925da0329f47f439a746d4678687a02f82b9d363bc9a94c8b93065d14bc86a8f1fadf411635b27373ffab920fa876bbba83eab8889734e71968a46b53e41387 smartctl_exporter-0.13.0.tar.gz
605e753b3f90bf20c035798af9702f60d7f39d600e96a5d5b6cc8909334c2e6adb8fae6f6f3a7cfb4b097e2ceeb90257d9041d41aefa891e25aabf7cc2cac9e2 smartctl-exporter.initd
cd46f20e8b479331e4e831da1dd36fcd93990904560555b5ba67d2344dc50405d8d8e4a3b03c32b1aaf969fed0a2a176c5248e671495604112fafb6dc325b999 smartctl-exporter.confd
"