From f054648f5925529b8a439918b4a0f5df466c0281 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 3 Nov 2023 16:21:05 +0800 Subject: [PATCH] Switch to compat 12. Remove vestiges of stretch support. This switches us to using dh_installsystemd, and fixes some service-restart-on-upgrade paths. compat 12 was introduced in buster, so this won't work on stretch, but we no longer support stretch so that's OK. Also work around debhelper bug #989155 on buster/bullseye. --- debian-bullseye/dump978-fa.preinst | 7 +++++++ debian-bullseye/skyaware978.preinst | 7 +++++++ debian-buster/dump978-fa.preinst | 7 +++++++ debian-buster/skyaware978.preinst | 7 +++++++ debian/compat | 2 +- debian/control | 6 ++++-- debian/rules | 7 +++---- prepare-build.sh | 6 +----- 8 files changed, 37 insertions(+), 12 deletions(-) create mode 100755 debian-bullseye/dump978-fa.preinst create mode 100755 debian-bullseye/skyaware978.preinst create mode 100755 debian-buster/dump978-fa.preinst create mode 100755 debian-buster/skyaware978.preinst diff --git a/debian-bullseye/dump978-fa.preinst b/debian-bullseye/dump978-fa.preinst new file mode 100755 index 0000000..8b1adf8 --- /dev/null +++ b/debian-bullseye/dump978-fa.preinst @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Work around Debian bug #989155 +if [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then + deb-systemd-invoke stop 'dump978-fa.service' >/dev/null || true +fi diff --git a/debian-bullseye/skyaware978.preinst b/debian-bullseye/skyaware978.preinst new file mode 100755 index 0000000..a0fb4f2 --- /dev/null +++ b/debian-bullseye/skyaware978.preinst @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Work around Debian bug #989155 +if [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then + deb-systemd-invoke stop 'skyaware978.service' >/dev/null || true +fi diff --git a/debian-buster/dump978-fa.preinst b/debian-buster/dump978-fa.preinst new file mode 100755 index 0000000..8b1adf8 --- /dev/null +++ b/debian-buster/dump978-fa.preinst @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Work around Debian bug #989155 +if [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then + deb-systemd-invoke stop 'dump978-fa.service' >/dev/null || true +fi diff --git a/debian-buster/skyaware978.preinst b/debian-buster/skyaware978.preinst new file mode 100755 index 0000000..a0fb4f2 --- /dev/null +++ b/debian-buster/skyaware978.preinst @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Work around Debian bug #989155 +if [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then + deb-systemd-invoke stop 'skyaware978.service' >/dev/null || true +fi diff --git a/debian/compat b/debian/compat index f599e28..48082f7 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -10 +12 diff --git a/debian/control b/debian/control index 32b51f1..af67d68 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,15 @@ Source: dump978-fa Section: embedded Priority: extra -Maintainer: Oliver Jowett -Build-Depends: debhelper(>=10), libboost-system-dev, libboost-program-options-dev, libboost-regex-dev, libboost-filesystem-dev, libsoapysdr-dev +Maintainer: Oliver Jowett +Build-Depends: debhelper(>=12), libboost-system-dev, libboost-program-options-dev, libboost-regex-dev, libboost-filesystem-dev, libsoapysdr-dev Standards-Version: 3.9.3 Homepage: http://www.flightaware.com/ Vcs-Git: https://github.com/flightaware/dump978.git Package: dump978-fa Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, adduser Recommends: skyaware978, soapysdr-module-rtlsdr Description: ADS-B UAT Ground Station System @@ -19,6 +20,7 @@ Package: skyaware978 Replaces: skyview978 (<< 3.7.2~) Breaks: skyview978 (<< 3.7.2~) Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lighttpd Description: Local web interface for dump978 . diff --git a/debian/rules b/debian/rules index d051c1d..46d0d4a 100755 --- a/debian/rules +++ b/debian/rules @@ -15,9 +15,8 @@ override_dh_auto_build: override_dh_installinit: dh_installinit --no-stop-on-upgrade --no-restart-after-upgrade -override_dh_systemd_start: - dh_systemd_start --no-stop-on-upgrade --no-restart-after-upgrade --name=dump978-fa.service - dh_systemd_start --no-stop-on-upgrade --no-restart-after-upgrade --name=skyaware978.service +override_dh_installsystemd: + dh_installsystemd --no-restart-after-upgrade %: - dh $@ --with=systemd + dh $@ diff --git a/prepare-build.sh b/prepare-build.sh index dc8f5f7..1e64e68 100755 --- a/prepare-build.sh +++ b/prepare-build.sh @@ -35,13 +35,9 @@ FILES=$(find $TOP -mindepth 1 -maxdepth 1 -name .git -prune -o -name 'debian*' - mkdir -p $OUT cp -a $FILES $OUT cp -a $TOP/debian $OUT +[ -d $TOP/debian-$DIST ] && cp -a $TOP/debian-$DIST/* $OUT/debian/ case "$DIST" in - stretch) - echo "Updating changelog for stretch backport build" >&2 - dch --changelog $OUT/debian/changelog --local ~bpo9+ --force-distribution --distribution stretch-backports "Automated backport build for stretch" - ;; - buster) echo "Updating changelog for buster backport build" >&2 dch --changelog $OUT/debian/changelog --local ~bpo10+ --force-distribution --distribution buster-backports "Automated backport build for buster"