# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=websocketd
pkgver=0.4.1
pkgrel=25
pkgdesc="Like inetd, but for WebSockets. Turn any application that uses STDIO/STDOUT into a WebSocket server."
url="https://github.com/joewalnes/websocketd"
license="BSD-2-Clause"
arch="all"
# no test suite
# net required to download go dependencies
options="!check net"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/joewalnes/websocketd/archive/v$pkgver.tar.gz
	make.patch
	"

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

build() {
	make websocketd
}
package() {
	install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="8535637bdf8fecbc4340606b6096672420126c32ed9e68944593f577e6307c810caf654e76f7077bf119d6273c6eec4c4c21eb21bfd805d0b8f5549c626460e4  websocketd-0.4.1.tar.gz
4bae15403384322e38b4b47c3a7074a0b6618ccf4383ddd66a2bb2dd7c26572f33ffc0e34ac547980112391dffe4811f0b8963b702cd5072cc7d40e68f024656  make.patch"
