From 2f43083e03c5948ae6246d1cf446c47eaca0b61c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 9 Sep 2013 19:09:01 +0200 Subject: [PATCH] Manage the currently used osspd slave via update-alternatives --- debian/changelog | 3 ++- debian/osspd-alsa.postinst | 9 +++++++++ debian/osspd-alsa.prerm | 10 ++++++++++ debian/osspd-pulseaudio.postinst | 9 +++++++++ debian/osspd-pulseaudio.prerm | 10 ++++++++++ debian/osspd.init | 3 ++- 6 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 debian/osspd-alsa.postinst create mode 100644 debian/osspd-alsa.prerm create mode 100644 debian/osspd-pulseaudio.postinst create mode 100644 debian/osspd-pulseaudio.prerm diff --git a/debian/changelog b/debian/changelog index ad252c6..b0cb468 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,8 @@ osspd (1.3.2-4) UNRELEASED; urgency=low * Move backends into their own packages. * No longer symlink docs from dbg package (this simplifies - packaging) + packaging). + * Manage the ossp slave via update-alternatives. -- Ralf Jung Mon, 09 Sep 2013 18:29:12 +0200 diff --git a/debian/osspd-alsa.postinst b/debian/osspd-alsa.postinst new file mode 100644 index 0000000..64573ac --- /dev/null +++ b/debian/osspd-alsa.postinst @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +update-alternatives --install /usr/lib/osspd/ossp-slave \ + ossp-slave /usr/lib/osspd/ossp-alsap 60 + +#DEBHELPER# + +exit 0 diff --git a/debian/osspd-alsa.prerm b/debian/osspd-alsa.prerm new file mode 100644 index 0000000..fee2410 --- /dev/null +++ b/debian/osspd-alsa.prerm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +if [ "$1" = "remove" ]; then + update-alternatives --remove ossp-slave /usr/lib/osspd/ossp-alsap +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/osspd-pulseaudio.postinst b/debian/osspd-pulseaudio.postinst new file mode 100644 index 0000000..84e2f2a --- /dev/null +++ b/debian/osspd-pulseaudio.postinst @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +update-alternatives --install /usr/lib/osspd/ossp-slave \ + ossp-slave /usr/lib/osspd/ossp-padsp 70 + +#DEBHELPER# + +exit 0 diff --git a/debian/osspd-pulseaudio.prerm b/debian/osspd-pulseaudio.prerm new file mode 100644 index 0000000..0f3c85d --- /dev/null +++ b/debian/osspd-pulseaudio.prerm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +if [ "$1" = "remove" ]; then + update-alternatives --remove ossp-slave /usr/lib/osspd/ossp-padsp +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/osspd.init b/debian/osspd.init index c95885a..77922b6 100644 --- a/debian/osspd.init +++ b/debian/osspd.init @@ -17,7 +17,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="OSS Proxy Daemon" NAME=osspd DAEMON=/usr/sbin/$NAME -DAEMON_ARGS="-f" # run in foreground, start-stop-daemon does the forking: required to let start-stop-daemon handle the pidfile +DAEMON_ARGS="--dsp-slave=/usr/lib/osspd/ossp-slave" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME @@ -39,6 +39,7 @@ do_start() # 2 if daemon could not be started start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON --test > /dev/null \ || return 1 + # -f: run in foreground, start-stop-daemon does the forking - this is required to let start-stop-daemon handle the pidfile start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- -f \ $DAEMON_ARGS \ || return 2 -- 2.30.2