Skip to content

Commit

Permalink
incus: reverse dependency; add man pages
Browse files Browse the repository at this point in the history
    incus-client is intended to be installed without the daemon to use to
    control remote incus servers. incus the daemon can't be used without
    the client, at least to authorize another client 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.
  • Loading branch information
duskmoss committed Oct 1, 2024
1 parent 33593e6 commit b95535b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
4 changes: 2 additions & 2 deletions srcpkgs/incus/files/README.voidlinux
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
30 changes: 25 additions & 5 deletions srcpkgs/incus/template
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <npiazza@disroot.org>"
license="Apache-2.0"
Expand All @@ -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}
Expand All @@ -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
}
}

Expand Down

0 comments on commit b95535b

Please sign in to comment.