aboutsummaryrefslogtreecommitdiffstats
path: root/testing/k3s/APKBUILD
blob: dd5559a7e72ed60a05cf9dff0888a2596f30d25a (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
54
55
56
57
58
59
60
61
62
63
64
# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=k3s
_pkgver=1.17.0+k3s.1
pkgver=${_pkgver/+k3s/}
pkgrel=0
pkgdesc="Lightweight Kubernetes. 5 less than k8s."
url="https://k3s.io"
arch="all"
license="Apache-2.0"
options="chmod-clean !check" # No test suite from upstream
depends="cni-plugins conntrack-tools containerd coreutils findutils ipset"
makedepends="go linux-headers"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/rancher/k3s/archive/v$_pkgver.tar.gz
	k3s.initd
	k3s.confd
	"
builddir="$srcdir/src/github.com/rancher/$pkgname"

# secfixes:
#   0.8.1-r0:
#     - CVE-2019-9512
#     - CVE-2019-9514
#   0.8.0-r0:
#     - CVE-2019-11247
#     - CVE-2019-11249

prepare() {
	export GOPATH="$srcdir"

	mkdir -p "$(dirname $builddir)"
	mv "$srcdir"/$pkgname-${_pkgver/+/-} "$builddir"/

	default_prepare
}

build() {
	msg2 "Prepare GOPATH and GOBIN..."
	export GOPATH="$srcdir"
	export GOBIN="$GOPATH/bin"

	msg2 "Building k3s..."
	go build -o k3s

	msg2 "Building kubectl..."
	go build -o kubectl ./cmd/kubectl
}

package() {
	install -m755 -D k3s \
		"$pkgdir"/usr/bin/k3s
	install -m755 -D kubectl \
		"$pkgdir"/usr/bin/kubectl

	install -m644 -D -t "$pkgdir"/usr/share/doc/$pkgname README.md

	install -m755 -D "$srcdir"/k3s.initd "$pkgdir"/etc/init.d/k3s
	install -m644 -D "$srcdir"/k3s.confd "$pkgdir"/etc/conf.d/k3s
}

sha512sums="0fe69d9b43b88fa0c63ce55acbd6f23a645a74f9319cd8dd128a9fe7ea5e758df195e79ac9d2a91dc137d84db6cf68128ff53552c76cf5b81ab75f72cd6d1636  k3s-1.17.0.1.tar.gz
9501422f1bf5375555116cbeedb32de32109153396699bde1300ce01156c3e57fe3fb14a57f7de1dce47c955e5e6d61de7fea181a07b407f5b452006bc58991c  k3s.initd
dda2fc70e884ef439fece8f850d798f98d07cd431f0b8b79183f192b35f68fc7c633d3c790aae7b86ca57331212a7bb2f783131b752a4e1e71ef918469e6b944  k3s.confd"