# Contributor: Thomas Boerger # Contributor: Gennady Feldman # Contributor: Sergii Sadovyi # Contributor: Galen Abell # Maintainer: Thomas Boerger pkgname=terraform pkgver=0.12.21 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() { GO111MODULE=off GOPATH="$srcdir" go build -v -o bin/$pkgname \ -ldflags "-X main.GitCommit=v$pkgver -X github.com/hashicorp/terraform/version.Prerelease= -s -w" } check() { 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="3b0dd3e6d8ae4b172d0be934ada6a8dcadc3024d0f27450ed107d55cf7f08b6b0b5eeb739a210fc9a76db42f7cc75ad5842ca7415afa3d7b17d9a34f23920a59 terraform-0.12.21.tar.gz"