107.2. mqttui-0.24.0
Subscribe to an MQTT broker and watch the topic tree, in the terminal
| Version | 0.24.0, release 1 |
| Shelf | net-diag — Network diagnostics, capture, measurement and low-level socket tools |
| Phase | 41_system (System), 781 of 1047 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://github.com/EdJoPaTo/mqttui |
| Build time | 4.0 SBU |
| Installed size | 6.5 MiB in 7 files |
| Recipe | ports/core/net-diag/mqttui/kpkgbuild |
About
mqttui subscribes to an MQTT broker and shows the topic tree in the terminal, with each topic’s payloads as they arrive. Its subcommands also publish, log topics to standard output, read one value for a script (read-one) and clean retained topics. Where mosquitto_sub prints a stream of messages, mqttui shows the topic tree they belong to.
Why it is in KDOS
The comment above it in script/phases/41_system/packages.d/net-diag.txt:
Watching a topic tree is how an MQTT problem is diagnosed; mosquitto_sub prints a stream and this shows the tree it belongs to.
Sources
mqttui-0.24.0.tar.gz(221.8 KiB)
sha256287de6901f43bf1d879be25acffb02f7601e023afc90b11c8e0504e757a6589f
upstream: https://github.com/EdJoPaTo/mqttui/archive/refs/tags/v0.24.0.tar.gz
archive copy: sources-3/net-diag--mqttui-0.24.0.tar.gzmqttui-vendor-0.24.0.tar.xz(23.4 MiB)
sha256f9f4c693a8b772fb5f0ed35cf1df115d979979fe7f7d82598797a2ae0887e28d
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-3/net-diag--mqttui-vendor-0.24.0.tar.xz
Dependencies
Depends on: rust.
Required by: no port names it.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install mqttui'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/net-diag/mqttui.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/net-diag/mqttui
echo '287de6901f43bf1d879be25acffb02f7601e023afc90b11c8e0504e757a6589f mqttui-0.24.0.tar.gz' | sha256sum -c -
echo 'f9f4c693a8b772fb5f0ed35cf1df115d979979fe7f7d82598797a2ae0887e28d mqttui-vendor-0.24.0.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/mqttui
SRC=$SRC_ROOT/mqttui-0.24.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf mqttui-0.24.0.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export CARGO_HOME="$SRC_ROOT/.cargo"
export RUSTFLAGS="-C target-feature=-crt-static"
export CARGO_NET_OFFLINE=true
cargo build --release --frozen --offline
install -Dm755 target/release/mqttui $PKG/usr/bin/mqttui
install -Dm644 target/manpages/*.1 -t $PKG/usr/share/man/man1
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/mqttui, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf mqttui-0.24.0-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/mqttui, and runs the triggers its paths call for.
Contents
Installed programs: mqttui.
Installed directories: /usr/share/licenses/mqttui.
Short descriptions
mqttui |
Subscribe to a MQTT Topic or publish something quickly from the terminal |
Notes
The crates come from the vendor bundle, mqttui-vendor-<version>.tar.xz, pinned with its own sha256 = line and unpacked at the top of the tree; cargo builds --frozen --offline from it (see Vendoring).
Its TLS goes through rustls with the default AWS-LC provider, compiled into the binary by aws-lc-sys. mqttui has no build feature that moves its TLS onto the system OpenSSL, so the copy is listed in /usr/share/kdos/bundled.txt, which kdos cve reads; see Bundled copies. A vendor bundle that moves aws-lc-sys changes mqttui’s row there.
The manual pages, mqttui.1 and one for each subcommand, are generated by the crate’s build.rs with clap_mangen into target/manpages, which build.sh installs from; the shell completions it writes beside them into target/completions are not installed.