aports/community/grype/APKBUILD
2025-05-14 23:15:05 +02:00

48 lines
1.5 KiB
Text

maintainer="Michał Polański <michal@polanski.me>"
pkgname=grype
pkgver=0.92.0
pkgrel=0
pkgdesc="Vulnerability scanner for container images, filesystems, and SBOMs"
url="https://github.com/anchore/grype"
license="Apache-2.0"
arch="all !armhf !armv7 !x86" # FTBFS on 32-bit arches
arch="$arch !ppc64le" # ppc64le: build constraints exclude all Go files in /home/buildozer/aports/testing/grype/src/pkg/mod/modernc.org/libc@v1.14.12/uuid/uuid
makedepends="go"
subpackages="
$pkgname-bash-completion
$pkgname-fish-completion
$pkgname-zsh-completion
"
source="https://github.com/anchore/grype/archive/v$pkgver/grype-$pkgver.tar.gz"
options="!check" # tests need docker
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
build() {
go build -ldflags "
-X main.version=$pkgver
" \
-o bin/grype ./cmd/grype
./bin/grype completion bash > $pkgname.bash
./bin/grype completion fish > $pkgname.fish
./bin/grype completion zsh > $pkgname.zsh
}
check() {
go test ./...
}
package() {
install -Dm755 bin/grype -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="
0bc4e98862a49580eba39ca6f1664a234d4cacf27eb4c65d32781376c1c0e478414c62a630247b1f81543c67eca4197aaba4582e0b21c15dc1af10d76c014431 grype-0.92.0.tar.gz
"