60 lines
1.9 KiB
Plaintext

maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=nerdctl
pkgver=2.0.3
pkgrel=2
pkgdesc="Docker-compatible CLI for containerd"
url="https://github.com/containerd/nerdctl/"
arch="all"
license="Apache-2.0"
depends="ca-certificates containerd cni-plugins iptables"
makedepends="go"
subpackages="
$pkgname-doc
$pkgname-bash-completion
$pkgname-fish-completion
$pkgname-zsh-completion
"
source="$pkgname-$pkgver.tar.gz::https://github.com/containerd/nerdctl/archive/refs/tags/v$pkgver.tar.gz"
options="net" # download Go modules
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
build() {
go build -v \
-ldflags="
-X github.com/containerd/nerdctl/v2/pkg/version.Version=v$pkgver \
-X github.com/containerd/nerdctl/v2/pkg/version.Revision=AlpineLinux \
" \
./cmd/nerdctl
for shell in bash fish zsh; do
./nerdctl completion $shell > nerdctl.$shell
done
}
check() {
# /cmd/nerdctl module requires 'nerdctl' binary to be inside PATH
# TestProcessFlagV test tries to mount paths on build host (.e.g /mnt/foo, /test/volume)
# TestGet test fails to read /run/systemd/resolve/resolv.conf file (we're not using systemd here)
# shellcheck disable=2046
go test -skip 'TestGet|TestProcessFlagV' $(go list ./... | grep -v "/cmd/nerdctl")
}
package() {
install -Dm755 nerdctl -t "$pkgdir"/usr/bin/
install -Dm644 docs/*.md -t "$pkgdir"/usr/share/doc/$pkgname/
install -Dm644 nerdctl.bash \
"$pkgdir"/usr/share/bash-completion/completions/nerdctl
install -Dm644 nerdctl.fish \
"$pkgdir"/usr/share/fish/vendor_completions.d/nerdctl.fish
install -Dm644 nerdctl.zsh \
"$pkgdir"/usr/share/zsh/site-functions/_nerdctl
}
sha512sums="
32467f3b75e443104d7b49c40bb27df72080ae6c40c9c085968b8f8e3d839095f2047c4fd1cff540bcb785639b79a0874f9a50a5af9feb2a690a7c22621ab98d nerdctl-2.0.3.tar.gz
"