summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dvswitch-avahi/Makefile19
-rw-r--r--dvswitch-avahi/debian/changelog5
-rw-r--r--dvswitch-avahi/debian/compat1
-rw-r--r--dvswitch-avahi/debian/control15
-rw-r--r--dvswitch-avahi/debian/copyright8
-rwxr-xr-xdvswitch-avahi/debian/rules53
-rwxr-xr-xdvswitch-avahi/dvsink-files-avahi17
-rwxr-xr-xdvswitch-avahi/dvswitch-avahi18
8 files changed, 136 insertions, 0 deletions
diff --git a/dvswitch-avahi/Makefile b/dvswitch-avahi/Makefile
new file mode 100644
index 0000000..f018256
--- /dev/null
+++ b/dvswitch-avahi/Makefile
@@ -0,0 +1,19 @@
+DESTDIR =
+prefix = /usr
+bindir = $(prefix)/bin
+
+INSTALL = install -m755
+INSTALL_DATA = install -m644
+
+all:
+
+clean:
+
+install:
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+ $(INSTALL) dvswitch-avahi 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
diff --git a/dvswitch-avahi/debian/changelog b/dvswitch-avahi/debian/changelog
new file mode 100644
index 0000000..3d71a42
--- /dev/null
+++ b/dvswitch-avahi/debian/changelog
@@ -0,0 +1,5 @@
+dvswitch-avahi (0.0.0-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Petter Reinholdtsen <pere@debian.org> Mon, 15 Mar 2010 22:00:28 +0100
diff --git a/dvswitch-avahi/debian/compat b/dvswitch-avahi/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/dvswitch-avahi/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/dvswitch-avahi/debian/control b/dvswitch-avahi/debian/control
new file mode 100644
index 0000000..49e4313
--- /dev/null
+++ b/dvswitch-avahi/debian/control
@@ -0,0 +1,15 @@
+Source: dvswitch-avahi
+Section: misc
+Priority: optional
+Maintainer: Petter Reinholdtsen <pere@debian.org>
+Build-Depends: debhelper (>= 7)
+Standards-Version: 3.9.1
+Homepage: http://www.nuug.no/
+
+Package: dvswitch-avahi
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends},
+ dvswitch
+Suggests: dvsource, dvsink
+Description: DVSwitch wrappers to find sinks and sources dynamically
+ Use Avahi to find dvswitch sources and sinks.
diff --git a/dvswitch-avahi/debian/copyright b/dvswitch-avahi/debian/copyright
new file mode 100644
index 0000000..249a8d0
--- /dev/null
+++ b/dvswitch-avahi/debian/copyright
@@ -0,0 +1,8 @@
+The Debian packaging was written by Petter Reinholdtsen.
+
+The source was downloaded from the NUUG subversion repository
+svn+ssh://nerdhaven.nuug.no/data/video/svnroot
+
+Copyright:
+
+GNU General Public License v2 or later.
diff --git a/dvswitch-avahi/debian/rules b/dvswitch-avahi/debian/rules
new file mode 100755
index 0000000..d0feffa
--- /dev/null
+++ b/dvswitch-avahi/debian/rules
@@ -0,0 +1,53 @@
+#!/usr/bin/make -f
+
+export LC_ALL=C
+
+package=dvswitch-avahi
+
+debdir=$(shell pwd)/debian
+DESTDIR=${debdir}/$(package)
+
+build: build-stamp
+build-stamp:
+ dh_testdir
+ make
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+ make clean
+ dh_clean
+
+binary-indep: build
+# There are no architecture-independent files to be uploaded
+# generated by this package. If there were any they would be
+# made here.
+
+binary-arch: build
+ dh_testdir
+ dh_testroot
+ dh_clean
+ dh_installdirs
+
+ make install DESTDIR=${DESTDIR}
+ mkdir -p $(DESTDIR)/etc/apache/conf.d
+ dh_install --sourcedir=${DESTDIR}
+
+ dh_installdocs
+ dh_installchangelogs
+
+ dh_perl
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Below here is fairly generic really
+binary: binary-indep binary-arch
+.PHONY: binary binary-arch binary-indep clean
diff --git a/dvswitch-avahi/dvsink-files-avahi b/dvswitch-avahi/dvsink-files-avahi
new file mode 100755
index 0000000..dd8ec54
--- /dev/null
+++ b/dvswitch-avahi/dvsink-files-avahi
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+cmd=$(basename $0)
+cmd=${cmd%-avahi}
+
+if [ -z "$cmd" ] ; then
+ echo error: Unable to determine command name
+ exit 1
+fi
+
+# Dropping lines with : to avoid IPv6 addresses. dvswitch do not
+# handle link local IPv6 addresses passed on from avahi.
+args=$(avahi-browse -tr -v _dvswitch._tcp 2>&1 | grep -v : | \
+ awk '/address = /{host = $3} /port = /{port = $3} END { if (host) { print "-h", host, "-p", port } }' | \
+ tr -d '[]')
+
+$cmd $args $@
diff --git a/dvswitch-avahi/dvswitch-avahi b/dvswitch-avahi/dvswitch-avahi
new file mode 100755
index 0000000..e823359
--- /dev/null
+++ b/dvswitch-avahi/dvswitch-avahi
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+port=12345
+
+avahi-publish-service -s 'DVSwitch mixer' _dvswitch._tcp $port &
+pid=$!
+
+sleep 2 # Need a moment to register the service
+
+# Dropping lines with : to avoid IPv6 addresses. dvswitch do not handle
+# link local IPv6 addresses passed on from avahi.
+host=$(avahi-browse -tr -v _dvswitch._tcp 2>&1 | grep -v : | \
+ awk '/address = / { host = $3 } END {print host }' | tr -d '[]')
+
+echo "Starting dvswitch on host '$host'."
+dvswitch -h $host -p $port $@
+
+kill $pid