# Maintainer: George Raven # Contributor: larte # Contributor: Maxwell Pray a.k.a. Synthead # Contributor: gun1x pkgname=kubectl-bin pkgdesc="Kubernetes.io kubectl binary" pkgver=1.30.2 # renovate: datasource=github-tags depName=kubernetes/kubernetes pkgrel=1 arch=('x86_64' 'armv7l' 'armv7h' 'aarch64') url="http://kubernetes.io" license=('apache') depends=() conflicts=('kubectl') provides=('kubectl') source=() b2sums=('b38bd5059a09bb8787f658048111c2febd2ce7be65897b6c7b82a254047e7187e87017b84bcc5f72c3ee64433a784200aa582b12a5546753ff74540d6f470e1f') # if CARCH is not set default to x86_64 # https://stackoverflow.com/a/11362364/11164973 : "${CARCH:=x86_64}" case "$CARCH" in x86_64) _pkgarch="amd64" ;; arm*) _pkgarch="arm" ;; aarch64) _pkgarch="arm64" ;; esac source+=(${pkgname}-${pkgver}-${_pkgarch}::"https://storage.googleapis.com/kubernetes-release/release/v${pkgver}/bin/linux/${_pkgarch}/kubectl") package() { # Kubectl Binary install -D -m 0755 "${pkgname}-${pkgver}-${_pkgarch}" "${pkgdir}/usr/bin/kubectl" # Shell Completions mkdir -p completions ${pkgdir}/usr/bin/kubectl completion bash > completions/kubectl ${pkgdir}/usr/bin/kubectl completion zsh > completions/_kubectl ${pkgdir}/usr/bin/kubectl completion fish > completions/kubectl.fish install -D -m 0644 completions/kubectl ${pkgdir}/usr/share/bash-completion/completions/kubectl install -D -m 0644 completions/_kubectl ${pkgdir}/usr/share/zsh/site-functions/_kubectl install -D -m 0644 completions/kubectl.fish ${pkgdir}/usr/share/fish/vendor_completions.d/kubectl.fish }