about summary refs log tree commit diff
path: root/PKGBUILD
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-05-08T11·47+0200
committerVincent Ambo <tazjin@gmail.com>2017-05-08T11·47+0200
commitd15dfefce2c2e29205b25f1317f706588d8062a3 (patch)
tree427e2a85ada5df07c16bad35633764f4c00ed675 /PKGBUILD
parent1e3ecad709691256d5dabcab448e946aa543bb85 (diff)
feat build: Add ArchLinux PKGBUILD
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD38
1 files changed, 38 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e6b148b547f5
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,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=('MIT')
+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"
+}