# Maintainer: Galen Abell # Contributor: Galen Abell pkgname=packer pkgver=1.5.5 pkgrel=0 pkgdesc="Build Automated Machine Images" url="https://www.packer.io/" arch="all !armhf !armv7" license="MPL-2.0" makedepends="go" source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/packer/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/packer/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="be694d0c2dfb8cfde7e223e5c85f22480b8437f71533696e07605afe5f05587045a03b685a258ba28bd1fa5809efe5c50ad6063ba635e4b3f446aaadfeb67d13 packer-1.5.5.tar.gz"