# Contributor: Marino Pascual <mpascual@philips.com>
# Maintainer: Marino Pascual <mpascual@philips.com>
pkgname=prometheus-libvirt-exporter
_pkgname=libvirt-exporter
pkgver=2.3.3
pkgrel=9
pkgdesc="Prometheus libvirt exporter"
url="https://github.com/Tinkoff/libvirt-exporter"
arch="all !s390x !riscv64" # libvirt
license="Apache-2.0"
makedepends="go libvirt-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-openrc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/Tinkoff/libvirt-exporter/archive/refs/tags/$pkgver.tar.gz
	libvirt-exporter.initd
	libvirt-exporter.confd
	"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"

build() {
	go build
}

package() {
	install -Dm755 libvirt-exporter "$pkgdir"/usr/bin/libvirt-exporter

	install -Dm755 "$srcdir"/libvirt-exporter.initd "$pkgdir"/etc/init.d/libvirt-exporter
	install -Dm644 "$srcdir"/libvirt-exporter.confd "$pkgdir"/etc/conf.d/libvirt-exporter
}

sha512sums="
f416dd4ddd5f5405ab7d4e658ff7666b6be4632b567965da07cca8ec1a5b9b9f7d660197b659caf224ed7903e81e8692a50489a8ff48bace8a95063cc4618bd0  libvirt-exporter-2.3.3.tar.gz
7e6868c9bf09dcc9f19de49309d08a96ad8ba12ecf0de468cfd9029e2b1a964c6e1764fb98b7ccc54560f904616469d9d6d45dd147ecede1a0dc21757786ee8f  libvirt-exporter.initd
857e48ec1d9e5382733e5b8195f68685768c30b6d25232fb00aa7373154cf03e63d5959da5bd6132bd252a729e6d68a211e63aeceac34516cbb37b0efabec53c  libvirt-exporter.confd
"
