# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=zabbix-agent2-plugin-alpine
pkgver=0.3.2
pkgrel=7
pkgdesc="Alpine related plugins for Zabbix Agent 2"
url="https://gitlab.alpinelinux.org/alpine/infra/zabbix-agent2-plugins"
arch="all"
license="MIT"
depends="zabbix-agent2"
makedepends="go"
source="https://gitlab.alpinelinux.org/alpine/infra/zabbix-agent2-plugins/-/archive/v$pkgver/zabbix-agent2-plugins-v$pkgver.tar.gz"
options="!check" # no test suite
builddir="$srcdir/zabbix-agent2-plugins-v$pkgver"
provides="zabbix-agent2-alpine=$pkgver-r$pkgrel"

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build ./cmd/zabbix-agent2-plugin-alpine.go
}

package() {
	install -Dm0755 zabbix-agent2-plugin-alpine -t "$pkgdir"/usr/libexec
	install -Dm0644 config/alpine.conf \
		-t "$pkgdir"/etc/zabbix/zabbix_agent2.d/plugins.d/
}

sha512sums="
244f65fae31442076f6d85f1fbd3c9813e8899e91085e322d6634667a19cfe1179fa1eb3f9ac240f9dd2d434f3ddc197b738d8fba0fe00ca7485ddc2a2177966  zabbix-agent2-plugins-v0.3.2.tar.gz
"
