From 340cbcfe220b68d5e0883eaa6ce0a81bf4b7efc5 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sat, 13 Jun 2026 10:25:30 +0000 Subject: [PATCH] fix(packaging): point the packaged systemd unit at /usr/bin/punktfunk-host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scripts/punktfunk-host.service is dev-oriented — its ExecStart references the source tree (%h/punktfunk/target/release/punktfunk-host). When the deb/rpm ship it to /usr/lib/systemd/user, a fresh install with no hand-rolled unit would try to run a binary that isn't there. Rewrite the ExecStart to the installed /usr/bin/punktfunk-host during packaging (sed in build-deb.sh + the spec); the source unit stays as-is for from-source dev. Hosts with a custom ~/.config unit (which shadows the packaged one) are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- packaging/debian/build-deb.sh | 4 ++++ packaging/rpm/punktfunk.spec | 3 +++ 2 files changed, 7 insertions(+) diff --git a/packaging/debian/build-deb.sh b/packaging/debian/build-deb.sh index 3c5a5de..017d7e9 100755 --- a/packaging/debian/build-deb.sh +++ b/packaging/debian/build-deb.sh @@ -41,6 +41,10 @@ install -Dm0644 scripts/60-punktfunk.rules "$STAGE/usr/lib/udev/rules.d/ # and high-bitrate frames overflow it (send-side packet loss). systemd-sysctl applies it at boot. install -Dm0644 scripts/99-punktfunk-net.conf "$STAGE/usr/lib/sysctl.d/99-punktfunk-net.conf" install -Dm0644 scripts/punktfunk-host.service "$STAGE/usr/lib/systemd/user/punktfunk-host.service" +# The source unit's ExecStart points at the dev source tree; a packaged install has the binary at +# /usr/bin. Rewrite it so a fresh apt install (no hand-rolled unit) starts the installed binary. +sed -i 's#%h/punktfunk/target/release/punktfunk-host#/usr/bin/punktfunk-host#' \ + "$STAGE/usr/lib/systemd/user/punktfunk-host.service" install -Dm0755 scripts/headless/run-headless-kde.sh "$SHAREDIR/headless/run-headless-kde.sh" install -Dm0755 scripts/headless/run-headless-sway.sh "$SHAREDIR/headless/run-headless-sway.sh" install -Dm0644 scripts/host.env.example "$SHAREDIR/host.env.example" diff --git a/packaging/rpm/punktfunk.spec b/packaging/rpm/punktfunk.spec index b8b3027..e81d10e 100644 --- a/packaging/rpm/punktfunk.spec +++ b/packaging/rpm/punktfunk.spec @@ -136,6 +136,9 @@ install -Dm0644 scripts/99-punktfunk-net.conf %{buildroot}%{_prefix}/lib/sysctl. # systemd *user* unit (the host runs in the graphical session, not as root). install -Dm0644 scripts/punktfunk-host.service %{buildroot}%{_userunitdir}/punktfunk-host.service +# The source unit's ExecStart points at the dev source tree; a packaged install has the binary at +# %{_bindir}. Rewrite it so a fresh install (no hand-rolled unit) starts the installed binary. +sed -i 's#%h/punktfunk/target/release/punktfunk-host#%{_bindir}/punktfunk-host#' %{buildroot}%{_userunitdir}/punktfunk-host.service # --- client subpackage --- install -Dm0755 target/release/punktfunk-client %{buildroot}%{_bindir}/punktfunk-client