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