# Contributor: Michał Polański # Maintainer: Michał Polański pkgname=syft pkgver=0.86.1 pkgrel=1 pkgdesc="Generate a Software Bill of Materials (SBOM) from container images and filesystems" url="https://github.com/anchore/syft" license="Apache-2.0" arch="all !armhf !armv7 !x86 !ppc64le !riscv64" # FTBFS on 32-bit arches, riscv64, ppc64le makedepends="go" subpackages=" $pkgname-bash-completion $pkgname-fish-completion $pkgname-zsh-completion " source="https://github.com/anchore/syft/archive/v$pkgver/syft-$pkgver.tar.gz" options="!check" # tests need docker export CGO_ENABLED=0 export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { go build -ldflags " -X github.com/anchore/syft/internal/version.version=$pkgver " \ -o bin/syft ./cmd/syft bin/syft completion bash > $pkgname.bash bin/syft completion fish > $pkgname.fish bin/syft completion zsh > $pkgname.zsh } check() { go test ./... } package() { install -Dm755 bin/syft -t "$pkgdir"/usr/bin/ install -Dm644 $pkgname.bash "$pkgdir"/usr/share/bash-completion/completions/$pkgname install -Dm644 $pkgname.fish "$pkgdir"/usr/share/fish/vendor_completions.d/$pkgname.fish install -Dm644 $pkgname.zsh "$pkgdir"/usr/share/zsh/site-functions/_$pkgname } sha512sums=" 206120c6cde947eab1a7864f37c14ecc60cc7cf5ed08a283154a3d4c67193911f5283673e01f315cfa4efb43c4fbfdeb103f62b5ea031416ea166504c14f36a9 syft-0.86.1.tar.gz "