summaryrefslogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD29
1 files changed, 13 insertions, 16 deletions
diff --git a/PKGBUILD b/PKGBUILD
index b5aca72..048e58a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,8 @@
1# Maintainer: ml <ml@visu.li> 1# Maintainer: ml <ml@visu.li>
2# to build in clean chroot build helm-diff from AUR, then pass to build cmd:
3# $ extra-x86_64-build -- -I helm-diff-3.1.3-2-x86_64.pkg.tar.zst
2pkgname=helmsman 4pkgname=helmsman
3pkgver=3.6.2 5pkgver=3.6.3
4pkgrel=1 6pkgrel=1
5pkgdesc='Helm Charts as Code' 7pkgdesc='Helm Charts as Code'
6arch=('x86_64' 'i686') 8arch=('x86_64' 'i686')
@@ -11,16 +13,11 @@ optdepends=(
11 'ruby-hiera-eyaml: backend for secret encryption' 13 'ruby-hiera-eyaml: backend for secret encryption'
12 'helm-secrets: backend for secret encryption') 14 'helm-secrets: backend for secret encryption')
13makedepends=('go') 15makedepends=('go')
14source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz") 16source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
15sha256sums=('56a50521b5ec443569080eaaa700e4d2bf890fc8a42048c1e0560fc5daa8ed8e') 17sha256sums=('05ce86066028ed0fbb99902018953107432727abe297745de4013815b5bf6781')
16
17prepare() {
18 cd "${pkgname}-${pkgver}"
19 go mod download
20}
21 18
22build() { 19build() {
23 cd "${pkgname}-${pkgver}" 20 cd "$pkgname-$pkgver"
24 export CGO_ENABLED=1 21 export CGO_ENABLED=1
25 export CGO_LDFLAGS="$LDFLAGS" 22 export CGO_LDFLAGS="$LDFLAGS"
26 export CGO_CFLAGS="$CFLAGS" 23 export CGO_CFLAGS="$CFLAGS"
@@ -29,20 +26,20 @@ build() {
29 export GOFLAGS='-buildmode=pie -modcacherw -mod=readonly -trimpath' 26 export GOFLAGS='-buildmode=pie -modcacherw -mod=readonly -trimpath'
30 # man makepkg(8), https://github.com/Praqma/helmsman/blob/master/Makefile 27 # man makepkg(8), https://github.com/Praqma/helmsman/blob/master/Makefile
31 TZ=UTC printf -v _date '%(%d%m%y)T' "${SOURCE_DATE_EPOCH:- -1}" 28 TZ=UTC printf -v _date '%(%d%m%y)T' "${SOURCE_DATE_EPOCH:- -1}"
32 go build -o "$pkgname" -ldflags "-linkmode=external -X main.version=v${pkgver}-${_date}" ./cmd/helmsman 29 go build -ldflags "-linkmode=external -X main.version=v$pkgver-$_date" ./cmd/helmsman
33} 30}
34 31
35check() { 32check() {
36 cd "${pkgname}-${pkgver}" 33 cd "$pkgname-$pkgver"
37 go test -short ./... 34 go test -short ./...
38} 35}
39 36
40package() { 37package() {
41 cd "${pkgname}-${pkgver}" 38 cd "$pkgname-$pkgver"
42 install -Dm755 "$pkgname" -t "${pkgdir}/usr/bin" 39 install -Dm755 "$pkgname" -t "$pkgdir/usr/bin"
43 install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" 40 install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
44 41
45 # README, docs and examples 42 # README, docs and examples
46 install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}" 43 install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
47 cp -a docs examples -t "${pkgdir}/usr/share/doc/${pkgname}" 44 cp -a docs examples -t "$pkgdir/usr/share/doc/$pkgname"
48} 45}