# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>

pkgname=grumble
pkgver=20200415
_gittag=6f8c2bf2f51fddc1cb09e3385bc4e9db5dc43ba9
pkgrel=1
pkgdesc="Grumble is an implementation of a server for the Mumble voice chat system."
url="https://github.com/mumble-voip/grumble"
arch="x86_64"
license="custom"
makedepends="go"
source="
	$pkgname-$_gittag.tar.gz::https://github.com/mumble-voip/grumble/archive/6f8c2bf2f51fddc1cb09e3385bc4e9db5dc43ba9.tar.gz
	grumble.initd
	LICENSE
	"
builddir="$srcdir/$pkgname-$_gittag"
subpackages="$pkgname-openrc"
options="chmod-clean"

build() {
	export GOPATH="$srcdir/go"
	go get -v -t ./...
	go build mumble.info/grumble/cmd/grumble
}

check() {
	export GOPATH="$srcdir/go"
	go test -v ./...
}

package() {
	install -Dm755 "$builddir"/grumble "$pkgdir"/usr/bin/grumble
	install -Dm755 "$srcdir"/grumble.initd "$pkgdir"/etc/init.d/grumble
}
sha512sums="
b7cc0ac362bc72a021449b402fd2bf97d2fe48a8dc7233372518ab4bea539a15b115ee59d149221481721b8fc835fb9648beddef8fe728ca7d96178896717eb0  grumble-6f8c2bf2f51fddc1cb09e3385bc4e9db5dc43ba9.tar.gz
e04d5125646f6699354074e78f908749125c3e436507635f54ff6394957ef34b03d52fdbef1bd7e4970729034155080f9da3c4f44ebcabc9f00df6fb92fb0525  grumble.initd
63f1e396d2ef0f96135432af30d5756030aebd931fe3da143258d3ca3d949091af1e21aec157365802aa21eef2ff05b4a3ba32f42f0cfe753f88688040b8fd11  LICENSE
"
