summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 949cb96ec051f6591eb1fb075d66cd0566bf1f2e (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
52
53
# Maintainer: Michael William Le Nguyen <michael at mail dot ttp dot codes>
pkgname=rke
pkgver=1.0.3
pkgrel=1
pkgdesc="An extremely simple, lightning fast Kubernetes installer that works everywhere."
arch=('x86_64')
url="https://github.com/rancher/rke"
license=('apache')

makedepends=(
	"git"
	# Cannot be built with go-pie due to rke's build flags.
	"go>=1.11"
)
source=(
	"rke-${pkgver}::git+https://github.com/rancher/rke#tag=v${pkgver}"
	"build.patch"
	"ci.patch"
	"version.patch"
)
sha512sums=(
	"SKIP"
	"cf18becc521bedafb13658d15e2a7ab8f847e375f4b4f6326320f587a11c657af6b4acd2d13e5fe885138a6c337336ed3d18001b6deb54425f96cfe6862d0331"
	"097d6211104ac7772d6f96c792902f690513b6e780a686c3fdda32ef66c6dd530c7c97a575fd380c4c627e8f7c1192cd877c1512d07a118ff1ad005a2f0cc14b"
	"e586996e0acc0736116cd6bd085c5bfa01bb67bf73a99fc9dcddb0c56597485a78612456dd1bcf2d8d97e54cef3b61429df4874877c88fa24b1944a04093f6f4"
)

prepare () {
	cd "${pkgname}-${pkgver}"
	patch --forward --strip=1 --input="${srcdir}/build.patch"
	patch --forward --strip=1 --input="${srcdir}/ci.patch"
	patch --forward --strip=1 --input="${srcdir}/version.patch"
}
build () {
	export GOPATH="${srcdir}/go"
	cd "${pkgname}-${pkgver}"
	./scripts/entry build
}
check () {
	export GOPATH="${srcdir}/go"
	export PATH="$PATH:${srcdir}/go/bin"
	go get -u golang.org/x/lint/golint
	cd "${pkgname}-${pkgver}"
	./scripts/entry test
	./scripts/entry validate
	# Integration tests not run due to requiring a ton of kernel modules just to test locally.
}
package() {
	export GOPATH="${srcdir}/go"
	# *sigh*: https://github.com/golang/go/issues/27455
	go clean -modcache
	install -D -m755 "${srcdir}/${pkgname}-${pkgver}/bin/rke" "${pkgdir}/usr/bin/${pkgname}"
}