forked from tazjin/kontemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PKGBUILD
38 lines (32 loc) · 864 Bytes
/
PKGBUILD
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: Vincent Ambo <tazjin@gmail.com>
pkgname=kontemplate-git
pkgver=master_1e3ecad
pkgrel=1
pkgdesc="Simple Kubernetes resource templating"
arch=('x86_64')
url="https://github.com/tazjin/kontemplate"
license=('GPLv3')
makedepends=('go')
optdepends=('pass: Template secrets into resources')
source=('kontemplate-git::git+https://github.com/tazjin/kontemplate.git')
md5sums=('SKIP')
pkgver() {
cd "$srcdir/$pkgname"
echo -n "master_$(git rev-parse --short HEAD)"
}
prepare() {
cd "$srcdir/$pkgname"
echo "Fetching Go dependencies..."
go get -v ./...
}
build() {
cd "$srcdir/$pkgname"
local GIT_HASH="$(git rev-parse --short HEAD)"
go build -tags netgo \
-ldflags "-X main.gitHash=${GIT_HASH} -w -s" \
-o 'kontemplate'
}
package() {
cd "$srcdir/$pkgname"
install -D -m 0755 'kontemplate' "${pkgdir}/usr/bin/kontemplate"
}