diff options
-rw-r--r-- | dvswitch-avahi/Makefile | 14 | ||||
-rw-r--r-- | dvswitch-avahi/debian/control | 17 | ||||
-rwxr-xr-x | dvswitch-avahi/debian/dvsource-avahi.init | 48 | ||||
-rwxr-xr-x | dvswitch-avahi/debian/dvswitch-avahi.init | 57 | ||||
-rwxr-xr-x | dvswitch-avahi/debian/rules | 5 |
5 files changed, 132 insertions, 9 deletions
diff --git a/dvswitch-avahi/Makefile b/dvswitch-avahi/Makefile index f018256..ed329d8 100644 --- a/dvswitch-avahi/Makefile +++ b/dvswitch-avahi/Makefile @@ -11,9 +11,13 @@ clean: install: $(INSTALL) -d $(DESTDIR)$(bindir) - $(INSTALL) dvswitch-avahi dvsink-files-avahi $(DESTDIR)$(bindir) + + $(INSTALL) dvswitch-avahi $(DESTDIR)$(bindir)/. + + $(INSTALL) dvsink-files-avahi $(DESTDIR)$(bindir)/. ln -s dvsink-files-avahi $(DESTDIR)$(bindir)/dvsink-command-avahi - ln -s dvsink-files-avahi $(DESTDIR)$(bindir)/dvsource-dvgrab-avahi - ln -s dvsink-files-avahi $(DESTDIR)$(bindir)/dvsource-firewire-avahi - ln -s dvsink-files-avahi $(DESTDIR)$(bindir)/dvsource-v4l2-dv-avahi - ln -s dvsink-files-avahi $(DESTDIR)$(bindir)/dvsource-alsa-avahi + + $(INSTALL) dvsink-files-avahi $(DESTDIR)$(bindir)/dvsource-dvgrab-avahi + ln -s dvsource-dvgrab-avahi $(DESTDIR)$(bindir)/dvsource-firewire-avahi + ln -s dvsource-dvgrab-avahi $(DESTDIR)$(bindir)/dvsource-v4l2-dv-avahi + ln -s dvsource-dvgrab-avahi $(DESTDIR)$(bindir)/dvsource-alsa-avahi diff --git a/dvswitch-avahi/debian/control b/dvswitch-avahi/debian/control index 49e4313..8258a21 100644 --- a/dvswitch-avahi/debian/control +++ b/dvswitch-avahi/debian/control @@ -9,7 +9,20 @@ Homepage: http://www.nuug.no/ Package: dvswitch-avahi Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, - dvswitch -Suggests: dvsource, dvsink + dvswitch, avahi-utils +Description: DVSwitch wrappers to find sinks and sources dynamically + Use Avahi to find dvswitch sources and sinks. + +Package: dvsource-avahi +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, + dvsource, avahi-utils +Description: DVSwitch wrappers to find sinks and sources dynamically + Use Avahi to find dvswitch sources and sinks. + +Package: dvsink-avahi +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, + dvsink, avahi-utils Description: DVSwitch wrappers to find sinks and sources dynamically Use Avahi to find dvswitch sources and sinks. diff --git a/dvswitch-avahi/debian/dvsource-avahi.init b/dvswitch-avahi/debian/dvsource-avahi.init new file mode 100755 index 0000000..ea14dd5 --- /dev/null +++ b/dvswitch-avahi/debian/dvsource-avahi.init @@ -0,0 +1,48 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: dvsource-avahi +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Should-Start: dvswitch-avahi avahi +# Should-Stop: dvswitch-avahi avahi +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: Start dvswitch sources at boot time. +# Description: To enable this, set the appropriate boot argument +# on the kernel command line. Locates dvswitch server +# using avahi. +### END INIT INFO + +ENABLED=false + +. /lib/init/vars.sh # for $VERBOSE + +if grep -qw dvsource /proc/cmdline ; then + ENABLED=true +fi + +if [ -f /etc/default/dvsource ] ; then + . /etc/default/dvsource +fi + +case "$1" in + start) + if [ true = "$ENABLED" ] ; then + # How can we detect if a camera is attached? + [ "$VERBOSE" != no ] && log_action_begin_msg "Starting dvsource-firewire-avahi" + dvsource-firewire-avahi & + [ "$VERBOSE" != no ] && log_action_end_msg 0 + + # Can we detect USB cameras? Until we know a way, just try to start and see if it work + [ "$VERBOSE" != no ] && log_action_begin_msg "Starting dvsource-v4l2-dv-avahi /dev/video0" + dvsource-v4l2-dv-avahi /dev/video0 & + [ "$VERBOSE" != no ] && log_action_end_msg 0 + fi + ;; + stop) + ;; + restart) + ;; + force-reload) + ;; +esac diff --git a/dvswitch-avahi/debian/dvswitch-avahi.init b/dvswitch-avahi/debian/dvswitch-avahi.init new file mode 100755 index 0000000..83f74a2 --- /dev/null +++ b/dvswitch-avahi/debian/dvswitch-avahi.init @@ -0,0 +1,57 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: dvswitch-avahi +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Should-Start: avahi +# Should-Stop: avahi +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: Start dvswitch related scripts at boot time. +# Description: To enable this, set the appropriate boot argument +# on the kernel command line. +### END INIT INFO + +ENABLED=false + +. /lib/init/vars.sh # for $VERBOSE + +if grep -qw dvswitch /proc/cmdline ; then + ENABLED=true +fi + +if [ -f /etc/default/dvswitch ] ; then + . /etc/default/dvswitch +fi + +xsession() { + xterm -e bash -c "/usr/bin/dvswitch-avahi ; bash" & + sleep 5 + twm +} + +case "$1" in + start) + if [ true = "$ENABLED" ]; then + startx $0 xsession -- :0 & + # Wait for 5 seconds for the avahi announcement, to make sure dvsources started after this script + # will find the server + for f in 1 2 3 4 5 ; do + found=$(avahi-browse -tr -v _dvswitch._tcp 2>&1 | awk '/address = / { print $3 }') + if [ "$found" ] ; then + sleep 5 # Give dvswitch process a chance to start too + break + fi + done + fi + ;; + stop) + ;; + restart) + ;; + force-reload) + ;; + xsession) + xsession + ;; +esac diff --git a/dvswitch-avahi/debian/rules b/dvswitch-avahi/debian/rules index d0feffa..79ea045 100755 --- a/dvswitch-avahi/debian/rules +++ b/dvswitch-avahi/debian/rules @@ -5,7 +5,7 @@ export LC_ALL=C package=dvswitch-avahi debdir=$(shell pwd)/debian -DESTDIR=${debdir}/$(package) +DESTDIR=${debdir}/tmp build: build-stamp build-stamp: @@ -32,7 +32,6 @@ binary-arch: build dh_installdirs make install DESTDIR=${DESTDIR} - mkdir -p $(DESTDIR)/etc/apache/conf.d dh_install --sourcedir=${DESTDIR} dh_installdocs @@ -44,6 +43,8 @@ binary-arch: build dh_fixperms dh_installdeb dh_shlibdeps + dh_installinit -pdvswitch-avahi --no-start -u"start 18 2 3 4 5 . stop 82 1 ." + dh_installinit -pdvsource-avahi --no-start -u"start 20 2 3 4 5 . stop 80 1 ." dh_gencontrol dh_md5sums dh_builddeb |