summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3ae8e8652dd75ef838f0e13fde3b069c447fb358 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Maintainer: Jean-Francois Chevrette <jfchevrette@gmail.com>

_pkgname=kapp
pkgname=${_pkgname}-git
pkgver=r193.b0d6b82
pkgrel=1
pkgdesc='kapp is a simple deployment tool focused on the concept of "Kubernetes application"'
url="https://get-kapp.io/"
license=('Apache')
arch=('x86_64')
makedepends=('go-pie' 'ytt>=0.17.0')
source=("git+https://github.com/k14s/${_pkgname}/")
sha256sums=('SKIP')
provides=("kapp")

pkgver() {
	cd "${srcdir}/src/github.com/k14s/${_pkgname}"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	rm -rf "${srcdir}/src/github.com/k14s/${_pkgname}"
	mkdir -p "${srcdir}/src/github.com/k14s/${_pkgname}"
	mv -T "${srcdir}/${_pkgname}" "${srcdir}/src/github.com/k14s/${_pkgname}"
}

build() {
	cd "${srcdir}/src/github.com/k14s/${_pkgname}"

	export GOPATH="${srcdir}"

	mkdir -p tmp
	build_values_path="../../../${BUILD_VALUES:-./hack/build-values-default.yml}"
	(
		cd pkg/kapp/website
		ytt template \
			-f . \
			-f $build_values_path \
			--file-mark 'generated.go.txt:exclusive-for-output=true' \
			--output-directory ../../../tmp/
	)
	mv tmp/generated.go.txt pkg/kapp/website/generated.go

	go build -o kapp ./cmd/kapp/...
}

package() {
	cd "${srcdir}/src/github.com/k14s/${_pkgname}"
	install -Dm755 "${_pkgname}" "${pkgdir}"/usr/bin/${_pkgname}
	install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${_pkgname}/LICENSE
}