# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=crane
pkgver=0.20.2
pkgrel=5
pkgdesc="tool for interacting with remote images and registries"
url="https://github.com/google/go-containerregistry/tree/main/cmd/crane"
arch="all"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/google/go-containerregistry/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/go-containerregistry-$pkgver/"

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	msg "Building crane"
	go build ./cmd/crane/
}

check() {
	go test -v ./cmd/crane
}

package() {
	install -Dm0755 crane -t "$pkgdir"/usr/bin/
}

sha512sums="
8ffe1698f442f501ef786e72717a09f4f3bcebd9f23a2d8e856a51ba9f5acf8639ac387ba1146f45b6a6458dade6806a86ca867b3b703000aeb85d35d79bc148  crane-0.20.2.tar.gz
"
