upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / ko / repos / community-x86_64 / PKGBUILD
blob6006054fb1429729712eb5ac3c25f003c4c7288b
1 # Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
3 pkgname=ko
4 pkgver=0.13.0
5 pkgrel=1
6 pkgdesc="Build and deploy Go applications on Kubernetes"
7 arch=('x86_64')
8 url="https://github.com/google/ko"
9 license=('Apache')
10 makedepends=('go' 'git')
11 depends=('glibc')
12 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/google/ko/archive/refs/tags/v${pkgver}.tar.gz")
13 sha512sums=('bb20fbdf8a8f14d76d6363b557711bdc3e4068c51bce702024af9090632d0d9ed32c6c4fd26181e68db9fbd783ed8e12dfd7de2b52eafcfee6999643feb76fc4')
14 b2sums=('de770f240810c5ae9477ccb4fc03eeb61eab138d5d0b0b98fc18886818aa0096c4efdfed549432fc1bfe9b2217d8fd0f35998f5f37f2e5691542f796955fa695')
16 build() {
17   cd "${pkgname}-${pkgver}"
18   export CGO_CPPFLAGS="${CPPFLAGS}"
19   export CGO_CFLAGS="${CFLAGS}"
20   export CGO_CXXFLAGS="${CXXFLAGS}"
21   export CGO_LDFLAGS="${LDFLAGS}"
22   export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
23   go build -ldflags="-w -s -linkmode=external" .
24   chmod +x ./ko
27 check() {
28   cd "${pkgname}-${pkgver}"
29   # currently disabled
30   #go test -v -x ./...
33 package() {
34   cd "${pkgname}-${pkgver}"
35   install -Dsm755 ./ko "${pkgdir}/usr/bin/ko"
36   mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
37   mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
38   mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
39   ./ko completion > "${pkgdir}/usr/share/bash-completion/completions/ko"
40   ./ko completion zsh > "${pkgdir}/usr/share/zsh/site-functions/_ko"
41   ./ko completion completion fish > "${pkgdir}/usr/share/fish/vendor_completions.d/ko.fish"