# Contributor: Thomas Boerger # Contributor: Gennady Feldman # Contributor: Sergii Sadovyi # Maintainer: Thomas Boerger pkgname=terraform pkgver=0.12.8 pkgrel=0 pkgdesc="Building, changing and combining infrastructure safely and efficiently" url="https://www.terraform.io/" arch="all !armhf !armv7" license="MPL-2.0" makedepends="go" source="${pkgname}-${pkgver}.tar.gz::https://github.com/hashicorp/terraform/archive/v$pkgver.tar.gz" builddir="$srcdir/src/github.com/hashicorp/$pkgname" prepare() { mkdir -p ${builddir%/*} mv $srcdir/$pkgname-$pkgver "$builddir"/ default_prepare } build() { cd "$builddir" GOPATH="$srcdir" go build -v -o bin/$pkgname \ -ldflags "-X main.GitCommit=v$pkgver -X github.com/hashicorp/terraform/version.Prerelease= -s -w" } check() { cd "$builddir" GOPATH="$srcdir" go list -mod=vendor . | xargs -t -n4 go test -mod=vendor -timeout=2m -parallel=4 bin/$pkgname -v } package() { install -Dm755 "$builddir"/bin/$pkgname "$pkgdir"/usr/bin/$pkgname } cleanup_srcdir() { go clean -modcache default_cleanup_srcdir } sha512sums="88f8e1244d4e556b74aa283a9a7dc0e033dad780d9b4dd4a7f37ba634bc09f0e624505e942e620782b8e6bd1795019494695306a23a75f8b466fe119994881e1 terraform-0.12.8.tar.gz"