summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9cd56db940d6667e18b03953406f988185b4a931 (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
# Maintainer: Matthias Lisin <ml@visu.li>
pkgname=kube-prompt-git
pkgrel=1
pkgver=1.0.6.r3.gb3d8014
pkgdesc='An interactive kubernetes client featuring auto-complete using go-prompt.'
arch=(any)
url='https://github.com/c-bata/kube-prompt'
license=('MIT')
depends=('kubectl')
makedepends=('git' 'go')
provides=('kube-prompt')
conflicts=('kube-prompt')
source=("$pkgname::git+https://github.com/c-bata/kube-prompt.git")
sha512sums=('SKIP')


pkgver() {
    cd "$pkgname"
    git describe --long --tags | sed 's/^v//;s/-/.r/;s/-/./'
}

build() {
    cd "$pkgname"
    LDFLAGS+=" -X 'main.version=$(git describe --tags --abbrev=0)'"
    LDFLAGS+=" -X 'main.revision=$(git rev-parse --short HEAD)'"
    go build \
        -o kube-prompt \
        -gcflags "all=-trimpath=${PWD}" \
        -asmflags "all=-trimpath=${PWD}" \
        -ldflags "-extldflags ${LDFLAGS}"
}

package() {
    cd "$pkgname"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    install -Dm755 kube-prompt "${pkgdir}/usr/bin/kube-prompt"
}