From 30361ff58260f3dbd86d908f0234d459065a8a7d Mon Sep 17 00:00:00 2001 From: Kyle Nusbaum Date: Thu, 13 Sep 2018 11:35:26 -0500 Subject: [PATCH] kubernetes-helm: Include documentation in package. --- srcpkgs/kubernetes-helm/template | 39 +++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/srcpkgs/kubernetes-helm/template b/srcpkgs/kubernetes-helm/template index 6b76f2da47..9a56ecb4ae 100644 --- a/srcpkgs/kubernetes-helm/template +++ b/srcpkgs/kubernetes-helm/template @@ -12,7 +12,19 @@ checksum=544511a814a0aefc4f74e196d96bea7930d83df059551d0b57c28439f6df4137 nopie=true conflicts="helm" wrksrc="helm-${version}" -_go_target_arch=$(source /void-packages/common/environment/build-style/go.sh; echo $GOARCH) + +_convert_arch() { + case "$1" in + aarch64*) echo arm64;; + armv6*) echo arm;; + armv7*) echo arm;; + i686*) echo 386;; + x86_64*) echo amd64;; + esac +} + +export _go_target_arch=$(_convert_arch $XBPS_TARGET_MACHINE) +export _go_host_arch=$(_convert_arch $XBPS_MACHINE) do_extract() { mkdir -p golib/src/k8s.io/helm @@ -38,12 +50,27 @@ pre_build() { do_build() { cd golib/src/k8s.io/helm - TARGETS="linux/${_go_target_arch}" make bootstrap build-cross APP="..." + TARGETS="linux/${_go_target_arch} linux/${_go_host_arch}" make bootstrap build-cross APP="..." + + _dist/linux-${_go_host_arch}/helm completion bash > completion.bash + _dist/linux-${_go_host_arch}/helm completion zsh > completion.zsh } do_install() { - vbin golib/src/k8s.io/helm/_dist/linux-${_go_target_arch}/helm - vbin golib/src/k8s.io/helm/_dist/linux-${_go_target_arch}/rudder - vbin golib/src/k8s.io/helm/_dist/linux-${_go_target_arch}/tiller - vlicense golib/src/k8s.io/helm/LICENSE + cd golib/src/k8s.io/helm + + # Copy documentation and examples. + vmkdir usr/share/examples/$pkgname + vcopy "docs/examples/*" usr/share/examples/$pkgname + for file in docs/man/man1/*.1; do + vman ${file} + done + vinstall completion.bash 644 usr/share/bash-completion/completions helm + vinstall completion.zsh 644 usr/share/$pkgname + + # Copy binaries and license + vbin _dist/linux-${_go_target_arch}/helm + vbin _dist/linux-${_go_target_arch}/rudder + vbin _dist/linux-${_go_target_arch}/tiller + vlicense LICENSE }