# Template file for 'NetAuth'
pkgname=NetAuth
version=0.0.9
revision=2
build_style=go
hostmakedepends="dep"
go_import_path="github.com/NetAuth/NetAuth"
go_package="${go_import_path}/cmd/netauth
 ${go_import_path}/cmd/netauthd"
short_desc="Network authentication and identity system"
maintainer="Michael Aldridge <maldridge@VoidLinux.eu>"
license="MIT"
homepage="https://netauth.org"
distfiles="https://github.com/NetAuth/NetAuth/archive/v$version.tar.gz"
checksum=6449c709b1511443a9c3e5db54b1c255ae5812d16be6c3ba11b68502a31a2b19

pre_build() {
	cd $GOSRCPATH
	dep ensure
}

do_check() {
	cd $GOSRCPATH
	go test -v ./...
}

post_install() {
	vlicense LICENSE
}

NetAuth-server_package() {
	short_desc+=" - server"
	depends="${sourcepkg}>=${version}_${revision}"
	pkg_install() {
		vmove usr/bin/netauthd
	}
}
