--- bluez-4.66.orig/debian/bluez.examples
+++ bluez-4.66/debian/bluez.examples
@@ -0,0 +1,12 @@
+test/simple-agent
+test/simple-service
+test/list-devices
+test/monitor-bluetooth
+test/test-telephony
+test/test-manager
+test/test-serial
+test/test-discovery
+test/test-device
+test/test-service
+test/test-adapter
+test/test-network
--- bluez-4.66.orig/debian/watch
+++ bluez-4.66/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://www.kernel.org/pub/linux/bluetooth/ .*bluez-([.\d]+)\.tar\.gz
--- bluez-4.66.orig/debian/bluez-pcmcia-support.install
+++ bluez-4.66/debian/bluez-pcmcia-support.install
@@ -0,0 +1 @@
+scripts/bluetooth_serial /lib/udev
--- bluez-4.66.orig/debian/bluez_agent.udev
+++ bluez-4.66/debian/bluez_agent.udev
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+# /usr is not guaranteed to be mounted when udev starts
+
+(
+ . /lib/udev/hotplug.functions
+ wait_for_file /usr/sbin/hid2hci
+ exec /usr/sbin/hid2hci "$@"
+) &
--- bluez-4.66.orig/debian/bluez-cups.README.Debian
+++ bluez-4.66/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.66.orig/debian/copyright
+++ bluez-4.66/debian/copyright
@@ -0,0 +1,112 @@
+This package was debianized by Edd Dumbill <edd@usefulinc.com> on
+Sat, 13 Apr 2002 16:09:02 +0100.
+
+It was downloaded from http://www.bluez.org/
+
+BlueZ - Bluetooth protocol stack for Linux
+
+Copyright:
+ Copyright (C) 2001-2009 Marcel Holtmann <marcel@holtmann.org>
+ Copyright (C) 2006-2009 Nokia Corporation
+ Copyright (C) 2000-2003 Maxim Krasnyansky <maxk@qualcomm.com>
+ Copyright (C) 2002-2003 Jean Tourrilhes <jt@hpl.hp.com>
+ Copyright (C) 2007-2008 Frederic Dalleau <fdalleau@free.fr>
+ Copyright (C) 2007-2008 Texas Instruments, Inc.
+ Copyright (C) 2000-2005 CSR Ltd.
+ Copyright (C) 2005-2008 Brad Midgley <bmidgley@xmission.com>
+ Copyright (C) 2007-2008 David Stockwell <dstockwell@frequency-one.com>
+ Copyright (C) 2007-2008 Fabien Chevalier <fabchevalier@free.fr>
+ Copyright (C) 2005-2006 Claudio Takahasi <claudio.takahasi@indt.org.br>
+ Copyright (C) 2006-2007 Luiz von Dentz <luiz.dentz@indt.org.br>
+ Copyright (C) 2005-2007 Johan Hedberg <johan.hedberg@nokia.com>
+ Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.com>
+ Copyright (C) 2004-2005 Henryk Ploetz <henryk@ploetzli.ch>
+ Copyright (C) 2002-2003 Stephen Crane <steve.crane@rococosoft.com>
+ Copyright (C) 2000-2001 Qualcomm Incorporated
+ Copyright (C) 2008 Joao Paulo Rechi Vita
+ Copyright (C) 2009 Lennart Poettering
+ Copyright (C) 2004 Scott James Remnant <scott@netsplit.com>
+ Copyright (C) 2009 Intel Corporation
+
+License:
+ audio/
+ a2dp.c a2dp.h avdtp.c avdtp.h control.c control.h device.c device.h
+ gateway.c gateway.h headset.c headset.h main.c manager.c manager.h
+ sink.c sink.h telephony-dummy.c telephony-maemo.c telephony.h
+ unix.c unix.h
+
+ License: GPL version 2 or any later version
+
+ gsta2dpsink.c gsta2dpsink.h gstavdtpsink.c
+ gstavdtpsink.h gstbluetooth.c gstrtpsbcpay.c gstrtpsbcpay.h
+ gstsbcdec.c gstsbcdec.h gstsbcenc.c gstsbcenc.h
+ gstsbcparse.c gstsbcparse.h gstsbcutil.c gstsbcutil.h
+ pcm_bluetooth.c gstbluetooth.c: ctl_bluetooth.c
+ ipc.c ipc.h rtp.h
+ ipctest.c
+
+ License: LGPL version 2.1 or any later version
+
+ sbc/
+ formats.h sbcdec.c sbcenc.c sbcinfo.c
+ sbctester.c
+
+ License: GPL version 2 or any later version
+
+ sbc.c sbc.h
+ sbc_math.h sbc_primitives.c sbc_primitives.h
+ sbc_primitives_mmx.c sbc_primitives_mmx.h sbc_primitives_neon.c
+ sbc_primitives_neon.h sbc_tables.h
+
+ License: LGPL version 2.1 or any later version
+
+ tools/
+ ubcsp.c ubcsp.h
+
+ License: MIT License
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ 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. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+ avctrl.c bccmd.c avinfo.c
+ ciptool.c csr.c csr.h csr_3wire.c csr_bcsp.c csr_h4.c
+ csr_hci.c csr_usb.c dfu.c dfu.h dfubabel.c dfutool.c
+ hciattach.h hciattach_st.c hciattach_tialt.c hid2hci.c ppporc.c
+ hciattach_ti.c
+ hciattach.c hciconfig.c hcitool.c l2ping.c
+ hcisecfilter.c sdptool.c
+
+ License: GPL version 2 or any later version
+
+ doc/
+ All files.
+
+ License: GFDL version 1.1 or any later version
+ No Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+
+ other:
+ License: GPL version 2 or any later version
+
+On Debian GNU/Linux systems, the complete text of the GNU General Public
+License can be found in `/usr/share/common-licenses/GPL', the GNU Lesser
+General Public License can be found in `/usr/share/common-licenses/LGPL' and
+the GNU Free Documentation License can be found in
+`/usr/share/common-licenses/GFDL'.
--- bluez-4.66.orig/debian/bluez-pcmcia-support.postinst
+++ bluez-4.66/debian/bluez-pcmcia-support.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+#DEBHELPER#
--- bluez-4.66.orig/debian/bluez-gstreamer.install
+++ bluez-4.66/debian/bluez-gstreamer.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib/gstreamer-*/*.so
+
--- bluez-4.66.orig/debian/libbluetooth3.install
+++ bluez-4.66/debian/libbluetooth3.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/lib*.so.*
--- bluez-4.66.orig/debian/bluez-alsa.preinst
+++ bluez-4.66/debian/bluez-alsa.preinst
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+
+# 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.66.orig/debian/NEWS
+++ bluez-4.66/debian/NEWS
@@ -0,0 +1,167 @@
+bluez-utils (4.40-1) unstable; urgency=low
+
+ This version includes a new hid2hci program which expects the vendor ID and
+ product ID of the device to be switched to HID/HCI mode, this means the
+ switching is no longer done in init script but via udev rules for supported
+ devices. Adding new devices can be done by dropping rules into
+ /etc/udev/rules.d/ similar to ones found in
+ /lib/udev/rules.d/62-bluez-hid2hci.rules or by manually running hid2hci, see
+ hid2hci(8) manpage for further information.
+
+ This version also ships a simple commandline agent (bluetooth-agent) to do
+ pairing on the command line
+
+ -- Filippo Giunchedi <filippo@debian.org> Fri, 22 May 2009 15:21:35 +0200
+
+bluez-utils (3.36-3) unstable; urgency=low
+
+ This version includes an new d-bus policy with updated access control.
+ As a result of this, only users of netdev group or which are in front of the
+ computer (i.e. match the at_console="true" rule) are able to communicate
+ with hcid via dbus. See also #510644.
+
+ -- Filippo Giunchedi <filippo@debian.org> Thu, 08 Jan 2009 18:35:38 +0100
+
+bluez-utils (3.30-2) unstable; urgency=low
+
+ This upstream version switches the service infrastructure from external
+ processes to shared objects. Services (i.e. audio) are started automatically
+ and do not require a .service file in /etc/bluetooth/. audio.service will be
+ removed automatically by the upgrade unless modified.
+
+ -- Filippo Giunchedi <filippo@debian.org> Mon, 14 Apr 2008 17:34:21 +0200
+
+bluez-utils (3.7-1) unstable; urgency=low
+
+ This version reverts the /etc/bluetooth/passkeys infrastructure as agents for
+ passkeys are not supposed to be system-wide.
+ A bluez-passkey-gnome is provided as a passkey agent, plus there's a example
+ passkey-agent in /usr/share/doc/bluez-utils/examples/passkey-agent.c
+
+ -- Filippo Giunchedi <filippo@debian.org> Sat, 7 Oct 2006 11:43:09 +0200
+
+bluez-utils (3.1-3) unstable; urgency=low
+
+ This version includes a new management for outgoing passkey (PIN) requests
+ while the incoming passkeys defaults to 1234 in /etc/bluetooth/hcid.conf.
+ See README.Debian for further informations.
+
+ -- Filippo Giunchedi <filippo@debian.org> Wed, 26 Jul 2006 11:37:14 +0200
+
+bluez-utils (3.1-1) unstable; urgency=low
+
+ This new upstream version removes the need for external pin helper, pin
+ requests are handled via dbus. The default pin (or now-called "passkey") is
+ set to 1234 for backward compatibility.
+
+ Also, udev rules for pcmcia card are included along with
+ /lib/udev/bluetooth.sh (setserial required) in the bluez-pcmcia-support.
+
+ -- Filippo Giunchedi <filippo@debian.org> Wed, 26 Jul 2006 11:37:02 +0200
+
+bluez-utils (2.24-1) unstable; urgency=low
+
+ This version moves /etc/{init.d,default}/bluez-utils to
+ /etc/{init.d,default}/bluetooth for LSB compilance.
+ If local modifications are detected the new files will be installed with
+ the ".dpkg-new" suffix
+
+ -- Filippo Giunchedi <filippo@debian.org> Wed, 7 Jun 2006 13:57:35 +0200
+
+bluez-utils (2.19-1) unstable; urgency=high
+
+ * Includes new D-BUS support: sends signals for inquiry results and
+ remote name resolves.
+
+ * Also adds support for device-specific SDP records.
+
+ -- Edd Dumbill <ejad@debian.org> Fri, 19 Aug 2005 01:12:02 +0100
+
+bluez-utils (2.9-1) unstable; urgency=low
+
+ * This release improves input device support: EPoX keyboards and
+ their new HID presenters should now work correctly in report
+ protocol mode.
+
+ -- Edd Dumbill <ejad@debian.org> Sun, 8 Aug 2004 15:19:24 +0100
+
+bluez-utils (2.8-1) unstable; urgency=low
+
+ * Users of dongles with HID proxy capability (this is where the dongle
+ pretends to be a keyboard and mouse until it is switched into Bluetooth
+ mode, allowing Bluetooth input devices to be used in BIOS etc.) are
+ now supported. The switch is made as part of the bluez-utils init
+ script.
+
+ -- Edd Dumbill <ejad@debian.org> Mon, 14 Jun 2004 14:24:12 +0100
+
+bluez-utils (2.7-1) experimental; urgency=low
+
+ * Upstream has merged bluez-pan with this package. You should
+ remove the /etc/init.d/bluez-pan script, and use
+ /etc/default/bluez-utils to configure dund and pand, although
+ for the moment the old /etc/default/bluez-pan is also read.
+
+ * This source package now has Bluetooth printing support, which
+ is built into the bluez-cups binary package.
+
+ * DBUS support has been enabled in this build. To use it, add
+ 'dbus_pin_helper' into the options section, and comment out
+ the pin_helper. DBUS-aware pin helpers such as that in
+ bluez-pin will now be used.
+
+ * Bluetooth HID devices (eg, mouse, keyboard) are now supported
+ for Linux 2.6.6 or better running the hidp patch from bluez.org.
+ If running these, set HIDD_ENABLED to 1 in /etc/default/bluez-utils
+ to enable support, then run hidd --connect <bdaddr> to connect
+ to your keyboard or mouse.
+
+ -- Edd Dumbill <ejad@debian.org> Wed, 26 May 2004 12:43:08 +0100
+
+bluez-utils (2.6-1) experimental; urgency=low
+
+ * Upstream has merged bluez-sdp with this package. The sdp tools
+ are now in this package. You should remove the /etc/init.d/bluez-sdp
+ script.
+
+ * All tools from /sbin now live in /usr/sbin: hciattach hciconfig
+ hcid l2ping.
+
+ -- Edd Dumbill <ejad@debian.org> Thu, 6 May 2004 11:58:16 +0100
+
+bluez-utils (2.4-4) unstable; urgency=high
+
+ * If you still use the old 'bluepin' PIN assistant: note it has moved
+ from /bin/ to /usr/bin/. You will need to update your hcid.conf
+ accordingly. Even better, install bluez-pin and use the helper from
+ there instead.
+ * hcitool has also moved to /usr/bin, and l2ping to /sbin.
+
+ -- Edd Dumbill <ejad@debian.org> Wed, 15 Jan 2004 18:37:32 +0000
+
+bluez-utils (2.4-3) unstable; urgency=low
+
+ * If you're using devfsd and a recent Linux kernel (2.4.22 or later, or
+ 2.6.x), remove the file /etc/devfs/devices.d/bluez and run update-devfsd.
+ This will stop your system complaining when devfsd is started. This
+ package no longer installs that file, but you must remove it yourself.
+ If you need it in future, you can find it in /usr/share/doc/bluez-utils.
+
+ -- Edd Dumbill <ejad@debian.org> Wed, 14 Jan 2004 21:14:35 +0000
+
+bluez-utils (2.4-1) unstable; urgency=low
+
+ * The rfcomm program has changed slightly: you now need a "bind yes"
+ in each entry in /etc/bluetooth/rfcomm.conf to ensure they are bound
+ at startup time. See man rfcomm for more details.
+
+ -- Edd Dumbill <ejad@debian.org> Thu, 1 Jan 2004 18:38:35 +0100
+
+bluez-utils (2.3-2) unstable; urgency=low
+
+ * This package now depends on a new PIN helper bluez-pin. If you are
+ upgrading this package and want to use the new helper instead of the
+ default one (highly recommended) then alter your pin_helper line in
+ /etc/bluetooth/hcid.conf to specify /usr/bin/bluez-pin.
+
+ -- Edd Dumbill <ejad@debian.org> Thu, 28 Aug 2003 12:38:35 +0100
--- bluez-4.66.orig/debian/bluez-compat.README.Debian
+++ bluez-4.66/debian/bluez-compat.README.Debian
@@ -0,0 +1,14 @@
+bluez compatibility daemons
+===========================
+This package contains old daemons like dund/pand/hidd which have been obsoleted
+by bluetoothd and the D-Bus API, they are provided for backward compatibility.
+
+It is possibile to start the daemons at boot if needed via /etc/rc.local file.
+
+If options were used via /etc/default/bluetooth this can be accomplished by a
+snippet like:
+
+test -f /etc/default/bluetooth && . /etc/default/bluetooth
+[ "$HIDD_ENABLED" -eq 1 ] && /usr/bin/hidd $HIDD_OPTIONS
+[ "$PAND_ENABLED" -eq 1 ] && /usr/bin/pand $PAND_OPTIONS
+[ "$DUND_ENABLED" -eq 1 ] && /usr/bin/dund $DUND_OPTIONS
--- bluez-4.66.orig/debian/compat
+++ bluez-4.66/debian/compat
@@ -0,0 +1 @@
+7
--- bluez-4.66.orig/debian/bluez-alsa.install
+++ bluez-4.66/debian/bluez-alsa.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/alsa-lib/*.so
--- bluez-4.66.orig/debian/bluez.manpages
+++ bluez-4.66/debian/bluez.manpages
@@ -0,0 +1,3 @@
+debian/bluetooth-agent.1
+debian/l2test.1
+debian/hcitrace.1
--- bluez-4.66.orig/debian/bluetooth-agent.1
+++ bluez-4.66/debian/bluetooth-agent.1
@@ -0,0 +1,15 @@
+.TH BLUETOOTH-AGENT "1" "March 2010"
+.SH NAME
+bluetooth-agent \- Bluetooth pass agent
+.SH SYNOPSIS
+.B bluetooth-agent
+.SH DESCRIPTION
+\fBBluetooth-agent\fP is pass agent program for bluetooth.
+
+.SH USAGE
+.TP
+bluetooth-agent [\fB--adapter\fP adapter-path] [\fB--path\fP agent-path] <passkey> [<device>]
+.SH AUTHOR
+This manual page was written by Nobuhiro Iwamatsu <iwamatsu@debian.org>,
+for the Debian GNU/Linux system (but may be used by others).
+
--- bluez-4.66.orig/debian/hcitrace.1
+++ bluez-4.66/debian/hcitrace.1
@@ -0,0 +1,22 @@
+.TH HCITRACE "1" "June 2010"
+.SH NAME
+hcitrace \- hcitrace daemon
+.SH SYNOPSIS
+.B hcitrace
+.SH DESCRIPTION
+\fBhcitrace\fP daemon allow per advanced tracing capabilities
+with multiple HCI controllers per stream.
+
+.SH USAGE
+hcitrace [OPTION...]
+
+Help Options:
+ \fB-h\fP, \fB--help\fP Show help options
+
+Application Options:
+ \fB-n\fP, \fB--nodaemon\fP Don't run as daemon in background
+ \fB-d\fP, \fB--debug\fP Enable debug information output
+
+.SH AUTHOR
+This manual page was written by Nobuhiro Iwamatsu <iwamatsu@debian.org>,
+for the Debian GNU/Linux system (but may be used by others).
--- bluez-4.66.orig/debian/bluez-cups.install
+++ bluez-4.66/debian/bluez-cups.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/cups/backend/*
--- bluez-4.66.orig/debian/bluez.bluetooth.default
+++ bluez-4.66/debian/bluez.bluetooth.default
@@ -0,0 +1,20 @@
+# Defaults for bluez
+
+# start bluetooth on boot?
+# compatibility note: if this variable is _not_ found bluetooth will start
+BLUETOOTH_ENABLED=1
+
+# This setting used to switch HID devices (e.g mouse/keyboad) to HCI mode, that
+# is you will have bluetooth functionality from your dongle instead of only
+# HID. This is accomplished for supported devices by udev in
+# /lib/udev/rules.d/62-bluez-hid2hci.rules by invoking hid2hci with correct
+# parameters.
+# See /usr/share/doc/bluez/NEWS.Debian.gz for further information.
+
+# Older daemons like pand dund and hidd can be found in bluez-compat package as
+# they are deprecated and provided for backward compatibility only.
+
+# 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=0
+HID2HCI_UNDO=0
--- bluez-4.66.orig/debian/bluez.bluetooth.init
+++ bluez-4.66/debian/bluez.bluetooth.init
@@ -0,0 +1,203 @@
+#! /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>
+#
+# Note: older daemons like dund pand hidd are now shipped inside the
+# bluez-compat package
+
+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
+
+SSD_OPTIONS="--oknodo --quiet --exec $DAEMON"
+
+test -f /usr/sbin/bluetoothd || exit 0
+
+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()
+{
+ log_progress_msg "switching to HID/HCI no longer done in init script, see /usr/share/doc/bluez/NEWS.Debian.gz"
+}
+
+disable_hci_input()
+{
+ log_progress_msg "switching to HID/HCI no longer done in init script, see /usr/share/doc/bluez/NEWS.Debian.gz"
+}
+
+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 $SSD_OPTIONS
+ log_progress_msg "bluetoothd"
+
+ run_sdptool || true
+
+ start_uarts || true
+
+ if test "$HID2HCI_ENABLED" = "1"; then
+ enable_hci_input || true
+ fi
+ start_rfcomm || true
+
+ if test "$HIDD_ENABLED" = "1" ||
+ test "$PAND_ENABLED" = "1" ||
+ test "$DUND_ENABLED" = "1"; then
+ log_progress_msg "compatibily daemons not started, see bluez-compat package"
+ fi
+
+ 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 $SSD_OPTIONS
+ log_progress_msg "bluetoothd"
+ stop_uarts || true
+ log_end_msg 0
+ ;;
+ restart|force-reload)
+ $0 stop
+ sleep 1
+ $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.66.orig/debian/bluez.docs
+++ bluez-4.66/debian/bluez.docs
@@ -0,0 +1,2 @@
+*/*-api.txt
+debian/README.Debian
--- bluez-4.66.orig/debian/bluez-compat.dirs
+++ bluez-4.66/debian/bluez-compat.dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/man/man1
--- bluez-4.66.orig/debian/README.Debian
+++ bluez-4.66/debian/README.Debian
@@ -0,0 +1,118 @@
+bluez for Debian
+================
+
+The /dev/rfcomm* serial devices entries are automatically created for using
+RFCOMM with legacy applications -- see rfcomm(8). Users must be in group
+'dialout' to have privileges to use these devices.
+
+You can edit /etc/bluetooth/rfcomm.conf to have some rfcomm devices bound
+automatically at boot time.
+
+If you wish to install PCMCIA card services support for your Bluetooth
+devices you should install the bluez-pcmcia-support package.
+
+Some USB dongles require firmware to make them work: bluez-firmware from the
+"non-free" section provides the required firmware.
+
+
+Mailing lists and documentation
+-------------------------------
+The old sourceforge lists have been discontinued, the new lists can be found at:
+
+http://www.bluez.org/development/lists/
+
+plus a wiki at: http://wiki.bluez.org/
+
+PIN (or passkey) management
+---------------------------
+Interaction with the local user can be required while BT connection is
+being established (pairing process) and the PIN is not yet known or
+needs to be changed.
+
+To retrieve the passkey (or PIN) from the user a service program (agent)
+running in user's interactive session needs to be prepared and listen
+for requests of the bluez daemon when pairing begins.
+
+Examples of such programs are kblueplugd (kdebluetooth package) and
+bluetooth-applet (bluez-gnome or gnome-bluetooth packages). A minimal
+command-line agent is also provided by bluetooth-agent.
+
+Headset support
+---------------
+There's support for bluetooth headset both via ALSA and GStreamer, respectively
+via bluez-alsa and bluez-gstreamer packages.
+
+ALSA
+~~~~
+You might setup your headset by discovering it with gnome-bluetooth, once setup
+add the following configuration to ~/.asoundrc:
+
+ pcm.bluetooth {
+ type bluetooth
+ device <BT address>
+ }
+
+then audio can be played with supported player, e.g. mplayer:
+
+ mplayer -ao alsa:device=bluetooth
+
+See also: http://wiki.bluez.org/wiki/HOWTO/AudioDevices
+
+Legacy daemons
+--------------
+The bluez-compat package includes old legacy daemons such as dund, pand and hidd
+for enabling dial-up, ethernet networking and input devices over bluetooth.
+
+Bluetooth Networking Quickstart with legacy daemons
++++++++++++++++++++++++++++++++++++++++++++++++++++
+1. Start dund and pand at boot time
+
+2. PPP over RFCOMM
+
+This is what most devices call "LAN Access" or "Serial Access". It
+uses normal PPP over a serial connection. Most PDAs will be able to
+connect using this method.
+
+Use the 'dund' tool to accept incoming connections. Configure pppd
+as per the instructions in the ppp package. Then run:
+
+dund --listen --sdp --nodetach
+
+Try and connect your device and you'll see something like:
+
+dund[9801]: DUN daemon ver 1.1pre4
+dund[9811]: New connection from 00:02:31:24:17:6A
+
+The --sdp option causes the DUN access to be advertised to other
+devices via the SDP protocol. Most devices need this in order to be
+able to connect.
+
+Run dund --help to see the various other options available to you.
+
+If you want to make an outgoing connection using PPP, for instance to
+a mobile phone, use the 'rfcomm' program from bluez-utils to bind a
+/dev/rfcommX serial port to the phone, and then then use pppd as you
+would with a normal modem.
+
+3. PAN
+
+The 'pand' tool allows you to use ethernet style networking over
+Bluetooth. It creates a network interface on your machine that can be
+configured in the same way normal network devices are.
+
+For full details see the PAN HOWTO at
+<http://bluez.sourceforge.net/contrib/HOWTO-PAN>
+
+Keyboard and mouse support with hidd
+++++++++++++++++++++++++++++++++++++
+The hidd daemon allows keyboards and mice to be connected to your system.
+Make sure you have hidd starting at boot as user root.
+Discover you mouse or keyboard bluetooth address (bdaddr) by running
+"hcitool scan". You must then connect to your keyboard or mouse using hidd
+--connect <bdaddr>. On first connection, pairing is likely and you should
+press "connect" button on mice/keyboard, if any. Mice normally have a
+preset PIN which should be in the manufacturer's documentation, try 0000.
+For keyboards, type the PIN on the Bluetooth keyboard and hit enter, and
+then supply it to the passkey agent (using a cable-attached keyboard). In
+future your keyboard or mouse should reconnect to your computer
+automatically. You must invoke hidd as root.
--- bluez-4.66.orig/debian/control
+++ bluez-4.66/debian/control
@@ -0,0 +1,137 @@
+Source: bluez
+Section: admin
+Priority: optional
+Maintainer: Debian Bluetooth Maintainers <pkg-bluetooth-maintainers@lists.alioth.debian.org>
+Uploaders: Andrea Veri <andrea.veri89@gmail.com>, Nobuhiro Iwamatsu <iwamatsu@debian.org>
+DM-Upload-Allowed: yes
+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,
+ libcap-ng-dev
+Vcs-Svn: svn://svn.debian.org/svn/pkg-bluetooth/packages/bluez/trunk
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-bluetooth/packages/bluez/trunk
+Homepage: http://www.bluez.org
+Standards-Version: 3.8.4
+
+Package: libbluetooth3
+Section: libs
+Conflicts: libsdp2 (<= 1.5-2)
+Replaces: libsdp2 (<= 1.5-2)
+Depends: ${shlibs:Depends}, ${misc: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: 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, ${misc:Depends}
+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: bluetooth
+Architecture: all
+Depends: bluez
+Recommends: bluez-alsa, bluez-cups, bluez-gstreamer
+Description: Bluetooth 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, udev | makedev, lsb-base, dbus, ${misc:Depends}
+Replaces: bluez-input, bluez-network, bluez-serial, bluez-utils (<= 3.36-3), bluez-audio (<= 3.36-3)
+Conflicts: bluez-utils (<= 3.36-3), bluez-audio (<= 3.36-3)
+Suggests: python-gobject, python-dbus
+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
+Replaces: bluez-audio
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, bluez
+Description: Bluetooth ALSA 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-gstreamer
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, bluez
+Replaces: bluez-audio
+Description: Bluetooth GStreamer support
+ This package contains a plugin to operate 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-cups
+Architecture: any
+Depends: ${shlibs:Depends}, cups, ${misc:Depends}
+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-pcmcia-support
+Architecture: any
+Priority: extra
+Depends: pcmciautils, ${misc:Depends}
+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: bluez-compat
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: BlueZ 3.x compatibility binaries
+ This package provides the legacy binaries that were reminiscent of the
+ BlueZ 3.x pairing methods. These binaries are not supported, and will
+ go away again in the future. The provided binaries are:
+ .
+ hidd
+ dund
+ pand
+
+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.
+
+Package: bluez-audio
+Depends: bluez-alsa (>= 4), bluez-gstreamer (>= 4)
+Architecture: all
+Description: Transitional package
+ This is a transitional package to assist with moving people to the
+ BlueZ 4.x stack.
--- bluez-4.66.orig/debian/changelog
+++ bluez-4.66/debian/changelog
@@ -0,0 +1,378 @@
+bluez (4.66-3) testing; urgency=medium
+
+ * Drop patches/010_udev_rules_agent.patch (Closes: #588034).
+ Connection of bluetooth is cut off after system start,
+ if applied this patch. And this patch is not already necessary.
+
+ -- Nobuhiro Iwamatsu <iwamatsu@debian.org> Thu, 02 Dec 2010 12:14:56 +0900
+
+bluez (4.66-2) testing; urgency=low
+
+ * Fix init script to be a nop when the package is removed.
+ debian/bluez.bluetooth.init (Closes: #593172).
+ * Fix removal of obsolete conffile.
+ debian/bluez.preinst (Closes: #592982, #568301).
+ * Backports some pathces from upstream (Closes: #601583).
+ - 0204_Fix-memory-leak.patch
+ Fix memory leak in hfp_ag_record function.
+ - 0206_Fix-missing-error-check-to-dbus_message_get_args.patch
+ Fix missing error check to dbus_message_get_args.
+ - 0207_Fix-attempt-to-use-a-potential-negative-array-index.patch
+ Fix attempt to use a potential negative array index.
+ - 0208_Fix-sdp_get_supp_feat-function.patch
+ Fix data allocation size to get in sdp_get_supp_feat.
+ - 0209_Fix-unblock-removed-device.patch
+ Fix unblock removed device.
+ - 0213_Fix-not-freeing-memory-on-driver-exit.patch
+ Fix not freeing memory on driver exit.
+ - 0214_Fix-possible-memory-leaks-on-ofono-driver.patch
+ Fix memory leak by add address check.
+ - 0215_Fix-not-cancelling-authentication-when-bonding-fails.patch
+ Fix not cancelling authentication when bonding fails
+ - 0217_Fix-sending-authentication-reply-when-bonding-is-alr.patch
+ When bonding is already completed, sending authentication reply.
+ - 0218_Fix-use-of-errno-after-calling-some-function-that-co.patch
+ Fix return erro code in device_authentication_requested function.
+ - 0227_core-fix-emitting-pairable-when-there-could-still-oc.patch
+ Move error check code.
+ - 0229_Fix-the-return-value-of-read_device_alias.patch
+ Fix the return value of read_device_alias function.
+
+ -- Nobuhiro Iwamatsu <iwamatsu@debian.org> Thu, 04 Nov 2010 05:45:03 +0900
+
+bluez (4.66-1) unstable; urgency=low
+
+ * New upstream release.
+ * Update debian/control.
+ - Add libcap-ng-dev to Build-depends.
+ * Update debian/rules.
+ - Add serial.conf (Closes: #559672).
+ - Update configure option.
+ Remove --enable-manpages.
+ Change --enable-pcmciarules to --enable-pcmcia.
+ Add --enable-pnat, --enable-tracer, --enable-udevrules,
+ --enable-configfiles and --enable-capng.
+ * Add man file of hcitrace.
+ * Update udev rule (Closes: #535075).
+ Thanks to Sjoerd Simons.
+ * Add patch 01_lower_sink_ranking.patch (Closes: #571595).
+ Thanks to Sebastian Dröge.
+
+ -- Nobuhiro Iwamatsu <iwamatsu@debian.org> Tue, 22 Jun 2010 12:45:57 +0900
+
+bluez (4.64-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Nobuhiro Iwamatsu <iwamatsu@debian.org> Sat, 15 May 2010 15:44:23 +0900
+
+bluez (4.63-2) unstable; urgency=low
+
+ * Remove some contents from debian/NEWS. (Closes: #579817)
+
+ -- Nobuhiro Iwamatsu <iwamatsu@debian.org> Thu, 06 May 2010 06:50:14 +0900
+
+bluez (4.63-1) unstable; urgency=low
+
+ * Update debian/control.
+ - Remove Filippo Giunchedi <filippo@debian.org> from uploaders.
+ - bumped standards-version to 3.8.4.
+ * Add man files.
+ bluetooth-agent.1, l2test.1.
+ * Update libbluetooth3.symbols.
+ Add hci_bustostr@Base, hci_read_inq_response_tx_power_level@Base,
+ hci_typetostr@Base, sdp_get_supp_feat@Base, sdp_set_supp_feat@Base
+ * Update debian/NEWS.
+ * Add debian/source/format.
+
+ -- Nobuhiro Iwamatsu <iwamatsu@debian.org> Tue, 20 Apr 2010 06:08:24 +0900
+
+bluez (4.60-1) unstable; urgency=low
+
+ * New upstream release.
+ * debian/control:
+ - Add Nobuhiro Iwamatsu to Uploaders (Closes #564569).
+
+ -- Nobuhiro Iwamatsu <iwamatsu@debian.org> Sat, 23 Jan 2010 16:03:01 +0900
+
+bluez (4.57-1) unstable; urgency=low
+
+ * New upstream bug fix release.
+
+ -- Andrea Veri <andrea.veri89@gmail.com> Thu, 12 Nov 2009 21:27:54 +0100
+
+bluez (4.56-2) unstable; urgency=low
+
+ * debian/control:
+ - makedev re-added as alternate depend of udev, as
+ it's needed by postints. Thanks to Guillem Jover
+ for the report. (Closes: #546860)
+
+ -- Andrea Veri <andrea.veri89@gmail.com> Wed, 14 Oct 2009 00:19:19 +0200
+
+bluez (4.56-1) unstable; urgency=low
+
+ * New upstream release. (Closes: #539361)
+ * rctest man page is no more missing. (Closes: #535949)
+ * debian/control:
+ - bumped standards-version to 3.8.3. No changes needed.
+ - added myself into uploaders plus DM tag.
+ - removed makedev depends. (Closes: #546860)
+ * debian/copyright:
+ - added missing copyright holders.
+ * debian/patches/001_agent_fixes.patch:
+ - removed, applied upstream
+ * debian/patches/002_a2dpsink_marginal.patch:
+ - removed, applied upstream.
+ * debian/patches/005_l2ping_section.patch:
+ - removed, applied upstream.
+ * debian/rules:
+ - removed the hack to have man page installed correctly.
+ It has been fixed upstream and points to the right section. (8)
+ * debian/libbluetooth3.symbols:
+ - refreshed.
+ * debian/bluez.examples:
+ - test/test-* removed and added all needed examples by hand to avoid
+ the installation of useless stuff.
+
+ -- Andrea Veri <andrea.veri89@gmail.com> Mon, 12 Oct 2009 15:40:02 +0200
+
+bluez (4.42-2) unstable; urgency=low
+
+ * Fix "Bashisms in init script" (Closes: #534511)
+ * Handle upgrade of old /etc/modprobe.d/bluez (Closes: #523050)
+ * Conflict/Replace bluez-audio in bluez (Closes: #535089)
+
+ -- Filippo Giunchedi <filippo@debian.org> Tue, 30 Jun 2009 20:05:13 +0200
+
+bluez (4.42-1) unstable; urgency=low
+
+ * New upstream release
+ + drop not needed debian/patches/003_configure_amd64_rpath.patch
+ * Provide transitional bluez-audio to migrate to bluez-alsa and
+ bluez-gstreamer (Closes: #531449)
+ * Install README.Debian in binary bluez (Closes: #532018)
+ * Make bluez-{alsa,gstreamer} depend on bluez
+ * Switch to group bluetooth from netdev for authorized users
+ (Closes: #534118)
+ * Mention pand/hidd/dund move to bluez-compat in init script and default
+ (Closes: #532622)
+ * debian/patches/002_test_agent_newapi.patch port bluetooth-agent to new
+ D-Bus API
+ * Update to S-V 3.8.2: no changes
+ * Introduce common SSD_OPTIONS in init script and sleep 1 on restart
+
+ -- Filippo Giunchedi <filippo@debian.org> Sun, 21 Jun 2009 14:01:04 +0200
+
+bluez (4.40-2) unstable; urgency=low
+
+ * Ship a libbluetooth3.symbols file instead of shlibs
+ * Ship more examples from test/, thus suggest: python-gobject and
+ python-dbus together with README.examples
+ * Provide a script in /lib/udev/bluez for waiting on /usr being available
+ and a patch udev rules to use it
+
+ -- Filippo Giunchedi <filippo@debian.org> Tue, 26 May 2009 00:02:53 +0200
+
+bluez (4.40-1) unstable; urgency=low
+
+ * New upstream release
+ - scripts/bluetooth.rules -> scripts/bluetooth-serial.rules
+ * Upload to unstable
+ * Change usage for hid2hci: install udev rules and issue a warning from init
+ script
+
+ -- Filippo Giunchedi <filippo@debian.org> Fri, 22 May 2009 14:56:07 +0200
+
+bluez (4.34-0exp1) experimental; urgency=low
+
+ * First upload of bluez 4.x (Closes: #499529)
+ - include parts of the packaging from ubuntu, thanks!
+ - bluez-utils and bluez-libs are now a single source package
+ - libbluetooth2 -> libbluetooth3 bump
+ - conflict bluez with bluez-utils (<= 3.36-3)
+ - update debian/copyright, thanks to Nobuhiro Iwamatsu
+ * Remove hid2hci patches/script
+ * Remove broken link to documentation (Closes: #504675)
+ * Install a sample commandline agent from test/ into bluetooth-agent
+ - add 001_test_agent_default_adapter.patch to get the default adapter
+ * Install test/simple-agent and test/list-devices as examples
+ * Remove old commented code from maintainer scripts (pcmcia-support postinst
+ and bluez preinst)
+ * Update watch file to match bluez only
+ * Add #DEBHELPER# to debian/bluez-utils.postrm
+ * Update to S-V 3.8.1: no changes needed
+ * Fix lintian warnings:
+ - add -e to remaining maintainer scripts
+ - remove full path to update-rc.d in debian/bluez.postinst
+ - override "bluez-utils: maintainer-script-empty postrm" for transitional
+ bluez-utils postrm
+ * Use 7 in debian/compat
+ * Fix debian/bluez.preinst to use dpkg-query, thus removing the lintian
+ override
+
+ -- Filippo Giunchedi <filippo@debian.org> Wed, 01 Apr 2009 12:20:01 +0200
+
+bluez (4.29-0ubuntu1) jaunty; urgency=low
+
+ * New upstream version (LP: #326811)
+ - Use AVRCP version 1.0 for now.
+ - Decrease AVDTP idle timeout to one second.
+ - Delay AVRCP connection when remote device connects A2DP.
+ - Add workaround for AVDTP stream setup with broken headsets.
+ - Add missing three-way calling feature bit for Handsfree.
+ - Fix handsfree callheld indicator updating.
+ - Fix parsing of all AT commands within the buffer.
+ - Fix authentication replies when disconnected.
+ - Fix handling of debug combination keys.
+ - Fix handling of changed combination keys.
+ - Fix handling of link keys when using no bonding.
+ - Fix handling of invalid/unknown authentication requirements.
+ - Fix closing of L2CAP raw socket used for dedicated bonding.
+
+ -- Baptiste Mille-Mathias <baptiste.millemathias@gmail.com> Sun, 08 Feb 2009 10:48:36 +0100
+
+bluez (4.28-0ubuntu1) jaunty; urgency=low
+
+ * New upstream version. (LP: #324492)
+ - Add AVDTP signal fragmentation support.
+ - Add more SBC performance optimizations.
+ - Add more SBC audio quality improvements.
+ - Use native byte order for audio plugins.
+ - Set the adapter alias only after checking the EIR data.
+ - Fix auto-disconnect issue with explicit A2DP connections.
+ - Fix invalid memory access of ALSA plugin.
+ - Fix compilation with -Wsign-compare.
+
+ -- Baptiste Mille-Mathias <baptiste.millemathias@gmail.com> Mon, 02 Feb 2009 21:57:08 +0100
+
+bluez (4.27-0ubuntu1) jaunty; urgency=low
+
+ * New upstream version. (LP: #304784)
+ - Improves interoperability and security handling
+ with Bluetooth 2.1 based devices.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Tue, 27 Jan 2009 12:44:39 -0600
+
+bluez (4.25-0ubuntu6) jaunty; urgency=low
+
+ * Drop previous patch, bluez is a bit strange and this is basically ok.
+
+ -- Scott James Remnant <scott@ubuntu.com> Mon, 19 Jan 2009 17:01:14 +0000
+
+bluez (4.25-0ubuntu5) jaunty; urgency=low
+
+ * debian/patches/ubuntu_dbus_policy.patch:
+ - Drop send_interface allow which isn't service-specific. LP: #318740.
+
+ -- Scott James Remnant <scott@ubuntu.com> Mon, 19 Jan 2009 15:38:43 +0000
+
+bluez (4.25-0ubuntu4) jaunty; urgency=low
+
+ * Add Breaks to ensure the right udev version is used.
+
+ -- Scott James Remnant <scott@ubuntu.com> Fri, 09 Jan 2009 11:35:06 +0000
+
+bluez (4.25-0ubuntu3) jaunty; urgency=low
+
+ * debian/hid2hci.rules: Update to use ATTRS{} instead of SYSFS{}
+
+ -- Scott James Remnant <scott@ubuntu.com> Wed, 07 Jan 2009 14:18:52 +0000
+
+bluez (4.25-0ubuntu2) jaunty; urgency=low
+
+ * debian/rules: Install rules into /lib/udev/rules.d
+ * debian/bluez.preinst: Remove old rule if unchanged.
+
+ -- Scott James Remnant <scott@ubuntu.com> Wed, 07 Jan 2009 11:35:39 +0000
+
+bluez (4.25-0ubuntu1) jaunty; urgency=low
+
+ * New upstream release. (LP: #312087)
+
+ -- Baptiste Mille-Mathias <baptiste.millemathias@gmail.com> Tue, 30 Dec 2008 19:53:44 +0100
+
+bluez (4.21-0ubuntu1) jaunty; urgency=low
+
+ * New upstream version. (LP: #304109)
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Wed, 03 Dec 2008 15:56:03 -0600
+
+bluez (4.17-0ubuntu1) jaunty; urgency=low
+
+ * New upstream version. (LP: #284039)
+ * Drop the following patches that landed upstream:
+ - logitech_5500_ids.patch
+ - dell_bt_365.patch
+ - sco_connect_git.patch
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Wed, 05 Nov 2008 13:28:35 -0600
+
+bluez (4.12-0ubuntu5) intrepid; urgency=low
+
+ * Add debian/hid2hci.rules to enable running hid2hci
+ as soon as some bluetooth dongles get plugged in. (LP: #288294)
+ * debian/bluez.postinst:
+ - Update udev rules on postinst.
+ * debian/rules:
+ - Install debian/hid2hci.rules to 62-bluez-hid2hci.rules
+
+ -- Mario Limonciello <superm1@ubuntu.com> Sat, 25 Oct 2008 23:32:00 -0500
+
+bluez (4.12-0ubuntu4) intrepid; urgency=low
+
+ * Add hid2hci.patch to enable hid2hci to be ran after
+ suspending a machine. (LP: #268877)
+ * debian/rules:
+ - Install new script from above patch.
+ * Add logitech_5500_ids.patch for enabling hid2hci on
+ more logitech devices. (LP: #272352)
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Wed, 22 Oct 2008 16:01:59 -0500
+
+bluez (4.12-0ubuntu3) intrepid; urgency=low
+
+ * debian/bluez.postinst:
+ - Don't show output for MAKEDEV. (LP: 280360)
+ * Add dell_bt_365.patch which will enable putting the Dell BT365
+ adapter into HCI mode upon bootup. (LP: #286724)
+ * debian/control:
+ - Add one more binary package for old compatibility binaries. (LP: #281580)
+ * debian/rules:
+ - Enable compatibility binaries. These are HIGHLY discouraged from usage
+ and will not necessarily be here in the future.
+ * debian/bluez.install:
+ - Adjust what binaries get installed, to be able to pull out hidd, dund,
+ and pand as necessary.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Mon, 20 Oct 2008 20:37:24 -0500
+
+bluez (4.12-0ubuntu2) intrepid; urgency=low
+
+ * debian/control:
+ - Move libbluetooth3 to the top of the list so that it is the
+ package that gets to keep the real changelog rather than symlinks.
+ - Only Replaces: packages rather than conflicts to help with
+ upgrades (LP: #279954)
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Tue, 07 Oct 2008 16:32:31 -0500
+
+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.66.orig/debian/libbluetooth3.symbols
+++ bluez-4.66/debian/libbluetooth3.symbols
@@ -0,0 +1,199 @@
+libbluetooth.so.3 libbluetooth3 #MINVER#
+ ba2oui@Base 4.43
+ ba2str@Base 4.43
+ bachk@Base 4.43
+ bafprintf@Base 4.43
+ baprintf@Base 4.43
+ basnprintf@Base 4.43
+ basprintf@Base 4.43
+ baswap@Base 4.43
+ batostr@Base 4.43
+ bt_compidtostr@Base 4.43
+ bt_error@Base 4.43
+ bt_free@Base 4.43
+ bt_malloc@Base 4.43
+ hci_authenticate_link@Base 4.43
+ hci_bustostr@Base 4.43
+ hci_change_link_key@Base 4.43
+ hci_close_dev@Base 4.43
+ hci_cmdtostr@Base 4.43
+ hci_commandstostr@Base 4.43
+ hci_create_connection@Base 4.43
+ hci_delete_stored_link_key@Base 4.43
+ hci_devba@Base 4.43
+ hci_devid@Base 4.43
+ hci_devinfo@Base 4.43
+ hci_dflagstostr@Base 4.43
+ hci_disconnect@Base 4.43
+ hci_dtypetostr@Base 4.43
+ hci_encrypt_link@Base 4.43
+ hci_exit_park_mode@Base 4.43
+ hci_for_each_dev@Base 4.43
+ hci_get_route@Base 4.43
+ hci_inquiry@Base 4.43
+ hci_lmtostr@Base 4.43
+ hci_lptostr@Base 4.43
+ hci_open_dev@Base 4.43
+ hci_park_mode@Base 4.43
+ hci_ptypetostr@Base 4.43
+ hci_read_afh_map@Base 4.43
+ hci_read_afh_mode@Base 4.43
+ hci_read_bd_addr@Base 4.43
+ hci_read_class_of_dev@Base 4.43
+ hci_read_clock@Base 4.43
+ hci_read_clock_offset@Base 4.43
+ hci_read_current_iac_lap@Base 4.43
+ hci_read_ext_inquiry_response@Base 4.43
+ hci_read_inq_response_tx_power_level@Base 4.43
+ hci_read_inquiry_mode@Base 4.43
+ hci_read_inquiry_scan_type@Base 4.43
+ hci_read_inquiry_transmit_power_level@Base 4.43
+ hci_read_link_policy@Base 4.43
+ hci_read_link_quality@Base 4.43
+ hci_read_link_supervision_timeout@Base 4.43
+ hci_read_local_commands@Base 4.43
+ hci_read_local_ext_features@Base 4.43
+ hci_read_local_features@Base 4.43
+ hci_read_local_name@Base 4.43
+ hci_read_local_oob_data@Base 4.43
+ hci_read_local_version@Base 4.43
+ hci_read_remote_ext_features@Base 4.43
+ hci_read_remote_features@Base 4.43
+ hci_read_remote_name@Base 4.43
+ hci_read_remote_name_cancel@Base 4.43
+ hci_read_remote_name_with_clock_offset@Base 4.43
+ hci_read_remote_version@Base 4.43
+ hci_read_rssi@Base 4.43
+ hci_read_simple_pairing_mode@Base 4.43
+ hci_read_stored_link_key@Base 4.43
+ hci_read_transmit_power_level@Base 4.43
+ hci_read_voice_setting@Base 4.43
+ hci_scoptypetostr@Base 4.43
+ hci_send_cmd@Base 4.43
+ hci_send_req@Base 4.43
+ hci_set_afh_classification@Base 4.43
+ hci_strtolm@Base 4.43
+ hci_strtolp@Base 4.43
+ hci_strtoptype@Base 4.43
+ hci_strtoscoptype@Base 4.43
+ hci_strtover@Base 4.43
+ hci_switch_role@Base 4.43
+ hci_typetostr@Base 4.43
+ hci_vertostr@Base 4.43
+ hci_write_afh_mode@Base 4.43
+ hci_write_class_of_dev@Base 4.43
+ hci_write_current_iac_lap@Base 4.43
+ hci_write_ext_inquiry_response@Base 4.43
+ hci_write_inquiry_mode@Base 4.43
+ hci_write_inquiry_scan_type@Base 4.43
+ hci_write_inquiry_transmit_power_level@Base 4.43
+ hci_write_link_policy@Base 4.43
+ hci_write_link_supervision_timeout@Base 4.43
+ hci_write_local_name@Base 4.43
+ hci_write_simple_pairing_mode@Base 4.43
+ hci_write_stored_link_key@Base 4.43
+ hci_write_voice_setting@Base 4.43
+ lmp_featurestostr@Base 4.43
+ lmp_strtover@Base 4.43
+ lmp_vertostr@Base 4.43
+ sdp_append_to_buf@Base 4.43
+ sdp_append_to_pdu@Base 4.43
+ sdp_attr_add@Base 4.43
+ sdp_attr_add_new@Base 4.43
+ sdp_attr_remove@Base 4.43
+ sdp_attr_replace@Base 4.43
+ sdp_attrid_comp_func@Base 4.43
+ sdp_close@Base 4.43
+ sdp_connect@Base 4.43
+ sdp_copy_record@Base 4.43
+ sdp_create@Base 4.43
+ sdp_data_alloc@Base 4.43
+ sdp_data_alloc_with_length@Base 4.43
+ sdp_data_free@Base 4.43
+ sdp_data_get@Base 4.43
+ sdp_device_record_register@Base 4.43
+ sdp_device_record_register_binary@Base 4.43
+ sdp_device_record_unregister@Base 4.43
+ sdp_device_record_unregister_binary@Base 4.43
+ sdp_device_record_update@Base 4.43
+ sdp_device_record_update_binary@Base 4.43
+ sdp_extract_attr@Base 4.43
+ sdp_extract_pdu@Base 4.43
+ sdp_extract_seqtype@Base 4.43
+ sdp_gen_pdu@Base 4.43
+ sdp_gen_record_pdu@Base 4.43
+ sdp_gen_tid@Base 4.43
+ sdp_general_inquiry@Base 4.43
+ sdp_get_access_protos@Base 4.43
+ sdp_get_add_access_protos@Base 4.43
+ sdp_get_database_state@Base 4.43
+ sdp_get_error@Base 4.43
+ sdp_get_group_id@Base 4.43
+ sdp_get_int_attr@Base 4.43
+ sdp_get_lang_attr@Base 4.43
+ sdp_get_profile_descs@Base 4.43
+ sdp_get_proto_desc@Base 4.43
+ sdp_get_proto_port@Base 4.43
+ sdp_get_record_state@Base 4.43
+ sdp_get_server_ver@Base 4.43
+ sdp_get_service_avail@Base 4.43
+ sdp_get_service_id@Base 4.43
+ sdp_get_service_ttl@Base 4.43
+ sdp_get_socket@Base 4.43
+ sdp_get_string_attr@Base 4.43
+ sdp_get_supp_feat@Base 4.43
+ sdp_get_uuidseq_attr@Base 4.43
+ sdp_list_append@Base 4.43
+ sdp_list_free@Base 4.43
+ sdp_list_insert_sorted@Base 4.43
+ sdp_list_remove@Base 4.43
+ sdp_pattern_add_uuid@Base 4.43
+ sdp_pattern_add_uuidseq@Base 4.43
+ sdp_process@Base 4.43
+ sdp_profile_uuid2strn@Base 4.43
+ sdp_proto_uuid2strn@Base 4.43
+ sdp_record_alloc@Base 4.43
+ sdp_record_free@Base 4.43
+ sdp_record_print@Base 4.43
+ sdp_record_register@Base 4.43
+ sdp_record_unregister@Base 4.43
+ sdp_record_update@Base 4.43
+ sdp_send_req_w4_rsp@Base 4.43
+ sdp_seq_alloc@Base 4.43
+ sdp_seq_alloc_with_length@Base 4.43
+ sdp_seq_append@Base 4.43
+ sdp_service_attr_async@Base 4.43
+ sdp_service_attr_req@Base 4.43
+ sdp_service_search_async@Base 4.43
+ sdp_service_search_attr_async@Base 4.43
+ sdp_service_search_attr_req@Base 4.43
+ sdp_service_search_req@Base 4.43
+ sdp_set_access_protos@Base 4.43
+ sdp_set_add_access_protos@Base 4.43
+ sdp_set_attrid@Base 4.43
+ sdp_set_group_id@Base 4.43
+ sdp_set_info_attr@Base 4.43
+ sdp_set_lang_attr@Base 4.43
+ sdp_set_notify@Base 4.43
+ sdp_set_profile_descs@Base 4.43
+ sdp_set_seq_len@Base 4.43
+ sdp_set_service_id@Base 4.43
+ sdp_set_supp_feat@Base 4.43
+ sdp_set_url_attr@Base 4.43
+ sdp_set_uuidseq_attr@Base 4.43
+ sdp_svclass_uuid2strn@Base 4.43
+ sdp_uuid128_cmp@Base 4.43
+ sdp_uuid128_create@Base 4.43
+ sdp_uuid128_to_uuid@Base 4.43
+ sdp_uuid16_cmp@Base 4.43
+ sdp_uuid16_create@Base 4.43
+ sdp_uuid16_to_uuid128@Base 4.43
+ sdp_uuid2strn@Base 4.43
+ sdp_uuid32_create@Base 4.43
+ sdp_uuid32_to_uuid128@Base 4.43
+ sdp_uuid_cmp@Base 4.43
+ sdp_uuid_extract@Base 4.43
+ sdp_uuid_to_proto@Base 4.43
+ sdp_uuid_to_uuid128@Base 4.43
+ str2ba@Base 4.43
+ strtoba@Base 4.43
--- bluez-4.66.orig/debian/libbluetooth-dev.install
+++ bluez-4.66/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.66.orig/debian/bluez.preinst
+++ bluez-4.66/debian/bluez.preinst
@@ -0,0 +1,62 @@
+#!/bin/sh -e
+
+# 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="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
+ 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 "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
+
+ # now that modprobe whines remove this old conffile, will be
+ # http://bugs.debian.org/523050
+ base="/etc/modprobe.d/bluez"
+ rm_conffile bluez "$base"
+ if [ -e "$base.dpkg-bak" ]; then
+ if [ -e "$base.conf" ]; then
+ echo "$base.conf exists, not touching"
+ else
+ echo "Moving $base.dpkg-bak to $base.conf"
+ mv -f "$base.dpkg-bak" "$base.conf"
+ fi
+ fi
+esac
+
+#DEBHELPER#
--- bluez-4.66.orig/debian/rules
+++ bluez-4.66/debian/rules
@@ -0,0 +1,79 @@
+#!/usr/bin/make -f
+# build rules for bluez
+
+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-netlink \
+ --enable-tools \
+ --enable-test \
+ --enable-bccmd \
+ --enable-hid2hci \
+ --enable-dfutool \
+ --enable-cups \
+ --enable-pcmcia \
+ --enable-debug \
+ --enable-hidd \
+ --enable-pand \
+ --enable-dund \
+ --enable-pnat \
+ --enable-tracer \
+ --enable-udevrules \
+ --enable-configfiles \
+ --enable-capng
+
+DEB_DESTDIR := $(CURDIR)/debian/tmp
+
+#install/bluetooth::
+ #install -D -m 0644 $(CURDIR)/debian/bluetooth.override $(CURDIR)/debian/bluetooth/usr/share/lintian/overrides/bluetooth
+
+install/bluez::
+ # conf files
+ 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 -D -m 0644 $(CURDIR)/serial/serial.conf $(CURDIR)/debian/bluez/etc/bluetooth/serial.conf
+
+ # udev rules, actually upstream version is changed with
+ # sed -i 's@RUN+="/usr/sbin/hid2hci@RUN+="/lib/udev/bluez@' scripts/bluetooth-hid2hci.rules
+ # and the diff is in debian/patches/010_udev_rules_agent.patch
+ install -D -m 0644 $(CURDIR)/scripts/bluetooth-hid2hci.rules $(CURDIR)/debian/bluez/lib/udev/rules.d/62-bluez-hid2hci.rules
+ install -D -m 0755 $(CURDIR)/debian/bluez_agent.udev $(CURDIR)/debian/bluez/lib/udev/bluez
+
+ # misc
+ install -D -m 0755 $(CURDIR)/test/agent $(CURDIR)/debian/bluez/usr/bin/bluetooth-agent
+ install -D -m 0644 $(CURDIR)/debian/README.examples $(CURDIR)/debian/bluez/usr/share/doc/bluez/examples/README
+
+#install/bluez-utils::
+ #install -D -m 0644 $(CURDIR)/debian/bluez-utils.override $(CURDIR)/debian/bluez-utils/usr/share/lintian/overrides/bluez-utils
+
+install/bluez-alsa::
+ install -D -m 0644 $(CURDIR)/audio/bluetooth.conf $(CURDIR)/debian/bluez-alsa/usr/share/alsa/bluetooth.conf
+
+install/bluez-pcmcia-support::
+ cp -f $(CURDIR)/scripts/bluetooth-serial.rules $(CURDIR)/debian/bluez-pcmcia-support.udev
+
+binary-install/bluez-compat::
+ for d in pand dund hidd; do \
+ mv -v $(CURDIR)/debian/bluez/usr/bin/$$d $(CURDIR)/debian/bluez-compat/usr/bin/;\
+ mv -v $(CURDIR)/debian/bluez/usr/share/man/man1/$$d* $(CURDIR)/debian/bluez-compat/usr/share/man/man1/;\
+ done
+
+binary-install/bluez-gstreamer::
+ LD_LIBRARY_PATH="$(CURDIR)/debian/tmp/usr/lib:$(LD_LIBRARY_PATH)" dh_gstscancodecs -pbluez-gstreamer
+
+binary-install/bluez::
+ install -D -m 0644 $(CURDIR)/debian/bluetooth-dbus.conf $(CURDIR)/debian/bluez/etc/dbus-1/system.d/bluetooth.conf
+
+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.66.orig/debian/l2test.1
+++ bluez-4.66/debian/l2test.1
@@ -0,0 +1,45 @@
+.TH BLUETOOTH-AGENT "1" "March 2010"
+.SH NAME
+l2test \- L2CAP testing
+.SH SYNOPSIS
+.B l2test
+.SH DESCRIPTION
+\fBl2test\fP is L2CAP testing program.
+
+.SH USAGE
+l2test <mode> [options] [bdaddr]
+Modes:
+\fB-r\fP listen and receive
+\fB-w\fP listen and send
+\fB-d\fP listen and dump incoming data
+\fB-x\fP listen, then send, then dump incoming data
+\fB-s\fP connect and send
+\fB-u\fP connect and receive
+\fB-n\fP connect and be silent
+\fB-y\fP connect, then send, then dump incoming data
+\fB-c\fP connect, disconnect, connect, \.\.\.
+\fB-m\fP multiple connects
+\fB-p\fP trigger dedicated bonding
+\fB-z\fP information request
+Options:
+[\fB-b\fP bytes] [\fB-i\fP device] [\fB-P\fP psm]
+[\fB-I\fP imtu] [\fB-O\fP omtu]
+[\fB-L\fP seconds] enable SO_LINGER
+[\fB-W\fP seconds] enable deferred setup
+[\fB-B\fP filename] use data packets from file
+[\fB-N\fP num] send num frames (default = infinite)
+[\fB-C\fP num] send num frames before delay (default = 1)
+[\fB-D\fP milliseconds] delay after sending num frames (default = 0)
+[\fB-X\fP mode] select retransmission/flow-control mode
+[\fB-F\fP fcs] use CRC16 check (default = 1)
+[\fB-R\fP] reliable mode
+[\fB-G\fP] use connectionless channel (datagram)
+[\fB-A\fP] request authentication
+[\fB-E\fP] request encryption
+[\fB-S\fP] secure connection
+[\fB-M\fP] become master
+[\fB-T\fP] enable timestamps
+
+.SH AUTHOR
+This manual page was written by Nobuhiro Iwamatsu <iwamatsu@debian.org>,
+for the Debian GNU/Linux system (but may be used by others).
--- bluez-4.66.orig/debian/bluetooth-dbus.conf
+++ bluez-4.66/debian/bluetooth-dbus.conf
@@ -0,0 +1,32 @@
+<!-- This configuration file specifies the required security policies
+ for Bluetooth core daemon to work. -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="org.bluez"/>
+ <allow send_destination="org.bluez"/>
+
+ <!-- allow root to send to agents -->
+ <allow send_interface="org.bluez.Agent"/>
+ </policy>
+
+ <!-- allow users at the console, see consolekit or libpam-foreground -->
+ <policy at_console="true">
+ <allow send_destination="org.bluez"/>
+ </policy>
+
+ <!-- allow users of bluetooth group to communicate with hcid -->
+ <policy group="bluetooth">
+ <allow send_destination="org.bluez"/>
+ </policy>
+
+ <policy context="default">
+ <deny send_destination="org.bluez"/>
+ </policy>
+
+</busconfig>
--- bluez-4.66.orig/debian/source.lintian-overrides
+++ bluez-4.66/debian/source.lintian-overrides
@@ -0,0 +1,5 @@
+# transitional packages
+bluez source: debhelper-but-no-misc-depends bluez-utils
+bluez source: debhelper-but-no-misc-depends bluez-audio
+# metapackage
+bluez source: debhelper-but-no-misc-depends bluetooth
--- bluez-4.66.orig/debian/bluetooth.lintian-overrides
+++ bluez-4.66/debian/bluetooth.lintian-overrides
@@ -0,0 +1,2 @@
+# package description looks fine, "Bluetooth stack utilities"
+bluetooth binary: description-starts-with-package-name
--- bluez-4.66.orig/debian/bluez-utils.lintian-overrides
+++ bluez-4.66/debian/bluez-utils.lintian-overrides
@@ -0,0 +1,2 @@
+# empty transitional postrm
+bluez-utils: maintainer-script-empty postrm
--- bluez-4.66.orig/debian/bluez-utils.postrm
+++ bluez-4.66/debian/bluez-utils.postrm
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+
+#Dummy transitional postrm script
+#Don't do anything.
+
+#DEBHELPER#
--- bluez-4.66.orig/debian/bluez.dirs
+++ bluez-4.66/debian/bluez.dirs
@@ -0,0 +1 @@
+usr/bin
--- bluez-4.66.orig/debian/bluez.postinst
+++ bluez-4.66/debian/bluez.postinst
@@ -0,0 +1,53 @@
+#!/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
+ 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 1>/dev/null 2>/dev/null
+ fi
+
+ # create bluetooth group if not already present
+ if ! getent group bluetooth > /dev/null; then
+ addgroup --quiet --system bluetooth
+ fi
+
+ # reload dbus config file
+ if [ -x /etc/init.d/dbus ]; then
+ invoke-rc.d dbus force-reload || true
+ fi
+
+ #reload udev rules
+ if [ -x /etc/init.d/udev ]; then
+ invoke-rc.d udev reload || true
+ fi
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+#DEBHELPER#
--- bluez-4.66.orig/debian/README.examples
+++ bluez-4.66/debian/README.examples
@@ -0,0 +1,2 @@
+These examples are from the test/ directory of bluez distribution, you'll need
+python-gobject and python-dbus to run some of them.
--- bluez-4.66.orig/debian/bluez.install
+++ bluez-4.66/debian/bluez.install
@@ -0,0 +1,7 @@
+debian/tmp/etc/bluetooth/main.conf
+debian/tmp/etc/bluetooth/rfcomm.conf
+debian/tmp/etc/dbus*/*
+debian/tmp/usr/sbin/*
+debian/tmp/usr/bin/*
+debian/tmp/usr/share/man/man*
+debian/tmp/usr/lib/bluetooth/plugins/*.so
--- bluez-4.66.orig/debian/source/format
+++ bluez-4.66/debian/source/format
@@ -0,0 +1 @@
+1.0
--- bluez-4.66.orig/debian/patches/0206_Fix-missing-error-check-to-dbus_message_get_args.patch
+++ bluez-4.66/debian/patches/0206_Fix-missing-error-check-to-dbus_message_get_args.patch
@@ -0,0 +1,31 @@
+From b2d85659223b628d17bb5f69e00d6f514761cba6 Mon Sep 17 00:00:00 2001
+From: Johan Hedberg <johan.hedberg@nokia.com>
+Date: Thu, 17 Jun 2010 21:31:32 +0300
+Subject: [PATCH 06/37] Fix missing error check to dbus_message_get_args
+
+---
+ audio/telephony-maemo6.c | 7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
+index 41950be..e8b75fd 100644
+--- a/audio/telephony-maemo6.c
++++ b/audio/telephony-maemo6.c
+@@ -1311,9 +1311,12 @@ static void hal_battery_level_reply(DBusPendingCall *call, void *user_data)
+ goto done;
+ }
+
+- dbus_message_get_args(reply, NULL,
++ if (!dbus_message_get_args(reply, NULL,
+ DBUS_TYPE_INT32, &level,
+- DBUS_TYPE_INVALID);
++ DBUS_TYPE_INVALID)) {
++ error("Unexpected args in hald reply");
++ goto done;
++ }
+
+ *value = (int) level;
+
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0204_Fix-memory-leak.patch
+++ bluez-4.66/debian/patches/0204_Fix-memory-leak.patch
@@ -0,0 +1,36 @@
+From b336e93a471f4ede121edaf822cd525c2ffc17a7 Mon Sep 17 00:00:00 2001
+From: Johan Hedberg <johan.hedberg@nokia.com>
+Date: Thu, 17 Jun 2010 09:40:56 +0300
+Subject: [PATCH 04/37] Fix memory leak
+
+---
+ audio/manager.c | 8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/audio/manager.c b/audio/manager.c
+index f6a98cd..5edfb18 100644
+--- a/audio/manager.c
++++ b/audio/manager.c
+@@ -351,12 +351,18 @@ static sdp_record_t *hfp_ag_record(uint8_t ch, uint32_t feat)
+ sdp_data_t *channel, *features;
+ uint8_t netid = 0x01;
+ uint16_t sdpfeat;
+- sdp_data_t *network = sdp_data_alloc(SDP_UINT8, &netid);
++ sdp_data_t *network;
+
+ record = sdp_record_alloc();
+ if (!record)
+ return NULL;
+
++ network = sdp_data_alloc(SDP_UINT8, &netid);
++ if (!network) {
++ sdp_record_free(record);
++ return NULL;
++ }
++
+ sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
+ root = sdp_list_append(0, &root_uuid);
+ sdp_set_browse_groups(record, root);
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0217_Fix-sending-authentication-reply-when-bonding-is-alr.patch
+++ bluez-4.66/debian/patches/0217_Fix-sending-authentication-reply-when-bonding-is-alr.patch
@@ -0,0 +1,36 @@
+From 4a4471e7e071fe8e8ae68d1b130dac6db9748fe2 Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
+Date: Mon, 28 Jun 2010 11:20:15 +0300
+Subject: [PATCH 17/37] Fix sending authentication reply when bonding is already completed
+
+It cause errors such:
+
+2010-06-28 11:12:39.683799 > HCI Event: Auth Complete (0x06) plen 3
+ status 0x05 handle 43
+ Error: Authentication Failure
+2010-06-28 11:12:39.699344 < HCI Command: User Confirmation Request
+ Negative Reply (0x01|0x002d) plen 6
+ bdaddr 00:25:56:D0:7F:63
+2010-06-28 11:12:39.705754 > HCI Event: Command Complete (0x0e) plen 10
+ User Confirmation Request Negative Reply (0x01|0x002d) ncmd 1
+ status 0x0c bdaddr 00:25:56:D0:7F:63
+ Error: Command Disallowed
+---
+ src/device.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/src/device.c b/src/device.c
+index 04332c6..ea0640e 100644
+--- a/src/device.c
++++ b/src/device.c
+@@ -2075,6 +2075,7 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
+ agent_cancel(auth->agent);
+
+ if (status) {
++ device_cancel_authentication(device, TRUE);
+ device_cancel_bonding(device, status);
+ return;
+ }
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0229_Fix-the-return-value-of-read_device_alias.patch
+++ bluez-4.66/debian/patches/0229_Fix-the-return-value-of-read_device_alias.patch
@@ -0,0 +1,27 @@
+From e4648f70c8228eac9854ed1a2c0dc398dfb777a4 Mon Sep 17 00:00:00 2001
+From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
+Date: Fri, 2 Jul 2010 13:09:07 -0300
+Subject: [PATCH 29/37] Fix the return value of read_device_alias
+
+To mantain consistency read_device_alias must return 0 on
+success, not the number of bytes written.
+---
+ src/storage.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/storage.c b/src/storage.c
+index 07c1ac2..e09e257 100644
+--- a/src/storage.c
++++ b/src/storage.c
+@@ -73,7 +73,7 @@ int read_device_alias(const char *src, const char *dst, char *alias, size_t size
+
+ free(tmp);
+
+- return err;
++ return err < 0 ? -EIO : 0;
+ }
+
+ int write_device_alias(const char *src, const char *dst, const char *alias)
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0218_Fix-use-of-errno-after-calling-some-function-that-co.patch
+++ bluez-4.66/debian/patches/0218_Fix-use-of-errno-after-calling-some-function-that-co.patch
@@ -0,0 +1,42 @@
+From 52248c856d1727f0e19fec757bf02508c03832da Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
+Date: Tue, 29 Jun 2010 15:26:22 +0300
+Subject: [PATCH 18/37] Fix use of errno after calling some function that could overwrite it
+
+---
+ src/device.c | 10 ++++++----
+ 1 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/device.c b/src/device.c
+index ea0640e..6af76d1 100644
+--- a/src/device.c
++++ b/src/device.c
+@@ -1891,8 +1891,9 @@ static int device_authentication_requested(struct btd_device *device,
+
+ dd = hci_open_dev(adapter_get_dev_id(device->adapter));
+ if (dd < 0) {
+- error("Unable to open adapter: %s(%d)", strerror(errno), errno);
+- return -errno;
++ int err = -errno;
++ error("Unable to open adapter: %s(%d)", strerror(-err), -err);
++ return err;
+ }
+
+ memset(&rp, 0, sizeof(rp));
+@@ -1910,10 +1911,11 @@ static int device_authentication_requested(struct btd_device *device,
+ rq.event = EVT_CMD_STATUS;
+
+ if (hci_send_req(dd, &rq, HCI_REQ_TIMEOUT) < 0) {
++ int err = -errno;
+ error("Unable to send HCI request: %s (%d)",
+- strerror(errno), errno);
++ strerror(-err), -err);
+ hci_close_dev(dd);
+- return -errno;
++ return err;
+ }
+
+ if (rp.status) {
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0209_Fix-unblock-removed-device.patch
+++ bluez-4.66/debian/patches/0209_Fix-unblock-removed-device.patch
@@ -0,0 +1,73 @@
+From e0eddab0745f605fba545d03e84ed13769d744c8 Mon Sep 17 00:00:00 2001
+From: Daniel Orstadius <daniel.orstadius@gmail.com>
+Date: Mon, 28 Jun 2010 13:45:37 +0300
+Subject: [PATCH 09/37] Fix unblock removed device
+
+Unblocks a device when removing it. Adds boolean argument to
+function device_unblock to only emit property changed signal and
+probe drivers when unblocking a device if the device is not
+unblocked as part of being removed.
+---
+ src/device.c | 17 ++++++++++++-----
+ 1 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/src/device.c b/src/device.c
+index 11b1fd2..73243c9 100644
+--- a/src/device.c
++++ b/src/device.c
+@@ -513,7 +513,8 @@ static int device_block(DBusConnection *conn, struct btd_device *device)
+ return 0;
+ }
+
+-static int device_unblock(DBusConnection *conn, struct btd_device *device)
++static int device_unblock(DBusConnection *conn, struct btd_device *device,
++ gboolean silent)
+ {
+ int dev_id, dd, err;
+ bdaddr_t src;
+@@ -543,10 +544,12 @@ static int device_unblock(DBusConnection *conn, struct btd_device *device)
+ if (err < 0)
+ error("write_blocked(): %s (%d)", strerror(-err), -err);
+
+- emit_property_changed(conn, device->path, DEVICE_INTERFACE, "Blocked",
++ if (!silent) {
++ emit_property_changed(conn, device->path,
++ DEVICE_INTERFACE, "Blocked",
+ DBUS_TYPE_BOOLEAN, &device->blocked);
+-
+- device_probe_drivers(device, device->uuids);
++ device_probe_drivers(device, device->uuids);
++ }
+
+ return 0;
+ }
+@@ -560,7 +563,7 @@ static DBusMessage *set_blocked(DBusConnection *conn, DBusMessage *msg,
+ if (value)
+ err = device_block(conn, device);
+ else
+- err = device_unblock(conn, device);
++ err = device_unblock(conn, device, FALSE);
+
+ switch (-err) {
+ case 0:
+@@ -1100,6 +1103,7 @@ static void device_remove_stored(struct btd_device *device)
+ {
+ bdaddr_t src;
+ char addr[18];
++ DBusConnection *conn = get_dbus_connection();
+
+ adapter_get_address(device->adapter, &src);
+ ba2str(&device->bdaddr, addr);
+@@ -1109,6 +1113,9 @@ static void device_remove_stored(struct btd_device *device)
+ delete_entry(&src, "profiles", addr);
+ delete_entry(&src, "trusts", addr);
+ delete_all_records(&src, &device->bdaddr);
++
++ if (device->blocked)
++ device_unblock(conn, device, TRUE);
+ }
+
+ void device_remove(struct btd_device *device, gboolean remove_stored)
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/01_lower_sink_ranking.patch
+++ bluez-4.66/debian/patches/01_lower_sink_ranking.patch
@@ -0,0 +1,13 @@
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571595
+diff --git a/audio/gsta2dpsink.c b/audio/gsta2dpsink.c
+index 52b65e5..89794fb 100644
+--- a/audio/gsta2dpsink.c
++++ b/audio/gsta2dpsink.c
+@@ -697,6 +697,6 @@ static void gst_a2dp_sink_init(GstA2dpSink *self,
+ gboolean gst_a2dp_sink_plugin_init(GstPlugin *plugin)
+ {
+ return gst_element_register(plugin, "a2dpsink",
+- GST_RANK_MARGINAL, GST_TYPE_A2DP_SINK);
++ GST_RANK_MARGINAL-1, GST_TYPE_A2DP_SINK);
+ }
+
--- bluez-4.66.orig/debian/patches/0215_Fix-not-cancelling-authentication-when-bonding-fails.patch
+++ bluez-4.66/debian/patches/0215_Fix-not-cancelling-authentication-when-bonding-fails.patch
@@ -0,0 +1,189 @@
+From 8b78d14dd4ac9776f5848dee94ce2fcf976fd6d8 Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
+Date: Mon, 28 Jun 2010 14:01:05 +0300
+Subject: [PATCH 15/37] Fix not cancelling authentication when bonding fails
+
+---
+ src/dbus-hci.h | 2 -
+ src/device.c | 101 +++++++++++++++++++++++++-------------------------------
+ 2 files changed, 45 insertions(+), 58 deletions(-)
+
+diff --git a/src/dbus-hci.h b/src/dbus-hci.h
+index a29dd53..44cd5e5 100644
+--- a/src/dbus-hci.h
++++ b/src/dbus-hci.h
+@@ -50,8 +50,6 @@ gboolean get_adapter_and_device(bdaddr_t *src, bdaddr_t *dst,
+ struct btd_device **device,
+ gboolean create);
+
+-DBusMessage *new_authentication_return(DBusMessage *msg, uint8_t status);
+-
+ const char *class_to_icon(uint32_t class);
+
+ void set_dbus_connection(DBusConnection *conn);
+diff --git a/src/device.c b/src/device.c
+index d4ff131..781b6e2 100644
+--- a/src/device.c
++++ b/src/device.c
+@@ -157,14 +157,6 @@ static uint16_t uuid_list[] = {
+
+ static GSList *device_drivers = NULL;
+
+-static DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn,
+- DBusMessage *msg, int err)
+-{
+- return error_common_reply(conn, msg,
+- ERROR_INTERFACE ".ConnectionAttemptFailed",
+- err > 0 ? strerror(err) : "Connection attempt failed");
+-}
+-
+ static DBusHandlerResult error_failed(DBusConnection *conn,
+ DBusMessage *msg, const char * desc)
+ {
+@@ -1744,7 +1736,7 @@ static gboolean start_discovery(gpointer user_data)
+ return FALSE;
+ }
+
+-DBusMessage *new_authentication_return(DBusMessage *msg, uint8_t status)
++static DBusMessage *new_authentication_return(DBusMessage *msg, int status)
+ {
+ switch (status) {
+ case 0x00: /* success */
+@@ -1902,59 +1894,25 @@ static gboolean bonding_io_cb(GIOChannel *io, GIOCondition cond,
+ gpointer user_data)
+ {
+ struct btd_device *device = user_data;
+- DBusMessage *reply;
+-
+- if (!device->bonding)
+- return FALSE;
+
+- reply = new_authentication_return(device->bonding->msg,
+- HCI_CONNECTION_TERMINATED);
+- g_dbus_send_message(device->bonding->conn, reply);
+-
+- bonding_request_free(device->bonding);
++ device->bonding->io_id = 0;
++ device_cancel_bonding(device, HCI_CONNECTION_TERMINATED);
+
+ return FALSE;
+ }
+
+-static void bonding_connect_cb(GIOChannel *io, GError *err, gpointer user_data)
++static int device_authentication_requested(struct btd_device *device,
++ int handle)
+ {
+- struct btd_device *device = user_data;
+ struct hci_request rq;
+ auth_requested_cp cp;
+ evt_cmd_status rp;
+ int dd;
+- uint16_t handle;
+-
+- if (!device->bonding) {
+- if (!err)
+- g_io_channel_shutdown(io, TRUE, NULL);
+- return;
+- }
+-
+- if (err) {
+- error("%s", err->message);
+- error_connection_attempt_failed(device->bonding->conn,
+- device->bonding->msg,
+- ENETDOWN);
+- goto cleanup;
+- }
+-
+- if (!bt_io_get(io, BT_IO_L2RAW, &err,
+- BT_IO_OPT_HANDLE, &handle,
+- BT_IO_OPT_INVALID)) {
+- error("Unable to get connection handle: %s", err->message);
+- error_connection_attempt_failed(device->bonding->conn,
+- device->bonding->msg,
+- ENETDOWN);
+- g_error_free(err);
+- goto failed;
+- }
+
+ dd = hci_open_dev(adapter_get_dev_id(device->adapter));
+ if (dd < 0) {
+- DBusMessage *reply = no_such_adapter(device->bonding->msg);
+- g_dbus_send_message(device->bonding->conn, reply);
+- goto failed;
++ error("Unable to open adapter: %s(%d)", strerror(errno), errno);
++ return -errno;
+ }
+
+ memset(&rp, 0, sizeof(rp));
+@@ -1974,22 +1932,53 @@ static void bonding_connect_cb(GIOChannel *io, GError *err, gpointer user_data)
+ if (hci_send_req(dd, &rq, HCI_REQ_TIMEOUT) < 0) {
+ error("Unable to send HCI request: %s (%d)",
+ strerror(errno), errno);
+- error_failed_errno(device->bonding->conn, device->bonding->msg,
+- errno);
+ hci_close_dev(dd);
+- goto failed;
++ return -errno;
+ }
+
+ if (rp.status) {
+ error("HCI_Authentication_Requested failed with status 0x%02x",
+ rp.status);
+- error_failed_errno(device->bonding->conn, device->bonding->msg,
+- bt_error(rp.status));
+ hci_close_dev(dd);
+- goto failed;
++ return rp.status;
+ }
+
++ info("Authentication requested");
++
+ hci_close_dev(dd);
++ return 0;
++}
++
++static void bonding_connect_cb(GIOChannel *io, GError *err, gpointer user_data)
++{
++ struct btd_device *device = user_data;
++ uint16_t handle;
++ int status;
++
++ if (!device->bonding) {
++ if (!err)
++ g_io_channel_shutdown(io, TRUE, NULL);
++ return;
++ }
++
++ if (err) {
++ error("Unable to connect: %s", err->message);
++ status = HCI_CONNECTION_TERMINATED;
++ goto cleanup;
++ }
++
++ if (!bt_io_get(io, BT_IO_L2RAW, &err,
++ BT_IO_OPT_HANDLE, &handle,
++ BT_IO_OPT_INVALID)) {
++ error("Unable to get connection handle: %s", err->message);
++ g_error_free(err);
++ status = -errno;
++ goto failed;
++ }
++
++ status = device_authentication_requested(device, handle);
++ if (status != 0)
++ goto failed;
+
+ device->bonding->io_id = g_io_add_watch(io,
+ G_IO_NVAL | G_IO_HUP | G_IO_ERR,
+@@ -2002,7 +1991,7 @@ failed:
+
+ cleanup:
+ device->bonding->io_id = 0;
+- bonding_request_free(device->bonding);
++ device_cancel_bonding(device, status);
+ }
+
+ static void create_bond_req_exit(DBusConnection *conn, void *user_data)
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0227_core-fix-emitting-pairable-when-there-could-still-oc.patch
+++ bluez-4.66/debian/patches/0227_core-fix-emitting-pairable-when-there-could-still-oc.patch
@@ -0,0 +1,57 @@
+From b5d5bf263f4034ed9e7d40500ad8815b8e45cc8c Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
+Date: Wed, 30 Jun 2010 18:22:35 +0300
+Subject: [PATCH 27/37] core: fix emitting pairable when there could still occur an error
+
+An error could be generate by set_mode which then will make application
+to assume that we were unable to change the property, which wasn't the
+case.
+---
+ src/adapter.c | 24 +++++++++++++-----------
+ 1 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index 5d90b46..d1fae55 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -521,6 +521,19 @@ static DBusMessage *set_pairable(DBusConnection *conn, DBusMessage *msg,
+ if (pairable == adapter->pairable)
+ goto done;
+
++ if (!(adapter->scan_mode & SCAN_INQUIRY))
++ goto store;
++
++ mode = (pairable && adapter->discov_timeout > 0 &&
++ adapter->discov_timeout <= 60) ?
++ MODE_LIMITED : MODE_DISCOVERABLE;
++
++ err = set_mode(adapter, mode);
++ if (err < 0 && msg)
++ return failed_strerror(msg, -err);
++
++store:
++
+ adapter->pairable = pairable;
+
+ write_device_pairable(&adapter->bdaddr, pairable);
+@@ -533,17 +546,6 @@ static DBusMessage *set_pairable(DBusConnection *conn, DBusMessage *msg,
+ adapter_set_pairable_timeout(adapter,
+ adapter->pairable_timeout);
+
+- if (!(adapter->scan_mode & SCAN_INQUIRY))
+- goto done;
+-
+- mode = (pairable && adapter->discov_timeout > 0 &&
+- adapter->discov_timeout <= 60) ?
+- MODE_LIMITED : MODE_DISCOVERABLE;
+-
+- err = set_mode(adapter, mode);
+- if (err < 0 && msg)
+- return failed_strerror(msg, -err);
+-
+ done:
+ return msg ? dbus_message_new_method_return(msg) : NULL;
+ }
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0214_Fix-possible-memory-leaks-on-ofono-driver.patch
+++ bluez-4.66/debian/patches/0214_Fix-possible-memory-leaks-on-ofono-driver.patch
@@ -0,0 +1,30 @@
+From 2a6500b516bb7c864f810cb4bba7584bf24a246a Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
+Date: Tue, 8 Jun 2010 11:20:15 +0300
+Subject: [PATCH 14/37] Fix possible memory leaks on ofono driver
+
+---
+ audio/telephony-ofono.c | 7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/audio/telephony-ofono.c b/audio/telephony-ofono.c
+index e710ce8..9c20112 100644
+--- a/audio/telephony-ofono.c
++++ b/audio/telephony-ofono.c
+@@ -598,8 +598,11 @@ static void list_modem_reply(DBusPendingCall *call, void *user_data)
+
+ dbus_message_iter_get_basic(&sub, &modem_obj_path_local);
+ modem_obj_path = g_strdup(modem_obj_path_local);
+- DBG("modem_obj_path is %p, %s\n", modem_obj_path,
+- modem_obj_path);
++ if (modem_obj_path != NULL) {
++ DBG("modem_obj_path is %p, %s\n", modem_obj_path,
++ modem_obj_path);
++ break;
++ }
+ dbus_message_iter_next(&sub);
+ }
+
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0208_Fix-sdp_get_supp_feat-function.patch
+++ bluez-4.66/debian/patches/0208_Fix-sdp_get_supp_feat-function.patch
@@ -0,0 +1,53 @@
+From 15b2bfd69b42c2b6a37916a7067a429491a0da95 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Elvis=20Pf=C3=BCtzenreuter?= <epx@signove.com>
+Date: Wed, 16 Jun 2010 13:30:48 -0300
+Subject: [PATCH 08/37] Fix sdp_get_supp_feat function
+
+In case of string data items, value is a pointer by itself.
+---
+ lib/sdp.c | 25 ++++++++++++++++++++++---
+ 1 files changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/lib/sdp.c b/lib/sdp.c
+index 79f4ae5..17745ac 100644
+--- a/lib/sdp.c
++++ b/lib/sdp.c
+@@ -4769,13 +4769,32 @@ int sdp_get_supp_feat(const sdp_record_t *rec, sdp_list_t **seqp)
+
+ if (d->dtd < SDP_SEQ8 || d->dtd > SDP_SEQ32)
+ goto fail;
++
+ subseq = NULL;
++
+ for (dd = d->val.dataseq; dd; dd = dd->next) {
+ sdp_data_t *data;
+- if (dd->dtd != SDP_UINT8 && dd->dtd != SDP_UINT16 &&
+- dd->dtd != SDP_TEXT_STR8)
++ void *val;
++ int length;
++
++ switch (dd->dtd) {
++ case SDP_URL_STR8:
++ case SDP_URL_STR16:
++ case SDP_TEXT_STR8:
++ case SDP_TEXT_STR16:
++ val = dd->val.str;
++ length = dd->unitSize - sizeof(uint8_t);
++ break;
++ case SDP_UINT8:
++ case SDP_UINT16:
++ val = &dd->val;
++ length = 0;
++ break;
++ default:
+ goto fail;
+- data = sdp_data_alloc(dd->dtd, &dd->val);
++ }
++
++ data = sdp_data_alloc_with_length(dd->dtd, val, length);
+ if (data)
+ subseq = sdp_list_append(subseq, data);
+ }
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0213_Fix-not-freeing-memory-on-driver-exit.patch
+++ bluez-4.66/debian/patches/0213_Fix-not-freeing-memory-on-driver-exit.patch
@@ -0,0 +1,29 @@
+From ef1e62baec7833bd4a53720d1ee2bdcd91e6a705 Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
+Date: Tue, 8 Jun 2010 10:48:24 +0300
+Subject: [PATCH 13/37] Fix not freeing memory on driver exit
+
+---
+ audio/telephony-maemo6.c | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
+index e8b75fd..31704c3 100644
+--- a/audio/telephony-maemo6.c
++++ b/audio/telephony-maemo6.c
+@@ -1981,6 +1981,12 @@ int telephony_init(void)
+
+ void telephony_exit(void)
+ {
++ g_free(net.operator_name);
++ net.operator_name = NULL;
++
++ g_free(last_dialed_number);
++ last_dialed_number = NULL;
++
+ g_slist_foreach(calls, (GFunc) csd_call_free, NULL);
+ g_slist_free(calls);
+ calls = NULL;
+--
+1.7.2.3
+
--- bluez-4.66.orig/debian/patches/0207_Fix-attempt-to-use-a-potential-negative-array-index.patch
+++ bluez-4.66/debian/patches/0207_Fix-attempt-to-use-a-potential-negative-array-index.patch
@@ -0,0 +1,41 @@
+From 2e0d7c44ff32150c209cf7066dbeb34e464090e5 Mon Sep 17 00:00:00 2001
+From: Johan Hedberg <johan.hedberg@nokia.com>
+Date: Thu, 17 Jun 2010 23:20:33 +0300
+Subject: [PATCH 07/37] Fix attempt to use a potential negative array index
+
+---
+ src/security.c | 7 ++++---
+ 1 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/security.c b/src/security.c
+index e8c463c..ca394e1 100644
+--- a/src/security.c
++++ b/src/security.c
+@@ -377,11 +377,14 @@ static void link_key_notify(int dev, bdaddr_t *sba, void *ptr)
+ dev_id = hci_devid(sa);
+ if (dev_id < 0)
+ err = -errno;
+- else
++ else {
+ err = hcid_dbus_link_key_notify(sba, dba, evt->link_key,
+ evt->key_type,
+ io_data[dev_id].pin_length,
+ old_key_type);
++ io_data[dev_id].pin_length = -1;
++ }
++
+ if (err < 0) {
+ uint16_t handle;
+
+@@ -403,8 +406,6 @@ static void link_key_notify(int dev, bdaddr_t *sba, void *ptr)
+ DISCONNECT_CP_SIZE, &cp);
+ }
+ }
+-
+- io_data[dev_id].pin_length = -1;
+ }
+
+ static void return_link_keys(int dev, bdaddr_t *sba, void *ptr)
+--
+1.7.2.3
+