# Maintainer: Hoang Nguyen pkgname=driftctl pkgver=0.39.0 pkgrel=2 pkgdesc="Measure infrastructure as code coverage, and track infrastructure drift" url="https://driftctl.com/" # 32bit: fail tests arch="all !x86 !armhf !armv7" license="Apache-2.0" makedepends="go" subpackages=" $pkgname-bash-completion $pkgname-fish-completion $pkgname-zsh-completion " source="$pkgname-$pkgver.tar.gz::https://github.com/snyk/driftctl/archive/refs/tags/v$pkgver.tar.gz" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { export CGO_ENABLED=0 local _goldflags=" -X github.com/snyk/driftctl/build.env=release -X github.com/snyk/driftctl/build.enableUsageReporting=false -X github.com/snyk/driftctl/pkg/version.version=v$pkgver " go build -v -ldflags "$_goldflags" for shell in bash fish zsh; do ./driftctl completion $shell > driftctl.$shell done } check() { # A test needs access to ./test/schemas/aws/3.19.0/schema.json file GOFLAGS="${GOFLAGS/-trimpath/}" go test ./... } package() { install -Dm755 driftctl -t "$pkgdir"/usr/bin/ install -Dm644 driftctl.bash \ "$pkgdir"/usr/share/bash-completion/completions/driftctl install -Dm644 driftctl.fish \ "$pkgdir"/usr/share/fish/vendor_completions.d/driftctl.fish install -Dm644 driftctl.zsh \ "$pkgdir"/usr/share/zsh/site-functions/_driftctl } sha512sums=" 7d89a5ad6cfea7a765263e7a2f4a38a085a926ae9a41ce29fd77daa211a192635bea46093079cc1d6594f4488937a37aa7b6b1d913ee3c28c451971f9d273dd8 driftctl-0.39.0.tar.gz "