From 9d277e0c1abfcd8aeb0331663abcacb11b2883fd Mon Sep 17 00:00:00 2001
From: Michael Hanson <mihanson@linhes.org>
Date: Sat, 14 Apr 2012 05:27:20 +0000
Subject: bluez: fixup audio streaming again v4.99

---
 abs/extra/bluez/PKGBUILD                         | 88 ++++++++++++++++++++++++
 abs/extra/bluez/__changelog                      | 19 +++++
 abs/extra/bluez/audio-streaming.patch            | 13 ++++
 abs/extra/bluez/bluez-4.98_audio-streaming.patch | 14 ----
 abs/extra/bluez/bluez.install                    |  4 +-
 5 files changed, 122 insertions(+), 16 deletions(-)
 create mode 100644 abs/extra/bluez/PKGBUILD
 create mode 100644 abs/extra/bluez/__changelog
 create mode 100644 abs/extra/bluez/audio-streaming.patch
 delete mode 100644 abs/extra/bluez/bluez-4.98_audio-streaming.patch

diff --git a/abs/extra/bluez/PKGBUILD b/abs/extra/bluez/PKGBUILD
new file mode 100644
index 0000000..e6837e9
--- /dev/null
+++ b/abs/extra/bluez/PKGBUILD
@@ -0,0 +1,88 @@
+# $Id$
+# Maintainer: Tom Gundersen <teg@jklm.no>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Geoffroy Carrier <geoffroy@archlinux.org>
+
+pkgname=bluez
+pkgver=4.99
+pkgrel=3
+pkgdesc="Libraries and tools for the Bluetooth protocol stack"
+url="http://www.bluez.org/"
+arch=('i686' 'x86_64')
+license=('GPL2')
+depends=('dbus-core' 'python2' 'udev')
+makedepends=('gstreamer0.10-base' 'libusb-compat' 'libsndfile')
+optdepends=("gstreamer0.10-base: bluetooth GStreamer support"
+            "alsa-lib: Audio bluetooth devices support"
+            "dbus-python: to run bluez-simple-agent"
+            "pygobject: to run bluez-simple-agent"
+            "libusb-compat: USB adapters support"
+            "cups: CUPS backend")
+conflicts=('bluez-libs' 'bluez-utils')
+provides=('bluez-libs' 'bluez-utils')
+replaces=('bluez-libs' 'bluez-utils')
+options=('!libtool')
+backup=(etc/bluetooth/{main,rfcomm,audio,network,input,serial}.conf
+        'etc/conf.d/bluetooth' 'etc/dbus-1/system.d/bluetooth.conf')
+install='bluez.install'
+source=("http://www.kernel.org/pub/linux/bluetooth/${pkgname}-${pkgver}.tar.bz2"
+        'bluetooth.conf.d'
+        'audio-streaming.patch')
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+# Add setting that allows audio streaming out-of-the-box
+  patch -Np1 -i ${srcdir}/audio-streaming.patch || return 1
+
+  ./configure --prefix=/usr \
+    --sysconfdir=/etc \
+    --localstatedir=/var \
+    --libexecdir=/lib \
+    --enable-gstreamer \
+    --enable-alsa \
+    --enable-usb \
+    --enable-tools \
+    --enable-bccmd \
+    --enable-dfutool \
+    --enable-hid2hci \
+    --enable-hidd \
+    --enable-pand \
+    --enable-dund \
+    --disable-cups \
+    --enable-wiimote \
+    --disable-test
+  make
+}
+
+package() {
+  cd ${srcdir}/${pkgname}-${pkgver}
+  make DESTDIR=${pkgdir} install
+
+#  install -Dm755 ${srcdir}/rc.bluetooth ${pkgdir}/etc/rc.d/bluetooth
+  
+  install -d ${pkgdir}/etc/bluetooth
+  install -m644 network/network.conf \
+                input/input.conf \
+                audio/audio.conf \
+                serial/serial.conf \
+    ${pkgdir}/etc/bluetooth/
+  
+  install -Dm644 ${srcdir}/bluetooth.conf.d \
+    ${pkgdir}/etc/conf.d/bluetooth
+
+  # FS#27630
+  install -Dm755 test/simple-agent "${pkgdir}"/usr/bin/bluez-simple-agent
+  install -Dm755 test/test-device "${pkgdir}"/usr/bin/bluez-test-device
+  install -Dm755 test/test-input "${pkgdir}"/usr/bin/bluez-test-input
+  sed -i 's#/usr/bin/python#/usr/bin/python2#' \
+    "${pkgdir}"/usr/bin/bluez-simple-agent \
+    "${pkgdir}"/usr/bin/bluez-test-device \
+    "${pkgdir}"/usr/bin/bluez-test-input
+
+  # http://mailman.archlinux.org/pipermail/arch-general/2011-April/019787.html
+#  rm "${pkgdir}"/usr/lib/udev/rules.d/97-bluetooth.rules
+}
+md5sums=('2387053eb5a7b02f37df4871df022a02'
+         '7412982b440f29fa7f76a41a87fef985'
+         'cc9c86af1ced7ad46fc7be114d32adfb')
diff --git a/abs/extra/bluez/__changelog b/abs/extra/bluez/__changelog
new file mode 100644
index 0000000..62a2048
--- /dev/null
+++ b/abs/extra/bluez/__changelog
@@ -0,0 +1,19 @@
+# by mihanson
+I really have no idea how this bluetooth stuff works.  If anyone wants to
+take a stab at getting this working properly with runit, feel free.  I
+only need this package to get mythpywii working.
+
+2010-04-01:
+Make this package work with runit.  All daemons were seperated into their
+own run scripts.  Of particular interest is rfcomm and hid2hci utilities.
+They are not daemons and I added "/sbin/sv <executable> down ." in their
+respective run files.  All based on this thread:
+http://article.gmane.org/gmane.comp.sysutils.supervision.general/1585/
+
+2012-04-07
+- remove rc.bluetooth as we use runit
+- disable-cups
+- comment out removal of udev line
+
+2012-04-13
+re-add audio-streaming.patch for ootb audio streaming
diff --git a/abs/extra/bluez/audio-streaming.patch b/abs/extra/bluez/audio-streaming.patch
new file mode 100644
index 0000000..83705c5
--- /dev/null
+++ b/abs/extra/bluez/audio-streaming.patch
@@ -0,0 +1,13 @@
+--- bluez-4.98/audio/audio.conf.orig	2012-02-27 23:52:30.960349047 +0000
++++ bluez-4.98/audio/audio.conf	2012-02-27 23:54:19.768069787 +0000
+@@ -4,6 +4,11 @@
+ # particular interface
+ [General]
+ 
++# Allow audio streaming with bluez-4.98 and alsa-lib 1.0.24.1
++# https://wiki.archlinux.org/index.php/Bluetooth#Audio_streaming
++
++Enable=Socket
++
+ # Switch to master role for incoming connections (defaults to true)
+ #Master=true
diff --git a/abs/extra/bluez/bluez-4.98_audio-streaming.patch b/abs/extra/bluez/bluez-4.98_audio-streaming.patch
deleted file mode 100644
index 085d8ca..0000000
--- a/abs/extra/bluez/bluez-4.98_audio-streaming.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- bluez-4.98/audio/audio.conf.orig	2012-02-27 23:52:30.960349047 +0000
-+++ bluez-4.98/audio/audio.conf	2012-02-27 23:54:19.768069787 +0000
-@@ -4,6 +4,11 @@
- # particular interface
- [General]
- 
-+# Allow audio streaming with bluez-4.98 and alsa-lib 1.0.24.1
-+# https://wiki.archlinux.org/index.php/Bluetooth#Audio_streaming
-+
-+Enable=Socket
-+
- # Switch to master role for incoming connections (defaults to true)
- #Master=true
- 
diff --git a/abs/extra/bluez/bluez.install b/abs/extra/bluez/bluez.install
index f9b757b..30bd262 100644
--- a/abs/extra/bluez/bluez.install
+++ b/abs/extra/bluez/bluez.install
@@ -2,12 +2,12 @@ post_install() {
     add_service.sh bluetoothd
     echo ">>> Only the bluetoothd daemon is started by default."
     echo ">>> You can optionally add the following as required:"
-    echo ">>> hidd dund pand rfcomm"
+    echo ">>> hidd dund pand sdpd rfcomm hid2hci"
     echo ">>> $ sudo add_service.sh <service_name>"
 }
 
 pre_remove() {
-    for d in { bluetoothd,hidd,dund,pand,rfcomm } ; do
+    for d in { bluetoothd,hidd,dund,pand,sdpd,rfcomm,hid2hci } ; do
       if [ -d /var/service/${d} ] ; then
         remove_servcie.sh $d
       fi
-- 
cgit v0.12