From ad2d1f63f335e9f80de33fa501d78f46aea07a44 Mon Sep 17 00:00:00 2001 From: Moss Hope Date: Fri, 27 Sep 2024 15:56:48 -0700 Subject: [PATCH] incus: enable installing client without the daemon incus-client is intended to be installed without the daemon to use to control remove incus servers. incus the daemon can't me used without the client, at least to authorize another client's to access the API. I moved incus-user to the daemon package because it's a daemon and not part of the client. I added incus's generated manpages to the incus-client package. readme: I changed "and" to "or" because the two groups grant you access to the daemons in different privelege levels. --- srcpkgs/incus/files/README.voidlinux | 4 ++-- srcpkgs/incus/template | 30 +++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/srcpkgs/incus/files/README.voidlinux b/srcpkgs/incus/files/README.voidlinux index 2d1757447dda8e..31a55a3415ece8 100644 --- a/srcpkgs/incus/files/README.voidlinux +++ b/srcpkgs/incus/files/README.voidlinux @@ -1,6 +1,6 @@ Users wishing to interact with incus system daemons should belong to -the `_incus-admin` and `_incus` groups. The root user should also be -assigned a range of subordinate user and group IDs to be mapped in +either the `_incus-admin` or `_incus` group. The root user should also +be assigned a range of subordinate user and group IDs to be mapped in containers. For example, the command usermod --add-subuids 1000000-1065535 \ diff --git a/srcpkgs/incus/template b/srcpkgs/incus/template index a7c9857c58e33b..adb3f7c9cad376 100644 --- a/srcpkgs/incus/template +++ b/srcpkgs/incus/template @@ -1,7 +1,7 @@ # Template file for 'incus' pkgname=incus version=6.5.0 -revision=1 +revision=2 build_style=go build_helper=qemu go_import_path=github.com/lxc/incus/v6 @@ -11,7 +11,7 @@ make_check_args="-skip TestConvertNetworkConfig" hostmakedepends="pkg-config" makedepends="lxc-devel acl-devel cowsql-devel raft-devel libcap-devel libuv-devel sqlite-devel eudev-libudev-devel" -depends="lxc acl acl-progs rsync squashfs-tools xz dnsmasq iptables attr-progs" +depends="lxc acl acl-progs rsync squashfs-tools xz dnsmasq iptables attr-progs ${pkgname}-client-${version}_${revision}" short_desc="Powerful system container and virtual machine manager" maintainer="dkwo " license="Apache-2.0" @@ -38,6 +38,7 @@ post_install() { vinstall "${f}" 700 usr/libexec/incus && rm "${f}" done vsv incus + vsv incus-user # avoid conflict with lxd, lxd-lts mv ${DESTDIR}/usr/bin/{fuidshift,fuidshift-incus} @@ -46,24 +47,43 @@ post_install() { chmod 700 ${DESTDIR}/usr/bin/${_tool} done - # generate shell completions + #path to run incus commands in build local _incus=${DESTDIR}/usr/bin/incus + + # generate shell completions for _shell in bash fish zsh; do vtargetrun ${_incus} completion ${_shell} > scripts/${_shell}-completion done + #generate manpages and rename files to match the manpage's internal references + mkdir ${wrksrc}/man + vtargetrun ${_incus} manpage --all --format=man "${wrksrc}/man/" + for _manpage in ${wrksrc}/man/*; do + #CMD.SUBCMD.SUBSUBCMD.1 -> CMD-SUBCMD-SUBSUBCMD-1 + rename -a '.' '-' "$_manpage" + done + for _manpage in ${wrksrc}/man/*; do + #CMD-SUBCMD-SUBSUBCMD-1 -> CMD-SUBCMD-SUBSUBCMD.1 + rename -l '-' '.' "$_manpage" + done + vdoc "${FILESDIR}/README.voidlinux" } incus-client_package() { short_desc+=" - client" - depends="${sourcepkg}>=${version}_${revision}" pkg_install() { vmove usr/bin/incus - vsv incus-user + + #install shell completions for shell in bash fish zsh; do vcompletion scripts/${shell}-completion ${shell} incus done + + #install manpages + for _manpage in ${wrksrc}/man/*; do + vman "$_manpage" + done } }