aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 25f239e409fe92f0641ab49f7ac28f9350ec3b15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Maintainer: George Raven <GeorgeRavenCommunity PLUS kubeadmbin AT pm DOT me>
# Contributor: larte <lauri.arte@gmail.com>
# Contributor: Maxwell Pray a.k.a. Synthead <synthead@gmail.com>
# Contributor: gun1x <gheorghe@linux.com>


pkgname=kubectl-bin
pkgdesc="Kubernetes.io kubectl binary"
pkgver=1.27.1
pkgrel=1
arch=('x86_64' 'armv7l' 'armv7h' 'aarch64')
url="http://kubernetes.io"
license=('apache')
depends=()
conflicts=('kubectl')
provides=('kubectl')
source=()
b2sums=()

case "$CARCH" in
  x86_64) _pkgarch="amd64"
    b2sums+=('a7afc47686ca2459dc688c117506545c2de20149abbb211f9bc12312779ab688a29b2a87e83ea9a6082cdc6b824e8f23c5e912bc861e9b86d1142197e8a0032f')
    ;;
  arm*) _pkgarch="arm"
    b2sums+=('680b50e4fd4b84667cbb62fdf01396ad370f030e6692ca9de2b34abb62076e4c2a1ec10678bc596a4f224ca65cd6768fc638766b3f599943e88540c05c4bac90')
    ;;
  aarch64) _pkgarch="arm64"
    b2sums+=('e16a4e827af054c7a74c9b987c359c7d36421a29a98c9446b442d0f1b6d5e3ae4a52daff6678149d8109083375845728455800d023522dc06e98a43694641cf7')
    ;;
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
}