# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=crane
pkgver=0.20.5
pkgrel=0
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"
options="net" # go modules
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="
c359cd7bcfbcc1ee86d836162af6b24cbfbb9cf86a0066e766b0a4f021aaed063f411d2fb589e04141b4495292199fef96ed9159a6b7ef592dff0d8aadf99267  crane-0.20.5.tar.gz
"
