351.1. kup-6.8.2
Backup scheduler for Plasma — rsync, bup and encrypted restic plans run by hand, on a timer or after active use
| Version | 6.8.2, release 1 |
| Shelf | transfer — File transfer, synchronisation, backup and BitTorrent |
| Phase | 50_desktop (Desktop), 28 of 92 in build order |
| Licence | (GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL) AND GPL-2.0-only |
| Homepage | https://invent.kde.org/system/kup |
| Build time | 1.8 SBU |
| Installed size | 2.4 MiB in 19 files |
| Recipe | ports/core/transfer/kup/kpkgbuild |
About
Kup is Plasma’s backup scheduler. kup-daemon runs each backup plan by hand, on a timer or after a set amount of active use, a plan on an external drive once the drive is connected and a backup is due, and reports through notifications and a panel applet; the Backups page of System Settings edits the plans. A plan copies with rsync, keeping one mirror, with bup, keeping every version, or with restic, keeping every version encrypted. The restic: KIO worker shows a restic repository in Dolphin as one folder per snapshot, and kup-filedigger and the bup: worker browse bup archives.
Why it is in KDOS
The comment above it in script/phases/50_desktop/packages.txt:
Backup plans run on a timer or when a drive is plugged in.
Sources
kup-6.8.2.tar.xz(296.3 KiB)
sha256413d5edebd5590d47a274f26d8a5e92bb17808263e25e78fd6fe0b28ca0923f2
upstream: https://download.kde.org/stable/plasma/6.8.2/kup-6.8.2.tar.xz
archive copy: sources-4/transfer--kup-6.8.2.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, solid, kio, kidletime, ki18n, knotifications, kcoreaddons, kdbusaddons, kconfig, kconfigwidgets, kjobwidgets, kwidgetsaddons, kxmlgui, kcmutils, kcrash, kwindowsystem, kirigami, libplasma, libgit2, rsync, kwallet, restic.
Required by (1): kde-plasma.
Patches
build.sh applies these; kpkg applies nothing by itself.
restic-backend.patch adds restic as a third backup type, written for upstream and to be offered as a merge request against system/kup. A restic plan initialises an empty destination, optionally checks the repository, saves a snapshot tagged kup and, when asked, removes old ones with one fixed policy (every snapshot of two days, then daily for a month, weekly for six months, monthly for two years, yearly after); only kup-tagged snapshots are ever removed, so those kdos backup saves into the same repository are left alone. The password is kept in KWallet and reaches restic through a pipe at file descriptor 3, never as an argument or a variable; a plan may name a password file instead, which must be readable by its owner alone, the same rule kdos backup applies to ~/.config/kdos/backup.pass. The patch also adds kio_restic, which reads with restic --no-lock, so it browses read-only media and works while a backup runs.
The patch gives a restic plan ~/.restic as its destination where the plan’s stored default is bup’s ~/.bup: a new plan created as restic starts there, and choosing restic by hand moves a destination still at ~/.bup. The stored default is upstream’s and stays, so every saved plan reads back unchanged. The password field says “Stored in KDE Wallet” only when the wallet is enabled and holds the plan’s entry; KWallet reports a disabled wallet as holding every key, which on the live medium, where the wallet is off, would claim a password that is not there. A backup that has no password file and finds the wallet off fails with “the KDE Wallet is turned off … set a password file”, not with “enter it in the plan’s settings”: that field cannot store a password until the wallet is on.
restic-backend.patch— Add a restic backend: backup and maintenance jobs, a settings page option and a restic:/ KIO worker
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/50_desktop/phase.env && kpkg install kup'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/transfer/kup.
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/transfer/kup
echo '413d5edebd5590d47a274f26d8a5e92bb17808263e25e78fd6fe0b28ca0923f2 kup-6.8.2.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/kup
SRC=$SRC_ROOT/kup-6.8.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf kup-6.8.2.tar.xz -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 recipe’s helpers group and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/restic-backend.patch"
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D KDE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
-D BUILD_TESTING=OFF \
-D KF_SKIP_PO_PROCESSING=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-D KF_SKIP_PO_PROCESSING=ON— Skips building the interface translations, which the package-wide English-only rule would remove anyway (see Size and language policy).
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/kup, 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 kup-6.8.2-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/kup, and runs the triggers its paths call for.
Contents
Installed programs: kup-daemon, kup-filedigger, kup-purger.
Installed directories: /usr/share/licenses/kup.
Notes
Kup runs its engines as programs. restic and rsync are in depends for run time. bup and par2 are not ports, so a plan set to bup versioned backups cannot be chosen, the file digger button is hidden, and the Backups page offers restic for new plans. kdos backup stays the command-line tool for the same repositories.
kwallet holds the restic passwords, in the network wallet’s Kup folder, one entry per repository location; a password changed in the settings page replaces the entry and is never shown back. The daemon, the settings page and kio_restic link it, and the configure requires it.
libgit2 is linked, not run: a bup repository is a git object store, and the bup: worker and the file digger read it directly.
The daemon starts from /etc/xdg/autostart/kup-daemon.desktop at login. The panel applet links libplasma, which ties the port to the Plasma release it is built against.