Manage the currently used osspd slave via update-alternatives
authorRalf Jung <post@ralfj.de>
Mon, 9 Sep 2013 17:09:01 +0000 (19:09 +0200)
committerRalf Jung <post@ralfj.de>
Mon, 9 Sep 2013 18:46:41 +0000 (20:46 +0200)
debian/changelog
debian/osspd-alsa.postinst [new file with mode: 0644]
debian/osspd-alsa.prerm [new file with mode: 0644]
debian/osspd-pulseaudio.postinst [new file with mode: 0644]
debian/osspd-pulseaudio.prerm [new file with mode: 0644]
debian/osspd.init

index ad252c6f359f45d392cd303f52fda0a9b79244c7..b0cb468a2c985dbd09ca01981c111055360277b9 100644 (file)
@@ -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
 
   * 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 <post@ralfj.de>  Mon, 09 Sep 2013 18:29:12 +0200
 
 
  -- Ralf Jung <post@ralfj.de>  Mon, 09 Sep 2013 18:29:12 +0200
 
diff --git a/debian/osspd-alsa.postinst b/debian/osspd-alsa.postinst
new file mode 100644 (file)
index 0000000..64573ac
--- /dev/null
@@ -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 (file)
index 0000000..fee2410
--- /dev/null
@@ -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 (file)
index 0000000..84e2f2a
--- /dev/null
@@ -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 (file)
index 0000000..0f3c85d
--- /dev/null
@@ -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
index c95885a58b216c308557a7e003ac0e78ae7af702..77922b60ed28398aae6362405e98919ef9d63272 100644 (file)
@@ -17,7 +17,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="OSS Proxy Daemon"
 NAME=osspd
 DAEMON=/usr/sbin/$NAME
 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
 
 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
        #   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
        start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- -f \
                $DAEMON_ARGS \
                || return 2