# Maintainer:
pkgname=direnv
pkgver=2.15.2
pkgrel=0
pkgdesc="Environment variable switcher for the shell"
url="http://direnv.net"
arch="all"
license="MIT"
checkdepends="bash"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/direnv/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/src/github.com/direnv/$pkgname"

prepare() {
	mkdir -p "${builddir%/*}"
	ln -s "$srcdir"/$pkgname-$pkgver "$builddir"

	default_prepare
}

build() {
	cd "$builddir"
	make GOPATH="$srcdir"
}

check() {
	cd "$builddir"
	make test GOPATH="$srcdir"
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir/usr" install
}

sha512sums="f973ce55844fce97ad5a93832d53a8a0f4544080022f869c1a83dc3cf07ee86c1ea1a1cb31ddc20c4f5d205825e70405539bf866889c0aaafc7baf75b98d2fbe  direnv-2.15.2.tar.gz"
