94.4. bottom-0.14.9
Graphical process and system monitor for the terminal, as btm
| Version | 0.14.9, release 1 |
| Shelf | sysmon — Process, resource and system-information monitors |
| Phase | 41_system (System), 968 of 1047 in build order |
| Licence | MIT |
| Homepage | https://github.com/ClementTsang/bottom |
| Build time | 4.6 SBU |
| Installed size | 4.9 MiB in 4 files |
| Recipe | ports/core/sysmon/bottom/kpkgbuild |
About
bottom, run as btm, is a terminal system monitor with graphs of processor, memory, network and disk use beside a process table. The package adds a desktop entry, Resource Monitor, that opens it in a terminal from the launcher.
Sources
bottom-0.14.9.tar.gz(3.4 MiB)
sha2561dbb940c763fb583b7e1c7dfa165b73ed9a0ba712e72cc97311c5b1c098d5b72
upstream: https://github.com/ClementTsang/bottom/archive/refs/tags/0.14.9.tar.gz
archive copy: sources-4/sysmon--bottom-0.14.9.tar.gzbottom-vendor-0.14.9.tar.xz(19.3 MiB)
sha2566475e7880a74123f19ceccf99d7339038a0d261e66ae0a7ab2a29e61a4d09e56
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-4/sysmon--bottom-vendor-0.14.9.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 bottom'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/sysmon/bottom.
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/sysmon/bottom
echo '1dbb940c763fb583b7e1c7dfa165b73ed9a0ba712e72cc97311c5b1c098d5b72 bottom-0.14.9.tar.gz' | sha256sum -c -
echo '6475e7880a74123f19ceccf99d7339038a0d261e66ae0a7ab2a29e61a4d09e56 bottom-vendor-0.14.9.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/bottom
SRC=$SRC_ROOT/bottom-0.14.9
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf bottom-0.14.9.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 RUSTFLAGS="-C target-feature=-crt-static"
BTM_GENERATE=true cargo build --release --frozen --offline
install -Dm755 target/release/btm $PKG/usr/bin/btm
install -Dm644 target/tmp/bottom/manpage/btm.1 -t $PKG/usr/share/man/man1
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/btm.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Resource Monitor
GenericName=Resource Monitor
Comment=Graphs of CPU, memory, network and disks
Exec=btm
Icon=speedometer
Terminal=true
Categories=System;Monitor;
Keywords=process;cpu;memory;graph;bottom;btm;
EOF
chmod 644 "$PKG/usr/share/applications/btm.desktop"
The switches, and why each is set:
BTM_GENERATE=true— Make bottom’sbuild.rswrite the manual page and the shell completions while cargo builds the program, undertarget/tmp/bottom/. Without it the build script writes nothing.build.shinstalls the manual page,btm.1, from there; the generated completions are not installed.
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/bottom, 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 bottom-0.14.9-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/bottom, and runs the triggers its paths call for.
Contents
Installed programs: btm.
Installed directories: /usr/share/licenses/bottom.
Short descriptions
btm |
A customizable cross-platform graphical process/system monitor for the terminal. Supports Linux, macOS, and Windows. |
Notes
The crates come from the vendor bundle, bottom-vendor-<version>.tar.xz, made by ports/fetch with cargo vendor and unpacked into the top of the source tree, where cargo finds its configuration; the build runs --frozen --offline (see Vendoring). cargo installs no desktop entry, and upstream’s desktop/bottom.desktop is left in the source tree; the entry the package carries is the recipe’s own. See Desktop entries belong to the port.