# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=crane
pkgver=0.19.0
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="
3c050f6c906dddbe48250181851b6462c887d6e81aa583e56642307221f047eb5c637c348dc1e08da6760d40beb30a004dcdf122509147973c68e31d91312cca  crane-0.19.0.tar.gz
"
