summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7f6cda18aef2f7ee33ee468ad05ec6b9eadb166f (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
# Maintainer: ml <ml@visu.li>
pkgname=kubectl-doctor
pkgver=0.3.0
pkgrel=1
pkgdesc='kubectl cluster triage plugin for k8s'
arch=('x86_64' 'aarch64')
url='https://github.com/emirozer/kubectl-doctor'
license=('Apache')
depends=('glibc')
makedepends=('go')
groups=('kubectl-plugins')
source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('1d0faeba6875228bc9e77261e55cbc6c7b2ffaabf90c4c3f7fe96f8ea8e299bb')

prepare() {
  cd "$pkgname-$pkgver"
  go mod download
}

build() {
  cd "$pkgname-$pkgver"
  export CGO_ENABLED=1
  export CGO_LDFLAGS="$LDFLAGS"
  export CGO_CFLAGS="$CFLAGS"
  export CGO_CPPFLAGS="$CPPFLAGS"
  export CGO_CXXFLAGS="$CXXFLAGS"
  export GOFLAGS='-buildmode=pie -trimpath -modcacherw -mod=readonly'
  go build ./cmd/kubectl-doctor.go
}

package() {
  install -Dm755 "$pkgname-$pkgver/$pkgname" -t "$pkgdir/usr/bin"
}