archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / datree / trunk / PKGBUILD
blob6ca9f4c9aa599e53669e718813a17228e4eed41d
1 # Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
2 pkgname=datree
3 pkgver=1.8.8
4 pkgrel=1
5 pkgdesc="CLI tool to ensure K8s manifests and Helm charts follow best practices as well as your organization’s policies"
6 arch=('x86_64')
7 url='https://github.com/datreeio/datree'
8 license=('Apache')
9 depends=('kubectl')
10 makedepends=('git' 'go')
11 source=("${pgname}-${pkgver}.tar.gz::https://github.com/datreeio/datree/archive/refs/tags/${pkgver}.tar.gz")
12 sha512sums=('a5b773daf7f67eba844b3f8ff4fc3d93a0e865e1cb82cce1bfe4ea0e5c8bdfafd894bbfa57249f908834fbaadc23f1a2664cf8aee8820170c1a5535156fa4aac')
13 b2sums=('6e66b59ec534e9593d5cb5ce65ccbcfb145f1788b1e860242ae8d8e5ce55c3b1d11ca77b156f7cdc934a1c91e16b14f40919d16e7c12d4df8e88807fee98e668')
14 options=('!lto')
16 build() {
17   cd "${pkgname}-${pkgver}"
18   export CGO_LDFLAGS="$LDFLAGS"
19   export CGO_CFLAGS="$CFLAGS"
20   export CGO_CPPFLAGS="$CPPFLAGS"
21   export CGO_CXXFLAGS="$CXXFLAGS"
22   export GOFLAGS='-buildmode=pie -trimpath -modcacherw -mod=readonly'
23   go build -ldflags="-w -s -linkmode=external" -o datree .
26 check() {
27   cd "${pkgname}-${pkgver}"
28   go test ./...
31 package() {
32   cd "${pkgname}-${pkgver}"
33   install -Dm755 datree "${pkgdir}/usr/bin/datree"