# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=go-nats
pkgver=1.4.0
pkgrel=1
pkgdesc="Golang client for NATS, the cloud native messaging system"
url="https://github.com/nats-io/go-nats"
arch="noarch"
license="MIT"
depends="go"
subpackages="$pkgname-doc"
_vendor="nats-io"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/$_vendor/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	return 0
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir"/usr/share/doc/$_vendor/$pkgname \
		"$pkgdir"/usr/lib/go/src/github.com/$_vendor/$pkgname
	# some programs look for "nats" library
	ln -s go-nats "$pkgdir"/usr/lib/go/src/github.com/$_vendor/nats
	for file in \
		LICENSE \
		README.* \
		COPYRIGHT \
		AUTHORS \
		TODO.* \
		; do \
		test -e $file && mv $file "$pkgdir"/usr/share/doc/$_vendor/$pkgname
	done
	mv * "$pkgdir"/usr/lib/go/src/github.com/$_vendor/$pkgname
}

sha512sums="1658f1eb02f3ae77eace3782c6da920d10d4af58f82e236934b8a670e073d9cca9af14f9bef048077aa2f0b8adb1cbc94180d65c9cae13d603a8d729203f2e59  go-nats-1.4.0.tar.gz"
