| 1 | # Contributor: Guy Godfroy <[email protected]> |
| 2 | # Maintainer: Guy Godfroy <[email protected]> |
| 3 | pkgname=prometheus-smartctl-exporter |
| 4 | _pkgname=smartctl_exporter |
| 5 | pkgver=0.15.0 |
| 6 | pkgrel=0 |
| 7 | pkgdesc="Prometheus smartctl exporter" |
| 8 | url="https://github.com/prometheus-community/smartctl_exporter" |
| 9 | arch="all" |
| 10 | license="Apache-2.0" |
| 11 | depends="smartmontools jq" |
| 12 | makedepends="go" |
| 13 | install="$pkgname.pre-install" |
| 14 | subpackages="$pkgname-openrc" |
| 15 | source="$_pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz |
| 16 | smartctl-exporter.initd |
| 17 | smartctl-exporter.confd |
| 18 | " |
| 19 | builddir="$srcdir/$_pkgname-$pkgver" |
| 20 | options="net" |
| 21 | |
| 22 | build() { |
| 23 | GOLDFLAGS="-X main.Version=$pkgver" |
| 24 | go build \ |
| 25 | -tags netgo \ |
| 26 | -ldflags "$GOLDFLAGS" \ |
| 27 | -o smartctl-exporter |
| 28 | } |
| 29 | |
| 30 | check() { |
| 31 | go test -cover ./... |
| 32 | } |
| 33 | |
| 34 | package() { |
| 35 | install -Dm755 smartctl-exporter "$pkgdir"/usr/bin/smartctl-exporter |
| 36 | install -Dm755 "$srcdir"/smartctl-exporter.initd "$pkgdir"/etc/init.d/smartctl-exporter |
| 37 | install -Dm644 "$srcdir"/smartctl-exporter.confd "$pkgdir"/etc/conf.d/smartctl-exporter |
| 38 | } |
| 39 | |
| 40 | sha512sums=" |
| 41 | 1f9fcacbfad4c11b368b30c4d7febbbc7583b10a4b1197f951f528302ce532e80e6b836449ec2df3fc8d2008ed68287d94d1cac0aafb4eec25de2b08a35f814f smartctl_exporter-0.15.0.tar.gz |
| 42 | 605e753b3f90bf20c035798af9702f60d7f39d600e96a5d5b6cc8909334c2e6adb8fae6f6f3a7cfb4b097e2ceeb90257d9041d41aefa891e25aabf7cc2cac9e2 smartctl-exporter.initd |
| 43 | c182cd0e871159de7c87e181a1b34231225807141daae684f009d1592c7d78742fb4c57d973e91aa724a46d5496961ab8ef7ba9d084760963c1816821efc2dce smartctl-exporter.confd |
| 44 | " |