--- bluez-4.12.orig/debian/bluez-gstreamer.install
+++ bluez-4.12/debian/bluez-gstreamer.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib/gstreamer-*/*.so
+
--- bluez-4.12.orig/debian/bluez-pcmcia-support.postinst
+++ bluez-4.12/debian/bluez-pcmcia-support.postinst
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+#set -e
+#case "$1" in
+#    configure)
+#    	chmod a+x /etc/pcmcia/bluetooth
+#	;;
+#
+#    *)
+#        exit 0
+#    ;;
+#esac
+
+# temporary fix for #359614
+#case "$1" in
+    #configure)
+        #if [ ! -z "$2" ] && dpkg --compare-versions "$2" le 3.1-2; then
+           #ln -s ../bluez-pcmcia-support.rules /etc/udev/rules.d/z60_bluez-pcmcia-support.rules
+        #fi
+    #;;
+#esac
+
+#DEBHELPER#
--- bluez-4.12.orig/debian/libbluetooth-dev.install
+++ bluez-4.12/debian/libbluetooth-dev.install
@@ -0,0 +1,5 @@
+debian/tmp/usr/include/*
+debian/tmp/usr/lib/lib*.so
+debian/tmp/usr/lib/*.la
+debian/tmp/usr/lib/pkgconfig/*
+debian/tmp/usr/lib/bluetooth/plugins/*.la
--- bluez-4.12.orig/debian/bluez-cups.README.Debian
+++ bluez-4.12/debian/bluez-cups.README.Debian
@@ -0,0 +1,11 @@
+bluez-cups
+
+To configure a Bluetooth printer, set it up in CUPS like it was connected to
+your parallel or USB port. Then edit your /etc/cups/printers.conf and replace
+the device URI with a bluetooth one.
+
+The printer's URI will look something like this: bluetooth://00408C5E5DA4/spp
+If your printer uses HCRP (hardcopy cable replacement protocol) then remove
+the "/spp" from the end.  SPP is serial port protocol.
+
+ -- Edd Dumbill <ejad@debian.org>, Fri Jul 16 19:25:21 BST 2004
--- bluez-4.12.orig/debian/bluez-cups.install
+++ bluez-4.12/debian/bluez-cups.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/cups/backend/*
--- bluez-4.12.orig/debian/libbluetooth3.shlibs
+++ bluez-4.12/debian/libbluetooth3.shlibs
@@ -0,0 +1 @@
+libbluetooth 3 libbluetooth3 (>= 4.9)
--- bluez-4.12.orig/debian/bluez.postinst
+++ bluez-4.12/debian/bluez.postinst
@@ -0,0 +1,42 @@
+#!/bin/sh
+# snippet from http://www.dpkg.org/dpkg/ConffileHandling
+
+# Move a conffile without triggering a dpkg question
+mv_conffile() {
+    OLDCONFFILE="$1"
+    NEWCONFFILE="$2"
+
+    if [ -e "$OLDCONFFILE" ]; then
+        echo "Preserving user changes to $NEWCONFFILE ..."
+        mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
+        mv -f "$OLDCONFFILE" "$NEWCONFFILE"
+    fi
+}
+
+set -e
+case "$1" in
+    configure)
+        if [ -e /etc/init.d/bluez-utils ]; then
+            /usr/sbin/update-rc.d -f bluez-utils remove
+            # maybe a (medium/low debconf?) notice is best suited here
+        fi
+
+        # use MAKEDEV instead of the original bluez script below as per policy 10.6
+        if [ -x /dev/MAKEDEV ]; then
+            echo "Creating device nodes ..."
+            cd /dev && ./MAKEDEV bluetooth
+        fi
+        # reload dbus config file
+        if [ -x /etc/init.d/dbus ]; then
+            invoke-rc.d dbus force-reload || true
+        fi
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
+
+#DEBHELPER#
--- bluez-4.12.orig/debian/watch
+++ bluez-4.12/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://www.kernel.org/pub/linux/bluetooth/ .*bluez-(.+)\.tar\.gz
--- bluez-4.12.orig/debian/bluez.install
+++ bluez-4.12/debian/bluez.install
@@ -0,0 +1,8 @@
+debian/tmp/etc/bluetooth/main.conf
+debian/tmp/etc/bluetooth/rfcomm.conf
+debian/tmp/etc/dbus*/*
+debian/tmp/usr/bin/*
+debian/tmp/usr/sbin/*
+debian/tmp/usr/share/man/man1/*
+debian/tmp/usr/share/man/man8/*
+debian/tmp/usr/lib/bluetooth/plugins/*.so
--- bluez-4.12.orig/debian/bluez.docs
+++ bluez-4.12/debian/bluez.docs
@@ -0,0 +1 @@
+*/*-api.txt
--- bluez-4.12.orig/debian/bluez-utils.postrm
+++ bluez-4.12/debian/bluez-utils.postrm
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+#Dummy transitional postrm script
+#Don't do anything.
--- bluez-4.12.orig/debian/libbluetooth3.install
+++ bluez-4.12/debian/libbluetooth3.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/lib*.so.*
--- bluez-4.12.orig/debian/bluez-pcmcia-support.install
+++ bluez-4.12/debian/bluez-pcmcia-support.install
@@ -0,0 +1 @@
+scripts/bluetooth_serial /lib/udev
--- bluez-4.12.orig/debian/bluez.dirs
+++ bluez-4.12/debian/bluez.dirs
@@ -0,0 +1 @@
+usr/bin
--- bluez-4.12.orig/debian/bluez.override
+++ bluez-4.12/debian/bluez.override
@@ -0,0 +1,2 @@
+# code for moving conffiles
+bluez-utils binary: maintainer-script-uses-dpkg-status-directly preinst
--- bluez-4.12.orig/debian/copyright
+++ bluez-4.12/debian/copyright
@@ -0,0 +1,37 @@
+This package was debianized by Mario Limonciello <mario_limonciellO@dell.com> based on the 
+packaging for bluez-utils by Edd Dumbill <edd@usefulinc.com> on
+Fri, 26 Sep 2008 13:41:32 -0500
+
+It was downloaded from http://bluez.org/
+
+Upstream Author:     Maksim Krasnyanskiy <maxk@qualcomm.com>
+
+Copyright:
+
+   BlueZ - Bluetooth protocol stack for Linux
+
+   Copyright (C) 2000-2001  Qualcomm Incorporated
+   Copyright (C) 2002-2003  Maxim Krasnyansky <maxk@qualcomm.com>
+   Copyright (C) 2002-2007  Marcel Holtmann <marcel@holtmann.org>
+
+   Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
+
+   This package is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 dated June, 1991.
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM,
+OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
+USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS,
+TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED.
+
--- bluez-4.12.orig/debian/bluez-alsa.preinst
+++ bluez-4.12/debian/bluez-alsa.preinst
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# snippet from http://wiki.debian.org/DpkgConffileHandling
+
+# Remove a no-longer used conffile
+rm_conffile() {
+    PKGNAME="$1"
+    CONFFILE="$2"
+    if [ -e "$CONFFILE" ]; then
+        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+        old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
+        if [ "$md5sum" != "$old_md5sum" ]; then
+            echo "Obsolete conffile $CONFFILE has been modified by you."
+            echo "Saving as $CONFFILE.dpkg-bak ..."
+            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
+        else
+            echo "Removing obsolete conffile $CONFFILE ..."
+            rm -f "$CONFFILE"
+        fi
+    fi
+}
+
+case "$1" in
+install|upgrade)
+    if dpkg --compare-versions "$2" le "3.24-1+b1"; then
+        rm_conffile bluez-audio "/etc/bluetooth/audio.service"
+    fi
+esac
+
+#DEBHELPER#
--- bluez-4.12.orig/debian/compat
+++ bluez-4.12/debian/compat
@@ -0,0 +1 @@
+7
--- bluez-4.12.orig/debian/control
+++ bluez-4.12/debian/control
@@ -0,0 +1,118 @@
+Source: bluez
+Section: admin
+Priority: optional
+Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+Build-Depends: debhelper (>= 7),
+               autotools-dev,
+               cdbs,
+               flex,
+               bison,
+               gstreamer-tools,
+               libasound2-dev,
+               libdbus-1-dev,
+               libdbus-glib-1-dev,
+               libglib2.0-dev,
+               libgstreamer0.10-dev,
+               libgstreamer-plugins-base0.10-dev,
+               libnl-dev,
+               libsndfile1-dev,
+               libusb-dev,
+Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-dev/utils/ubuntu-bluez-4.x
+Vcs-Browser: http://code.launchpad.net/~ubuntu-dev/utils/ubuntu-bluez-4.x
+Homepage: http://www.bluez.org
+Standards-Version: 3.8.0
+
+Package: bluetooth
+Architecture: all
+Depends: bluez
+Recommends: bluez-alsa,
+            bluez-cups,
+            bluez-gstreamer,
+Description: Blueooth support
+ This package provides all of the different plugins supported
+ by the Bluez bluetooth stack.
+
+Package: bluez
+Architecture: any
+Depends: ${shlibs:Depends}, module-init-tools, makedev | udev, lsb-base, dbus
+Conflicts: bluez-input, bluez-network, bluez-audio, bluez-serial, bluez-utils (<=4.9)
+Replaces: bluez-input, bluez-network, bluez-audio, bluez-serial, bluez-utils (<=4.9)
+Description: Bluetooth tools and daemons
+ This package contains tools and system daemons for using Bluetooth devices.
+ .
+ BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
+ project distributed under GNU General Public License (GPL).
+
+Package: bluez-alsa
+Conflicts: bluez-audio
+Replaces: bluez-audio
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Bluetooth audio support
+ This package contains a driver operate with the ALSA stack.
+ .
+ BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
+ project distributed under GNU General Public License (GPL).
+
+Package: bluez-cups
+Architecture: any
+Depends: ${shlibs:Depends}, cups
+Description: Bluetooth printer driver for CUPS
+ This package contains a driver to let CUPS print to Bluetooth-connected
+ printers.
+ .
+ BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
+ project distributed under GNU General Public License (GPL).
+
+Package: bluez-gstreamer
+Architecture: any
+Depends: ${shlibs:Depends}
+Conflicts: bluez-audio
+Replaces: bluez-audio
+Description: Bluetooth gstreamer support
+ This package contains a plugin to operate with with gstreamer applications.
+ .
+ BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
+ project distributed under GNU General Public License (GPL).
+
+Package: bluez-pcmcia-support
+Architecture: any
+Priority: extra
+Depends: pcmciautils
+Recommends: setserial
+Description: PCMCIA support files for BlueZ 2.0 Bluetooth tools
+ This package contains files to enable PCMCIA card services to recognise
+ and initialise PCMCIA Bluetooth devices.
+ .
+ BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
+ project distributed under GNU General Public License (GPL).
+
+Package: libbluetooth-dev
+Section: libdevel
+Provides: libbluetooth3-dev
+Conflicts: libbluetooth-dev, libsdp2-dev (<= 1.5.2), bluez-pan
+Replaces: libsdp2-dev (<= 1.5.2)
+Depends: libbluetooth3 (= ${binary:Version}), libc6-dev | libc-dev
+Suggests: pkg-config
+Priority: extra
+Architecture: any
+Description: Development files for using the BlueZ Linux Bluetooth library
+ BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
+ project distributed under GNU General Public License (GPL).
+
+Package: libbluetooth3
+Section: libs
+Conflicts: libsdp2 (<= 1.5-2)
+Replaces: libsdp2 (<= 1.5-2)
+Depends: ${shlibs:Depends}
+Architecture: any
+Description: Library to use the BlueZ Linux Bluetooth stack
+ BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
+ project distributed under GNU General Public License (GPL).
+
+Package: bluez-utils
+Depends: bluetooth
+Architecture: all
+Description: Transitional package
+ This is a transitional package to assist with moving people to the
+ BlueZ 4.x stack.
--- bluez-4.12.orig/debian/bluez.bluetooth.init
+++ bluez-4.12/debian/bluez.bluetooth.init
@@ -0,0 +1,201 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: bluetooth
+# Required-Start:    $local_fs $syslog $remote_fs dbus
+# Required-Stop:     $local_fs $syslog $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start bluetooth daemons
+### END INIT INFO
+#
+# bluez    Bluetooth subsystem starting and stopping
+#
+# originally from bluez's scripts/bluetooth.init
+#
+# Edd Dumbill <ejad@debian.org>
+# LSB 3.0 compilance and enhancements by Filippo Giunchedi <filippo@debian.org>
+#
+# Updated for bluez 4.7 by Mario Limonciello <mario_limonciello@dell.com>
+#
+# startup control over dund and pand can be changed by editing
+# /etc/default/bluetooth
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC=bluetooth
+
+DAEMON=/usr/sbin/bluetoothd
+HCIATTACH=/usr/sbin/hciattach
+
+HID2HCI=/usr/sbin/hid2hci
+HID2HCI_ENABLED=1
+HID2HCI_UNDO=1
+
+UART_CONF=/etc/bluetooth/uart
+
+RFCOMM=/usr/bin/rfcomm
+RFCOMM_NAME=rfcomm
+RFCOMM_CONF=/etc/bluetooth/rfcomm.conf
+SDPTOOL=/usr/bin/sdptool
+
+test -f /etc/default/bluetooth && . /etc/default/bluetooth
+test -f /etc/default/rcS && . /etc/default/rcS
+
+. /lib/lsb/init-functions
+
+set -e
+
+run_sdptool()
+{
+	test -x $SDPTOOL || return 1
+
+	if ! test -z "$SDPTOOL_OPTIONS" ; then
+		oldifs="$IFS"
+		IFS=";"
+		for o in $SDPTOOL_OPTIONS ; do
+			#echo "execing $SDPTOOL $o"
+			IFS=" "
+			if [ "$VERBOSE" != "no" ]; then
+				$SDPTOOL $o
+			else
+				$SDPTOOL $o >/dev/null 2>&1
+			fi
+		done
+		IFS="$oldifs"
+	fi
+
+}
+
+enable_hci_input()
+{
+       if [ "$VERBOSE" != no ]; then
+               log_progress_msg "hid_devices"
+               $HID2HCI --tohci
+       else
+               $HID2HCI --tohci >/dev/null 2>&1
+       fi
+}
+
+disable_hci_input()
+{
+       if [ "$VERBOSE" != no ]; then
+               log_progress_msg "hid_devices"
+               $HID2HCI --tohid
+       else
+               $HID2HCI --tohid >/dev/null 2>&1
+       fi
+}
+
+start_uarts()
+{
+	[ -f $HCIATTACH ] && [ -f $UART_CONF ] || return
+	grep -v '^#' $UART_CONF | while read i; do
+               if [ "$VERBOSE" != no ]; then
+                       $HCIATTACH $i
+               else
+                       $HCIATTACH $i >/dev/null 2>&1
+               fi
+	done
+}
+
+stop_uarts()
+{
+	killall hciattach > /dev/null 2>&1 || true
+}
+
+start_rfcomm()
+{
+	if [ -x $RFCOMM ] && [ -f $RFCOMM_CONF ] ; then
+		# rfcomm must always succeed for now: users
+		# may not yet have an rfcomm-enabled kernel
+                if [ "$VERBOSE" != no ]; then
+                       log_progress_msg "rfcomm"
+                       $RFCOMM -f $RFCOMM_CONF bind all || true
+                else
+                       $RFCOMM -f $RFCOMM_CONF bind all >/dev/null 2>&1 || true
+                fi
+	fi
+}
+
+stop_rfcomm()
+{
+	if [ -x $RFCOMM ] ; then
+               if [ "$VERBOSE" != no ]; then
+                       log_progress_msg "rfcomm"
+                       $RFCOMM unbind all || true
+               else
+                       $RFCOMM unbind all >/dev/null 2>&1 || true
+               fi
+	fi
+}
+
+restart_rfcomm()
+{
+	if [ -x $RFCOMM ] && [ -f $RFCOMM_CONF ] ; then
+               if [ "$VERBOSE" != no ]; then
+                       log_progress_msg  "rfcomm"
+                       $RFCOMM unbind all || true
+                       $RFCOMM -f $RFCOMM_CONF bind all || true
+               else
+                       $RFCOMM unbind all >/dev/null 2>&1|| true
+                       $RFCOMM -f $RFCOMM_CONF bind all >/dev/null 2>&1 || true
+               fi
+	fi
+}
+
+case "$1" in
+  start)
+	log_daemon_msg "Starting $DESC"
+
+	if test "$BLUETOOTH_ENABLED" = "0"; then
+		log_progress_msg "disabled. see /etc/default/bluetooth"
+		log_end_msg 0
+		exit 0
+	fi
+
+	start-stop-daemon --start --quiet --exec $DAEMON || true
+	log_progress_msg "bluetoothd"
+
+	run_sdptool || true
+
+	start_uarts || true
+
+	if test "$HID2HCI_ENABLED" = "1"; then
+		enable_hci_input || true
+	fi
+	start_rfcomm || true
+	log_end_msg 0
+    ;;
+  stop)
+	log_daemon_msg "Stopping $DESC"
+	if test "$BLUETOOTH_ENABLED" = "0"; then
+		log_progress_msg "disabled."
+		log_end_msg 0
+		exit 0
+	fi
+	stop_rfcomm || true
+	if test "$HID2HCI_UNDO" = "1"; then
+		disable_hci_input || true
+	fi
+	start-stop-daemon --stop --quiet --exec $DAEMON || true
+	log_progress_msg "bluetoothd"
+	stop_uarts || true
+	log_end_msg 0
+	;;
+  restart|force-reload)
+	$0 stop
+	$0 start
+	;;
+  status)
+	status_of_proc "$DAEMON" "$DESC" && exit 0 || exit $?
+	;;
+  *)
+	N=/etc/init.d/bluetooth
+	# echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
+	echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
+
+# vim:noet
--- bluez-4.12.orig/debian/rules
+++ bluez-4.12/debian/rules
@@ -0,0 +1,45 @@
+#!/usr/bin/make -f
+# build rules for bluez-utils
+
+include /usr/share/cdbs/1/rules/buildcore.mk
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/cdbs/1/class/autotools.mk
+
+DEB_UPDATE_RCD_PARAMS = "start 25 2 3 4 5 . stop 74 0 1 6 ."
+DEB_DH_INSTALLINIT_ARGS = "--name=bluetooth"
+DEB_CONFIGURE_EXTRA_FLAGS := --enable-gstreamer \
+                             --enable-alsa \
+                             --enable-usb \
+                             --enable-hal \
+                             --enable-netlink \
+                             --enable-tools \
+                             --enable-bccmd \
+                             --enable-hid2hci \
+                             --enable-dfutool \
+                             --enable-cups \
+                             --enable-manpages \
+                             --enable-pcmciarules \
+                             --enable-debug
+
+DEB_DESTDIR := $(CURDIR)/debian/tmp
+
+install/bluez::
+	install -D -m 0644 $(CURDIR)/input/input.conf $(CURDIR)/debian/bluez/etc/bluetooth/input.conf
+	install -D -m 0644 $(CURDIR)/audio/audio.conf $(CURDIR)/debian/bluez/etc/bluetooth/audio.conf
+	install -D -m 0644 $(CURDIR)/network/network.conf $(CURDIR)/debian/bluez/etc/bluetooth/network.conf
+
+install/bluez-alsa::
+	install -D -m 0644 $(CURDIR)/audio/asound.conf $(CURDIR)/debian/bluez-alsa/usr/share/alsa/bluetooth.conf
+
+binary-install/bluez-gstreamer::
+	dh_gstscancodecs -pbluez-gstreamer
+
+install/bluez-pcmcia-support::
+	cp -f $(CURDIR)/scripts/bluetooth.rules $(CURDIR)/debian/bluez-pcmcia-support.udev
+
+binary-install/bluez-pcmcia-support::
+	chmod a+x $(CURDIR)/debian/bluez-pcmcia-support/lib/udev/bluetooth_serial
+
+clean::
+	-rm -f $(CURDIR)/debian/bluez-pcmcia-support.udev
--- bluez-4.12.orig/debian/bluez.preinst
+++ bluez-4.12/debian/bluez.preinst
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# snippet from http://www.dpkg.org/dpkg/ConffileHandling
+
+# Prepare to move a conffile without triggering a dpkg question
+prep_mv_conffile() {
+    CONFFILE="$1"
+
+    if [ -e "$CONFFILE" ]; then
+        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+        old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
+        if [ "$md5sum" = "$old_md5sum" ]; then
+            rm -f "$CONFFILE"
+        fi
+    fi
+}
+
+# Remove a no-longer used conffile
+rm_conffile() {
+    PKGNAME="$1"
+    CONFFILE="$2"
+    if [ -e "$CONFFILE" ]; then
+        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+        old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
+        if [ "$md5sum" != "$old_md5sum" ]; then
+            echo "Obsolete conffile $CONFFILE has been modified by you."
+            echo "Saving as $CONFFILE.dpkg-bak ..."
+            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
+        else
+            echo "Removing obsolete conffile $CONFFILE ..."
+            rm -f "$CONFFILE"
+        fi
+    fi
+}
+
+case "$1" in
+install|upgrade)
+    #if dpkg --compare-versions "$2" le "2.19-1"; then
+    #   prep_mv_conffile "/etc/init.d/bluez-utils"
+    #   prep_mv_conffile "/etc/default/bluez-utils"
+    #fi
+
+    if dpkg --compare-versions "$2" le "3.7-1"; then
+        prep_mv_conffile "/etc/dbus-1/system.d/bluez-hcid.conf"
+    fi
+
+    if dpkg --compare-versions "$2" le "3.30-1"; then
+        rm_conffile bluez-utils "/etc/bluetooth/network.service"
+        rm_conffile bluez-utils "/etc/bluetooth/serial.service"
+        rm_conffile bluez-utils "/etc/bluetooth/input.service"
+    fi
+esac
+
+#DEBHELPER#
--- bluez-4.12.orig/debian/bluez-alsa.install
+++ bluez-4.12/debian/bluez-alsa.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/alsa-lib/*.so
--- bluez-4.12.orig/debian/changelog
+++ bluez-4.12/debian/changelog
@@ -0,0 +1,19 @@
+bluez (4.12-0ubuntu1) intrepid; urgency=low
+
+  * Initial Release. (LP: #274950)
+    - This package replaces bluez-utils and bluez-libs source packages.
+    - It was generated by merging the contents of bluez-utils and bluez-libs
+      and updating content.
+    - Legacy functionality for hidd, dund, and pand are not present, and 
+      have been removed from all configuration files.
+  * This release introduces encryption (LP: #182191)
+  * debian/patches:
+    - bluez-utils-oui-usage.patch was borrowed from the Fedora 10 packaging.
+    - sco-connect-git.patch was taken from bluez git shortly after 4.12 release.
+      It should "help" with some sco headset issues.
+  * debian/control:
+    - Update different packages per upstream's recommendations.
+    - Update conflicts/replaces for earlier packages.
+    - Add a transitional bluez-utils package to help with the transition.
+
+ -- Mario Limonciello <superm1@ubuntu.com>  Tue, 07 Oct 2008 12:10:29 -0500
--- bluez-4.12.orig/debian/bluez.bluetooth.default
+++ bluez-4.12/debian/bluez.bluetooth.default
@@ -0,0 +1,13 @@
+# Defaults for bluez
+
+# start bluetooth on boot?
+# compatibility note: If this variable is not found bluetooth will
+# start
+BLUETOOTH_ENABLED=1
+
+# This setting will switch HID devices (e.g mouse/keyboad) to HCI mode, that is
+# you will have bluetooth functionality from your dongle instead of only HID.
+# Note that not every bluetooth dongle is capable of switching back to HID
+# mode, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355497
+HID2HCI_ENABLED=1
+HID2HCI_UNDO=1
--- bluez-4.12.orig/debian/patches/sco_connect_git.patch
+++ bluez-4.12/debian/patches/sco_connect_git.patch
@@ -0,0 +1,21 @@
+diff -Nur -x '*.orig' -x '*~' bluez-4.12/common/glib-helper.c bluez-4.12.new/common/glib-helper.c
+--- bluez-4.12/common/glib-helper.c	2008-10-06 11:24:34.000000000 -0500
++++ bluez-4.12.new/common/glib-helper.c	2008-10-07 12:12:44.000000000 -0500
+@@ -775,7 +775,7 @@
+ {
+ 	struct io_context *io_ctxt = io->io_ctxt;
+ 	struct sockaddr_sco addr;
+-	int sk, err;
++	int err;
+ 
+ 	io_ctxt->func = func;
+ 
+@@ -790,7 +790,7 @@
+ 	err = transport_connect(io, (struct sockaddr *) &addr,
+ 				sizeof(addr));
+ 	if (err < 0) {
+-		close(sk);
++		close(io_ctxt->fd);
+ 		return BT_IO_FAILED;
+ 	}
+ 
--- bluez-4.12.orig/debian/patches/bluez-utils-oui-usage.patch
+++ bluez-4.12/debian/patches/bluez-utils-oui-usage.patch
@@ -0,0 +1,33 @@
+Index: common/oui.c
+===================================================================
+RCS file: /cvsroot/bluez/utils/common/oui.c,v
+retrieving revision 1.2
+diff -u -p -r1.2 oui.c
+--- common/oui.c	13 Jan 2007 17:48:12 -0000	1.2
++++ common/oui.c	25 Jan 2008 12:16:58 -0000
+@@ -38,7 +38,7 @@
+ 
+ /* http://standards.ieee.org/regauth/oui/oui.txt */
+ 
+-#define OUIFILE "/var/lib/misc/oui.txt"
++#define OUIFILE "/usr/share/hwdata/oui.txt"
+ 
+ char *ouitocomp(const char *oui)
+ {
+@@ -46,14 +46,9 @@ char *ouitocomp(const char *oui)
+ 	char *str, *map, *off, *end;
+ 	int fd;
+ 
+-	fd = open("oui.txt", O_RDONLY);
++	fd = open(OUIFILE, O_RDONLY);
+ 	if (fd < 0) {
+-		fd = open(OUIFILE, O_RDONLY);
+-		if (fd < 0) {
+-			fd = open("/usr/share/misc/oui.txt", O_RDONLY);
+-			if (fd < 0)
+-				return NULL;
+-		}
++		return NULL;
+ 	}
+ 
+ 	if (fstat(fd, &st) < 0) {