void-packages/srcpkgs/k3s/template
Noel Cower 997c6de534 k3s: update to 1.0.0.
Moves most vsed stuff into the given patch. Part of this is to force
reviewing it each time it doesn't apply cleanly (it probably won't most
of the time), the other is to stop cramming things into vsed, since
that's hackier than just patching the files.

0.10.x onward adds a dependency on ipset and conntrack-tools. Without
ipset, k3s will crash upon startup. Not having conntrack appears to be
a non-crashing error, but will result in error logs when deleting stale
service IPs.

This adds a new distfile, part of which motivated the patching, to
avoid running a direct 'git clone' of a repository in the build script.

Services now redirect stderr to stdout, as they probably weren't
capturing log output before.

hyperkube is no longer provided in k3s. As a result, k3s no longer
conflicts with kubernetes.
2019-12-02 19:52:22 +01:00

54 lines
1.6 KiB
Bash

# Template file for 'k3s'
pkgname=k3s
version=1.0.0
revision=1
create_wrksrc=yes
build_wrksrc="${pkgname}-${version}"
build_style=go
go_import_path="github.com/rancher/k3s"
hostmakedepends="git pkg-config"
makedepends="libseccomp-devel"
depends="ipset conntrack-tools"
short_desc="Lightweight Kubernetes"
maintainer="Cameron Nemo <cnemo@tutanota.com>"
license="Apache-2.0"
homepage="https://k3s.io"
# _traefik_* variables' values from scripts/download in source distfile
_traefik_version="1.77.1"
_traefik_file="traefik-${_traefik_version}.tgz"
_plugins_version="0.7.6-k3s1"
_plugins_file="v${_plugins_version}.tar.gz"
distfiles="https://${go_import_path}/archive/v${version}.tar.gz
https://github.com/rancher/plugins/archive/${_plugins_file}
https://kubernetes-charts.storage.googleapis.com/${_traefik_file}"
checksum="7b9222dcaa4bbc387dd6f38a653b7b2b09079987c19a399c6c4f3e5b3dc1d39c
75e02aa09edcfb2b43d41cd576e24099e9bca21d80bda0dcdc3f98f2357f1363
15dd78d136d7c9bae7144072052ef6cd12821ae081a7c085f145d834d96c5d5c"
skip_extraction="${_traefik_file}"
_git_commit=18bd921cddee1e95cc03467a1b9636ddacd9d670
pre_build() {
# Modify version.sh to use template variables' values.
vsed -i scripts/version.sh -e '
s@^COMMIT=.*@COMMIT='"${_git_commit::10}"'@;
s@^GIT_TAG=.*@GIT_TAG=v'"${version}"'@
'
# Recreate behavior of scripts/download minus downloading
# anything or having anything to do with busybox.
mkdir -p etc bin build/static/charts
cp ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_traefik_file} build/static/charts/${_traefik_file}
}
do_build() {
scripts/build
scripts/package-cli
}
do_install() {
vbin dist/artifacts/k3s
vsv k3s-server
vsv k3s-agent
}