summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6401002c1718a985dbdebb79968e665b558c9746 (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
46
47
48
49
50
51
# Maintainer: ml <ml-aur@ransomware.download>
pkgname=kind
pkgver=0.25.0
pkgrel=1
pkgdesc='Kubernetes IN Docker - local clusters for testing Kubernetes'
arch=('aarch64' 'x86_64')
url='https://kind.sigs.k8s.io/'
license=('Apache-2.0')
depends=('glibc' 'kubectl')
makedepends=('go' 'git')
optdepends=(
    'docker: docker node provider'
    'podman: podman node provider'
    'nerdctl: nerdctl node provider'
)
source=("https://github.com/kubernetes-sigs/kind/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
    modules-load.conf
    registry-aliases.conf)
sha256sums=('016c36750be5c5fb81f70e4675ee0a4f278dd929f05273184ff68cae112ce71b'
    '87bc2d0263e7393c66d540375efa9b68f2e3fdd72d5b12688587e0c3d6b99d88'
    '82b71230a61f9b1f5072c841bb637aac200272a9cbbddcfc6fd01c308dbb5923')

build() {
    local _commit
    _commit="$(bsdcat "$pkgname-$pkgver.tar.gz" | git get-tar-commit-id)"
    cd "$pkgname-$pkgver"
    export CGO_ENABLED=1
    export CGO_CFLAGS="$CFLAGS"
    export CGO_CPPFLAGS="$CPPFLAGS"
    export CGO_CXXFLAGS="$CXXFLAGS"
    export CGO_LDFLAGS="$LDFLAGS"
    export GOFLAGS='-buildmode=pie -modcacherw -trimpath'

    go build -o "$pkgname" -ldflags="-buildid= -linkmode=external \
    -X sigs.k8s.io/kind/pkg/cmd/kind/version.GitCommit=$_commit"

    ./"$pkgname" completion bash >completion.bash
    ./"$pkgname" completion fish >completion.fish
    ./"$pkgname" completion zsh >completion.zsh
}

package() {
    install -Dm644 modules-load.conf "$pkgdir"/etc/modules-load.d/kind.conf
    install -Dm644 registry-aliases.conf "$pkgdir"/etc/containers/registries.conf.d/kind.conf

    cd "$pkgname-$pkgver"
    install -Dm755 "$pkgname" -t "$pkgdir"/usr/bin
    install -Dm644 completion.bash "$pkgdir"/usr/share/bash-completion/completions/"$pkgname"
    install -Dm644 completion.fish "$pkgdir"/usr/share/fish/vendor_completions.d/"$pkgname".fish
    install -Dm644 completion.zsh "$pkgdir"/usr/share/zsh/site-functions/_"$pkgname"
}