diff options
Diffstat (limited to '')
24 files changed, 507 insertions, 569 deletions
diff --git a/source/n/bluez-libs/bluez-libs.SlackBuild b/source/a/cpufrequtils/cpufrequtils.SlackBuild index e25d346d7..329ab4d3d 100755 --- a/source/n/bluez-libs/bluez-libs.SlackBuild +++ b/source/a/cpufrequtils/cpufrequtils.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2006, 2007, 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2010 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -21,12 +21,19 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -PKGNAM=bluez-libs -VERSION=${VERSION:-3.36} -ARCH=${ARCH:-x86_64} -NUMJOBS=${NUMJOBS:-" -j7 "} -BUILD=${BUILD:-2} +PKGNAM=cpufrequtils +VERSION=${VERSION:-$(echo $(basename $(echo $PKGNAM-*.tar.bz2 | cut -f 2 -d -) .tar.bz2) | cut -f 2 -d -)} +BUILD=${BUILD:-1} +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi CWD=$(pwd) TMP=${TMP:-/tmp} @@ -43,6 +50,9 @@ elif [ "$ARCH" = "s390" ]; then elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi cd $TMP @@ -58,19 +68,12 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# Configure: -CFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --mandir=/usr/man \ - --disable-static \ - --build=$ARCH-slackware-linux - # Build and install: -make $NUMJOBS || make || exit 1 -make install DESTDIR=$PKG || exit 1 +make libdir=/usr/lib${LIBDIRSUFFIX} +make install libdir=/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG + +# Don't ship these: +rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.{a,la} # Strip binaries: find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ @@ -85,28 +88,19 @@ if [ -d $PKG/usr/man ]; then ln -s $( readlink $eachpage ).gz $eachpage.gz rm $eachpage done - gzip -9 *.* + gzip -9 *.? ) done ) fi -# Compress info files, if any: -if [ -d $PKG/usr/info ]; then - ( cd $PKG/usr/info - rm -f dir - gzip -9 * - ) -fi - # Add a documentation directory: mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION cp -a \ - AUTHORS COPYING ChangeLog INSTALL NEWS README \ + AUTHORS COPYING* README* \ $PKG/usr/doc/${PKGNAM}-$VERSION mkdir -p $PKG/install -#zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG diff --git a/source/n/bluez-utils/slack-desc b/source/kde/polkit-kde-1/slack-desc index 159f02466..8e0a3ad64 100644 --- a/source/n/bluez-utils/slack-desc +++ b/source/kde/polkit-kde-1/slack-desc @@ -5,15 +5,14 @@ # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. - |-----handy-ruler------------------------------------------------------| -bluez-utils: bluez-utils (Utilities for working with Bluetooth(TM)) -bluez-utils: -bluez-utils: The bluez-utils package contains utilities for supporting -bluez-utils: Bluetooth(TM) on Linux. -bluez-utils: -bluez-utils: For more info, visit: http://www.bluez.org -bluez-utils: -bluez-utils: -bluez-utils: -bluez-utils: -bluez-utils: + |-----handy-ruler-----------------------------------------------------| +polkit-kde-1: polkit-kde-1 (KDE polkit authenticator) +polkit-kde-1: +polkit-kde-1: This is a polkit authenticator for KDE. +polkit-kde-1: +polkit-kde-1: +polkit-kde-1: +polkit-kde-1: +polkit-kde-1: +polkit-kde-1: +polkit-kde-1: diff --git a/source/n/bluez-libs/slack-desc b/source/l/ConsoleKit/slack-desc index f9a57e285..63326799d 100644 --- a/source/n/bluez-libs/slack-desc +++ b/source/l/ConsoleKit/slack-desc @@ -5,15 +5,15 @@ # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. - |-----handy-ruler------------------------------------------------------| -bluez-libs: bluez-libs (Bluetooth(TM) wireless libraries) -bluez-libs: -bluez-libs: The bluez-libs package contains an implementation of the Bluetooth(TM) -bluez-libs: wireless standards specifications for Linux. -bluez-libs: -bluez-libs: For more info, visit: http://www.bluez.org -bluez-libs: -bluez-libs: -bluez-libs: -bluez-libs: -bluez-libs: + |-----handy-ruler-----------------------------------------------------| +ConsoleKit: ConsoleKit (user, login, and seat tracking framework) +ConsoleKit: +ConsoleKit: ConsoleKit is a framework for defining and tracking users, login +ConsoleKit: sessions, and seats. +ConsoleKit: +ConsoleKit: +ConsoleKit: +ConsoleKit: +ConsoleKit: +ConsoleKit: Homepage: http://freedesktop.org/wiki/Software/ConsoleKit +ConsoleKit: diff --git a/source/n/bluez-hcidump/bluez-hcidump.SlackBuild b/source/n/bluez-hcidump/bluez-hcidump.SlackBuild index 0bef3fb99..ac2a8442c 100755 --- a/source/n/bluez-hcidump/bluez-hcidump.SlackBuild +++ b/source/n/bluez-hcidump/bluez-hcidump.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2006, 2007, 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2006-2010 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,17 +23,32 @@ PKGNAM=bluez-hcidump VERSION=${VERSION:-1.42} -ARCH=${ARCH:-x86_64} +BUILD=${BUILD:-3} + NUMJOBS=${NUMJOBS:-" -j7 "} -BUILD=${BUILD:-2} +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" + LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi CWD=$(pwd) @@ -55,6 +70,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Patch to build with bluez+>4.61 +zcat $CWD/hci.c_for_bluez-4.61.patch.gz | patch -p1 || exit 1 + # Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ @@ -98,9 +116,17 @@ fi # Add a documentation directory: mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION cp -a \ - AUTHORS COPYING ChangeLog INSTALL NEWS README \ + AUTHORS COPYING* INSTALL NEWS README* \ $PKG/usr/doc/${PKGNAM}-$VERSION +# If there's a ChangeLog, installing at least part of the recent history +# is useful, but don't let it get totally out of control: +if [ -r ChangeLog ]; then + DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION) + cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog + touch -r ChangeLog $DOCSDIR/ChangeLog +fi + mkdir -p $PKG/install #zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/source/n/bluez-hcidump/hci.c_for_bluez-4.61.patch b/source/n/bluez-hcidump/hci.c_for_bluez-4.61.patch new file mode 100644 index 000000000..bcd6b4a0a --- /dev/null +++ b/source/n/bluez-hcidump/hci.c_for_bluez-4.61.patch @@ -0,0 +1,21 @@ +diff -Nur bluez-hcidump-1.42.orig//parser/hci.c bluez-hcidump-1.42/parser/hci.c +--- bluez-hcidump-1.42.orig//parser/hci.c 2008-06-15 07:46:13.000000000 -0500 ++++ bluez-hcidump-1.42/parser/hci.c 2010-03-02 23:15:35.171713301 -0600 +@@ -1973,7 +1973,7 @@ + + static inline void read_inquiry_transmit_power_level_dump(int level, struct frame *frm) + { +- read_inquiry_transmit_power_level_rp *rp = frm->ptr; ++ read_inq_response_tx_power_level_rp *rp = frm->ptr; + + p_indent(level, frm); + printf("status 0x%2.2x level %d\n", rp->status, rp->level); +@@ -2325,7 +2325,7 @@ + case OCF_READ_EXT_INQUIRY_RESPONSE: + read_ext_inquiry_response_dump(level, frm); + return; +- case OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL: ++ case OCF_READ_INQ_RESPONSE_TX_POWER_LEVEL: + read_inquiry_transmit_power_level_dump(level, frm); + return; + case OCF_READ_DEFAULT_ERROR_DATA_REPORTING: diff --git a/source/n/bluez-hcidump/slack-desc b/source/n/bluez-hcidump/slack-desc index e4c8205c2..591118373 100644 --- a/source/n/bluez-hcidump/slack-desc +++ b/source/n/bluez-hcidump/slack-desc @@ -6,10 +6,10 @@ # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| -bluez-hcidump: bluez-hcidump (Linux Bluetooth(TM) analyzer) +bluez-hcidump: bluez-hcidump (Bluetooth analyzer) bluez-hcidump: -bluez-hcidump: The bluez-hcidump package contains a network analyzer for -bluez-hcidump: Bluetooth(TM). The hcidump utility reads raw HCI data coming from and +bluez-hcidump: The bluez-hcidump package contains a network analyzer for Bluetooth. +bluez-hcidump: This utility (hcidump) utility reads raw HCI data coming from and bluez-hcidump: going to a Bluetooth device and prints commands, events and data. bluez-hcidump: bluez-hcidump: For more info, visit: http://www.bluez.org diff --git a/source/n/bluez-utils/60-bluetooth.rules b/source/n/bluez-utils/60-bluetooth.rules deleted file mode 100644 index 0957225fd..000000000 --- a/source/n/bluez-utils/60-bluetooth.rules +++ /dev/null @@ -1,35 +0,0 @@ -# Brain Boxes BL-620 Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Brain Boxes", SYSFS{prod_id2}=="Bluetooth PC Card", ENV{HCIOPTS}="bboxes", RUN+="bluetooth_serial" - -# Xircom CreditCard Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", ENV{HCIOPTS}="xircom", RUN+="bluetooth_serial" - -# Xircom RealPort2 Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", ENV{HCIOPTS}="xircom", RUN+="bluetooth_serial" - -# IBM Bluetooth PC Card II -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="IBM", SYSFS{prod_id2}=="Bluetooth PC Card II", ENV{HCIOPTS}="tdk", RUN+="bluetooth_serial" - -# TDK Bluetooth PC Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="TDK", SYSFS{prod_id2}=="Bluetooth PC Card II", ENV{HCIOPTS}="tdk", RUN+="bluetooth_serial" - -# AmbiCom BT2000C Bluetooth PC/CF Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="AmbiCom BT2000C", SYSFS{prod_id2}=="Bluetooth PC/CF Card", ENV{HCIOPTS}="bt2000c", RUN+="bluetooth_serial" - -# COM One Platinium Bluetooth PC Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="COM1 SA", SYSFS{prod_id2}=="MC310 CARD", ENV{HCIOPTS}="comone", RUN+="bluetooth_serial" - -# Sphinx PICO Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="SPHINX", SYSFS{prod_id2}=="BT-CARD", ENV{HCIOPTS}="picocard", RUN+="bluetooth_serial" - -# H-Soft blue+Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="H-Soft", SYSFS{prod_id2}=="Blue+CARD", ENV{HCIOPTS}="$sysfs{manf_id},$sysfs{card_id}", RUN+="bluetooth_serial" - -# Compaq iPAQ Bluetooth Sleeve, Belkin F8T020, any other muppet who used an OXCF950 and didn't bother to program it appropriately. -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="CF CARD", SYSFS{prod_id2}=="GENERIC", ENV{HCIOPTS}="$sysfs{manf_id},$sysfs{card_id}", RUN+="bluetooth_serial" - -# Zoom Bluetooth Card and Sitecom CN-504 Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="PCMCIA", SYSFS{prod_id2}=="Bluetooth Card", ENV{HCIOPTS}="zoom", RUN+="bluetooth_serial" - -# CC&C BT0100M -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Bluetooth BT0100M", ENV{HCIOPTS}="bcsp 115200", RUN+="bluetooth_serial" diff --git a/source/n/bluez-utils/README.SLACKWARE b/source/n/bluez-utils/README.SLACKWARE deleted file mode 100644 index 795c8c5a2..000000000 --- a/source/n/bluez-utils/README.SLACKWARE +++ /dev/null @@ -1,18 +0,0 @@ -PIN (or passkey) management ---------------------------- -since bluez 3.0 the old pin_helper script has been replaced by -the dbus interface. To add a default passkey for every outgoing -request (e.g. the old /etc/bluetooth/pin file) drop it into -/etc/bluetooth/passkeys/default. (e.g. echo -n "1234" > -/etc/bluetooth/passkeys/default ) -To add a passkey for a specific outgoing connection replace default -with the device's address. ( /etc/bluetooth/passkeys/aa:bb:cc:dd:ee:ff -will contain passkey for aa:bb:cc:dd:ee:ff ). -After adding a passkey you should restart bluetooth with - -/etc/init.d/bluetooth restart - -and the new passkeys will be registered. - - -(This behaviour has been copied from Debian) diff --git a/source/n/bluez-utils/bluetooth.conf b/source/n/bluez-utils/bluetooth.conf deleted file mode 100644 index c0476237a..000000000 --- a/source/n/bluez-utils/bluetooth.conf +++ /dev/null @@ -1,24 +0,0 @@ -<!-- 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 send_interface="org.bluez.Agent"/> - </policy> - - <policy at_console="true"> - <allow send_destination="org.bluez"/> - </policy> - - <policy context="default"> - <deny send_destination="org.bluez"/> - </policy> - -</busconfig> diff --git a/source/n/bluez-utils/bluez-utils.SlackBuild b/source/n/bluez-utils/bluez-utils.SlackBuild deleted file mode 100755 index 7f8b95746..000000000 --- a/source/n/bluez-utils/bluez-utils.SlackBuild +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/sh -# -# SlackBuild for bluez-utils -# http://www.bluez.org -# By SukkoPera <enjoy.the.silence@iol.it> -# Thanks a lot to CAT for his Slackware package cration -# guide (http://www.slacky.it/misto/tutorial/spunleashed.txt) -# -# Check out -# - http://www.sukkopera.tk -# - http://www.slacky.it -# - http://www.nyft.org -# -# Notes: -# - Many files and the whole PIN management system have been stolen from the -# Debian package. Thanks. -# -# Rewritten for Slackware 2007-05 <pjv> - -NAME=bluez-utils -VERSION=${VERSION:-3.36} -ARCH=${ARCH:-x86_64} -NUMJOBS=${NUMJOBS:-" -j7 "} -BUILD=${BUILD:-7} - - -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "s390" ]; then - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" -fi - -CWD=$(pwd) -TMP=${TMP:-/tmp} -PKG=$TMP/package-$NAME - -rm -rf $PKG -mkdir -p $TMP $PKG -mkdir -p $PKG/etc/rc.d \ - $PKG/etc/bluetooth/passkeys \ - $PKG/usr/lib${LIBDIRSUFFIX}/bluetooth -# Is there any reason for a non-root user to be able to see these? -chmod 700 $PKG/etc/bluetooth/passkeys -cd $TMP -rm -rf $NAME-$VERSION -tar xvf $CWD/${NAME}-${VERSION}.tar.bz2 || exit 1 -cd $NAME-$VERSION - -chown -R root:root . -find . \ - \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; - -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --mandir=/usr/man \ - --localstatedir=/var \ - --enable-tools\ - --enable-bccmd \ - --enable-hid2hci \ - --enable-dfutool \ - --enable-hidd \ - --enable-pand \ - --enable-dund \ - --enable-cups \ - --enable-manpages \ - --enable-configfiles \ - --build=$ARCH-slackware-linux - -make $NUMJOBS || make || exit 1 -make install DESTDIR=$PKG - -mkdir -p $PKG/lib/udev -cp -a scripts/bluetooth_serial $PKG/lib/udev/bluetooth_serial || exit 1 -chmod 755 $PKG/lib/udev/bluetooth_serial - -mkdir -p $PKG/lib/udev/rules.d -cp -a scripts/bluetooth.rules $PKG/lib/udev/rules.d/60-bluetooth.rules || exit 1 -chmod 644 $PKG/lib/udev/rules.d/60-bluetooth.rules - -# This appears to be gone/obsolete: -#if [ ! -e $PKG/etc/bluetooth/transfer.service ]; then -# cat transfer/transfer.service > $PKG/etc/bluetooth/transfer.service -#fi -#if [ ! -e $PKG/usr/lib${LIBDIRSUFFIX}/bluetooth/bluetoothd-service-transfer -a -e transfer/bluetoothd-service-transfer ]; then -# cat transfer/bluetoothd-service-transfer > $PKG/usr/lib${LIBDIRSUFFIX}/bluetooth/bluetoothd-service-transfer -# chmod 755 $PKG/usr/lib${LIBDIRSUFFIX}/bluetooth/bluetoothd-service-transfer -#fi - -# Install Debian's add-passkey program: -DEBDEST=/usr/lib${LIBDIRSUFFIX}/bluetooth -gcc $(pkg-config --libs --cflags dbus-1) -DDBUS_API_SUBJECT_TO_CHANGE \ - $CWD/add-passkey.c -o $PKG/$DEBDEST/add-passkey || exit 1 -cp $CWD/register-passkeys $PKG/$DEBDEST -if [ "$ARCH" = "x86_64" ]; then - sed -i "s,/usr/lib/,/usr/lib${LIBDIRSUFFIX}/,g" $PKG/$DEBDEST/register-passkeys -fi -chmod a+x $PKG/$DEBDEST/* - -# Default PIN (wow, does this seem insecure!) -#echo "1234" > $PKG/etc/bluetooth/passkeys/default -touch $PKG/etc/bluetooth/passkeys/default - -mkdir -p $PKG/usr/doc/$NAME-$VERSION -cp -a \ - AUTHORS ChangeLog COPYING* INSTALL NEWS README $CWD/README.SLACKWARE \ - $PKG/usr/doc/$NAME-$VERSION -( cd $PKG/etc/bluetooth - ln -sf /usr/doc/$NAME-$VERSION/README.SLACKWARE . -) - -# Arrange init scripts and config files: -CONF=/etc/rc.d/rc.bluetooth.conf -mkdir -p $PKG/etc/rc.d -cp $CWD/rc.bluetooth $PKG/etc/rc.d/rc.bluetooth -if [ "$ARCH" = "x86_64" ]; then - sed -i "s,/usr/lib/,/usr/lib${LIBDIRSUFFIX}/,g" $PKG/etc/rc.d/rc.bluetooth -fi -cp -a $CWD/rc.bluetooth.conf $PKG/etc/rc.d/rc.bluetooth.conf -sed -i "s:\(HIDD_ENABLE=\).*:\1false:" $PKG/$CONF || exit 1 -sed -i "s:\(HID2HCI_ENABLE=\).*:\1false:" $PKG/$CONF || exit 1 - -mkdir -p $PKG/etc/bluetooth -cp -a audio/audio.conf $PKG/etc/bluetooth -cp -a audio/asound.conf $PKG/etc/bluetooth -cp -a input/input.conf $PKG/etc/bluetooth -cp -a hcid/hcid.conf $PKG/etc/bluetooth -cp -a network/network.conf $PKG/etc/bluetooth -cp -a rfcomm/rfcomm.conf $PKG/etc/bluetooth -chmod 644 $PKG/etc/bluetooth/*.conf - -# Do not overwrite configuration -# Well, let the dbus file be overwritten, as it is not usually user-edited. -( cd $PKG - for file in \ - etc/bluetooth/audio.conf \ - etc/asound.conf \ - etc/bluetooth/asound.conf \ - etc/bluetooth/input.conf \ - etc/bluetooth/hcid.conf \ - etc/bluetooth/network.conf \ - etc/bluetooth/rfcomm.conf \ - etc/bluetooth/passkeys/default \ - etc/rc.d/rc.bluetooth \ - etc/rc.d/rc.bluetooth.conf ; do - mv ${file} ${file}.new - done -) - -# Replace the bluetooth.conf file with one from BlueZ4 that works with the newest dbus: -cat $CWD/bluetooth.conf > $PKG/etc/dbus-1/system.d/bluetooth.conf - -# Compress and if needed symlink the man pages: -if [ -d $PKG/usr/man ]; then - ( cd $PKG/usr/man - for manpagedir in $(find . -type d -name "man*") ; do - ( cd $manpagedir - for eachpage in $( find . -type l -maxdepth 1) ; do - ln -s $( readlink $eachpage ).gz $eachpage.gz - rm $eachpage - done - gzip -9 *.? - ) - done - ) -fi - -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null - -mkdir -p $PKG/install -cat $CWD/slack-desc > $PKG/install/slack-desc -zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh - -cd $PKG -/sbin/makepkg -l y -c n $TMP/$NAME-$VERSION-$ARCH-$BUILD.txz - diff --git a/source/n/bluez-utils/doinst.sh b/source/n/bluez-utils/doinst.sh deleted file mode 100644 index e738d14bd..000000000 --- a/source/n/bluez-utils/doinst.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -config() { - NEW="$1" - OLD="`dirname $NEW`/`basename $NEW .new`" - # If there's no config file by that name, mv it over: - if [ ! -r $OLD ]; then - mv $NEW $OLD - elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy - rm $NEW - fi - # Otherwise, we leave the .new copy for the admin to consider... -} -if [ ! -e etc/rc.d/rc.bluetooth -o ! -x etc/rc.d/rc.bluetooth ]; then - chmod 644 etc/rc.d/rc.bluetooth.new -else - chmod 755 etc/rc.d/rc.bluetooth.new -fi -config etc/rc.d/rc.bluetooth.new -config etc/rc.d/rc.bluetooth.conf.new -config etc/bluetooth/asound.conf.new -config etc/bluetooth/audio.conf.new -config etc/bluetooth/hcid.conf.new -config etc/bluetooth/input.conf.new -config etc/bluetooth/network.conf.new -config etc/bluetooth/rfcomm.conf.new -config etc/bluetooth/passkeys/default.new - -if [ ! -e etc/asound.conf ]; then - ( cd etc ; ln -sf bluetooth/asound.conf . ) -fi diff --git a/source/n/bluez-utils/rc.bluetooth b/source/n/bluez-utils/rc.bluetooth deleted file mode 100644 index cf891dcf9..000000000 --- a/source/n/bluez-utils/rc.bluetooth +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -# -# Start/stop the Bluetooth daemons -# -# This version has been modified by SukkoPera, taking inspiration from then -# Debian init script, to add support for register-passkeys. Modified by -# Patrick Volkerding to add "restart" support, and cleaned up a tiny bit. - -set -e - -PATH=/sbin:/bin:/usr/sbin:/usr/bin -DESC="Bluetooth subsystem" - -# The register-passkeys script was originally written by Debian: -REGISTER_PASSKEYS=/usr/lib/bluetooth/register-passkeys - -HCID_NAME=hcid -HIDD_NAME=hidd -HID2HCI_NAME=hid2hci -RFCOMM_NAME=rfcomm -PAND_NAME=pand -DUND_NAME=dund - -HCID_EXEC="`which $HCID_NAME || true`" -HIDD_EXEC="`which $HIDD_NAME || true`" -HID2HCI_EXEC="`which $HID2HCI_NAME || true`" -RFCOMM_EXEC="`which $RFCOMM_NAME || true`" -PAND_EXEC="`which $PAND_NAME || true`" -DUND_EXEC="`which $DUND_NAME || true`" - -HCID_CONFIG="/etc/bluetooth/hcid.conf" -RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" - -# Source rc.bluetooth.conf -. /etc/rc.d/rc.bluetooth.conf - -bluetooth_start() { - echo -n "Starting $DESC: " - if [ -x "$HIDD_EXEC" ] ; then - if $HIDD_ENABLE && [ -x "$HIDD_EXEC" -a -n "$HIDD_OPTIONS" ] ; then - $HIDD_EXEC $HIDD_OPTIONS || true - echo -n " $HIDD_NAME" - fi - else - echo "BlueZ does not appear to be installed!" - exit - fi - # Separate sdp daemon is depreciated, now internal function. - if $SDPD_ENABLE ; then - $HCID_EXEC -s -f $HCID_CONFIG - echo -n " $HCID_NAME sdp" - else - $HCID_EXEC -f $HCID_CONFIG - echo -n " $HCID_NAME" - fi - if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then - $HID2HCI_EXEC --tohci > /dev/null 2>&1 || true - echo -n " $HID2HCI_NAME" - fi - if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" -a -f "$RFCOMM_CONFIG" ] ; then - $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all || true - echo -n " $RFCOMM_NAME" - fi - if $DUND_ENABLE && [ -x "$DUND_EXEC" -a -n "$DUND_OPTIONS" ] ; then - $DUND_EXEC $DUND_OPTIONS - echo -n " $DUND_NAME" - fi - if $PAND_ENABLE && [ -x "$PAND_EXEC" -a -n "$PAND_OPTIONS" ] ; then - $PAND_EXEC $PAND_OPTIONS - echo -n " $PAND_NAME" - fi - if [ -x $REGISTER_PASSKEYS ]; then - $REGISTER_PASSKEYS - echo -n " passkeys" - fi - echo "." -} - -bluetooth_stop() { - echo -n "Stopping $DESC: " - killall $PAND_NAME > /dev/null 2>&1 || true - echo -n " $PAND_NAME" - killall $DUND_NAME > /dev/null 2>&1 || true - echo -n " $DUND_NAME" - if [ -x "$RFCOMM_EXEC" ] ; then - $RFCOMM_EXEC release all > /dev/null 2>&1 || true - echo -n " $RFCOMM_NAME" - fi - killall $HIDD_NAME > /dev/null 2>&1 || true - echo -n " $HIDD_NAME" - killall $HCID_NAME > /dev/null 2>&1 || true - echo -n " $HCID_NAME" - echo "." -} - -case "$1" in - start) - bluetooth_start - ;; - stop) - bluetooth_stop - ;; - restart) - bluetooth_stop - sleep 1 - bluetooth_start - ;; - *) - echo "Usage: $0 start|stop|restart" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/source/n/bluez-utils/rc.bluetooth.conf b/source/n/bluez-utils/rc.bluetooth.conf deleted file mode 100644 index 09df405fb..000000000 --- a/source/n/bluez-utils/rc.bluetooth.conf +++ /dev/null @@ -1,33 +0,0 @@ -# /etc/rc.d/rc.bluetooth.conf -# -# This file contains the configuration for the Bluetooth subsystem, BlueZ. - -# The lines below allow you to configure which BlueZ daemons will be started, -# along with any daemon-specific options. - -# Allowed values for each (unless otherwise noted) are "true" and "false" - -# ============================================================================= - -# The SDP daemon allows clients to detect supported Bluetooth services -SDPD_ENABLE=true - -# The HID daemon supports Bluetooth Human Interface Devices -HIDD_ENABLE=false -HIDD_OPTIONS="--server" - -# This switches your Bluetooth device into HCI mode, use this if your input -# device does not support Bluetooth HID -HID2HCI_ENABLE=false - -# The RFCOMM daemon is used to simulate serial connections over Bluetooth -RFCOMM_ENABLE=true - -# The DUN daemon is used for Dial Up Networking over Bluetooth -DUND_ENABLE=false -DUND_OPTIONS="--listen --persist --msdun call dun" - -# The PAN daemon is used to setup a Bluetooth network. -PAND_ENABLE=false -PAND_OPTIONS="--listen --role NAP" - diff --git a/source/n/bluez-utils/register-passkeys b/source/n/bluez-utils/register-passkeys deleted file mode 100644 index f57042c3c..000000000 --- a/source/n/bluez-utils/register-passkeys +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# register every passkey found in $PASSKEYS_DIR - -PASSKEYS_DIR="/etc/bluetooth/passkeys/" -PASSKEY_AGENT="/usr/lib/bluetooth/add-passkey" - -cd $PASSKEYS_DIR - -for f in $(ls -1 ${PASSKEYS_DIR}); do - if [ ! -r "$f" ]; then continue; fi - - # default passkey - if [ "$f" == "default" ]; then - cat "$f" | $PASSKEY_AGENT --default > /dev/null 2>&1 & - # specific passkey - elif echo "$f" | egrep -q '([0-9a-fA-F]{1,2}:){5}[0-9a-fA-F]{1,2}'; then - cat "$f" | $PASSKEY_AGENT "$f" > /dev/null 2>&1 & - fi -done diff --git a/source/n/bluez/bluez.SlackBuild b/source/n/bluez/bluez.SlackBuild new file mode 100755 index 000000000..ec5cba262 --- /dev/null +++ b/source/n/bluez/bluez.SlackBuild @@ -0,0 +1,196 @@ +#!/bin/sh + +# Slackware build script for bluez-utils - http://www.bluez.org + +# Copyright 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PKGNAM=bluez +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +NUMJOBS=${NUMJOBS:-" -j7 "} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG +cd $TMP +rm -rf $PKGNAM-$VERSION +tar xvf $CWD/${PKGNAM}-${VERSION}.tar.?z* || exit 1 +cd $PKGNAM-$VERSION + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Fixup the dbus config file for our usage: +zcat $CWD/patches/bluez-dbus-config.patch.gz | patch -p1 --verbose || exit 1 + +# Use a wrapper to check rc.bluetooth mode before starting bluetoothd +zcat $CWD/patches/bluez-run_udev_helper.patch.gz | patch -p1 --verbose || exit 1 + +# Unbreak a Dell USB mouse +# https://bugzilla.novell.com/show_bug.cgi?id=522287 +# https://bugzilla.redhat.com/show_bug.cgi?id=517088 +zcat $CWD/patches/bluez-unbreak_dell_mouse.patch.gz | patch -p1 --verbose || exit 1 + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --mandir=/usr/man \ + --localstatedir=/var \ + --enable-gstreamer \ + --enable-alsa \ + --enable-usb \ + --enable-netlink \ + --enable-tools\ + --enable-bccmd \ + --enable-hid2hci \ + --enable-dfutool \ + --enable-hidd \ + --enable-pand \ + --enable-dund \ + --enable-cups \ + --enable-service \ + --enable-udevrules \ + --enable-configfiles \ + --disable-silent-rules \ + --build=$ARCH-slackware-linux + +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG + +# I'm don't think we need this, but I'll leave it commented just in case: +# http://bugs.archlinux.org/task/4930 +# The dbus-1 and bluetooth linkages are obvious, but I had to get the rt and +# pthread ones from the old bluez-utils (VERSION=3.36) tests/Makefile +#gcc $SLKCFLAGS $(pkg-config --cflags dbus-1) -DVERSION=3.36 \ +# -L$(pwd)/lib/.libs -ldbus-1 -lbluetooth -lpthread -lrt \ +# $CWD/passkey-agent.c -o $PKG/usr/bin/passkey-agent || exit 1 + +cp -a scripts/bluetooth_serial $PKG/lib/udev/bluetooth_serial || exit 1 +chmod 0755 $PKG/lib/udev/bluetooth_serial + +cat $CWD/config/bluetooth.sh > $PKG/lib/udev/bluetooth.sh +chmod 0755 $PKG/lib/udev/bluetooth.sh + +# SuSE says this is safe... :-) +mkdir -p $PKG/etc/modprobe.d +cat $CWD/config/bluetooth.modprobe > $PKG/etc/modprobe.d/bluetooth.conf + +mkdir -p $PKG/etc/bluetooth +cp -a audio/audio.conf $PKG/etc/bluetooth +cp -a input/input.conf $PKG/etc/bluetooth +cp -a network/network.conf $PKG/etc/bluetooth +cp -a serial/serial.conf $PKG/etc/bluetooth +cp -a tools/rfcomm.conf $PKG/etc/bluetooth +chmod 644 $PKG/etc/bluetooth/*.conf + +# Do not overwrite configuration +# Well, let the dbus file be overwritten, as it is not usually user-edited. +( cd $PKG + for file in \ + etc/alsa/bluetooth.conf \ + etc/bluetooth/audio.conf \ + etc/bluetooth/input.conf \ + etc/bluetooth/network.conf \ + etc/bluetooth/serial.conf \ + etc/bluetooth/rfcomm.conf \ + etc/bluetooth/main.conf \ + etc/modprobe.d/bluetooth.conf ; do + mv ${file} ${file}.new + done +) + +# Add an init script +mkdir -p $PKG/etc/rc.d +cat $CWD/config/rc.bluetooth > $PKG/etc/rc.d/rc.bluetooth.new + +# Compress and if needed symlink the man pages: +if [ -d $PKG/usr/man ]; then + ( cd $PKG/usr/man + for manpagedir in $(find . -type d -name "man*") ; do + ( cd $manpagedir + for eachpage in $( find . -type l -maxdepth 1) ; do + ln -s $( readlink $eachpage ).gz $eachpage.gz + rm $eachpage + done + gzip -9 *.? + ) + done + ) +fi + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + AUTHORS COPYING* INSTALL NEWS README* \ + $PKG/usr/doc/$PKGNAM-$VERSION + +# If there's a ChangeLog, installing at least part of the recent history +# is useful, but don't let it get totally out of control: +if [ -r ChangeLog ]; then + DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION) + cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog + touch -r ChangeLog $DOCSDIR/ChangeLog +fi + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/n/bluez/config/bluetooth.modprobe b/source/n/bluez/config/bluetooth.modprobe new file mode 100644 index 000000000..3072d7885 --- /dev/null +++ b/source/n/bluez/config/bluetooth.modprobe @@ -0,0 +1,3 @@ +# use "reset=1" as default, since it should be safe for recent devices and +# solves all kind of problems. +options btusb reset=1 diff --git a/source/n/bluez/config/bluetooth.sh b/source/n/bluez/config/bluetooth.sh new file mode 100644 index 000000000..22034551c --- /dev/null +++ b/source/n/bluez/config/bluetooth.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check whether /etc/rc.d/rc.bluetooth is executable before starting +# the bluetooth subsystem for hotplugged bluetooth devices +[ -x /etc/rc.d/rc.bluetooth ] && exec /usr/sbin/bluetoothd --udev +exit 0 + diff --git a/source/n/bluez/config/rc.bluetooth b/source/n/bluez/config/rc.bluetooth new file mode 100644 index 000000000..12540d833 --- /dev/null +++ b/source/n/bluez/config/rc.bluetooth @@ -0,0 +1,30 @@ +#!/bin/sh + +bluez_start() { + # bluetoothd requires dbus, but dbus isn't started early enough during + # system boot, so we have to re-trigger the events now + udevadm trigger --subsystem-match=bluetooth --action=add +} + +bluez_stop() { + pkill -TERM bluetoothd 1>/dev/null 2>/dev/null +} + +case "$1" in + start) + bluez_start + ;; + stop) + bluez_stop + ;; + restart) + bluez_stop + sleep 1 + bluez_start + ;; + *) + printf "Usage: $N {start|stop|restart}\n" + exit 1 + ;; +esac + diff --git a/source/n/bluez/doinst.sh b/source/n/bluez/doinst.sh new file mode 100644 index 000000000..1711435e0 --- /dev/null +++ b/source/n/bluez/doinst.sh @@ -0,0 +1,29 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.bluetooth.new: +if [ -e etc/rc.d/rc.bluetooth ]; then + cp -a etc/rc.d/rc.bluetooth etc/rc.d/rc.bluetooth.new.incoming + cat etc/rc.d/rc.bluetooth.new > etc/rc.d/rc.bluetooth.new.incoming + mv etc/rc.d/rc.bluetooth.new.incoming etc/rc.d/rc.bluetooth.new +fi + +config etc/alsa/bluetooth.conf.new +config etc/rc.d/rc.bluetooth.new +config etc/bluetooth/audio.conf.new +config etc/bluetooth/input.conf.new +config etc/bluetooth/main.conf.new +config etc/bluetooth/network.conf.new +config etc/bluetooth/serial.conf.new +config etc/bluetooth/rfcomm.conf.new +config etc/modprobe.d/bluetooth.conf.new + diff --git a/source/n/bluez-utils/add-passkey.c b/source/n/bluez/passkey-agent.c index b9dcbb517..8ac91d27d 100644 --- a/source/n/bluez-utils/add-passkey.c +++ b/source/n/bluez/passkey-agent.c @@ -1,11 +1,8 @@ /* - * add-passkey.c: - * registers as an agent for the bluez bluetooth linux stack, the code is - * shamelessly stolen from bluez source found at http://bluez.sf.net * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2005-2006 Marcel Holtmann <marcel@holtmann.org> + * Copyright (C) 2004-2008 Marcel Holtmann <marcel@holtmann.org> * * * This program is free software; you can redistribute it and/or modify @@ -40,12 +37,11 @@ #define INTERFACE "org.bluez.Security" -// FIXME assumption -#define PASSKEYMAXLENGTH 255 - static char *passkey = NULL; static char *address = NULL; +static int do_reject = 0; + static volatile sig_atomic_t __io_canceled = 0; static volatile sig_atomic_t __io_terminated = 0; @@ -70,6 +66,7 @@ static DBusHandlerResult agent_filter(DBusConnection *conn, } if (!strcmp(name, "org.bluez") && *new == '\0') { + fprintf(stderr, "Passkey service has been terminated\n"); __io_terminated = 1; } @@ -81,25 +78,36 @@ static DBusHandlerResult request_message(DBusConnection *conn, { DBusMessage *reply; const char *path, *address; + dbus_bool_t numeric; if (!passkey) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &path, - DBUS_TYPE_STRING, &address, DBUS_TYPE_INVALID)) { + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_STRING, &path, DBUS_TYPE_STRING, &address, + DBUS_TYPE_BOOLEAN, &numeric, DBUS_TYPE_INVALID)) { fprintf(stderr, "Invalid arguments for passkey Request method"); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } + if (do_reject) { + reply = dbus_message_new_error(msg, + "org.bluez.Error.Rejected", ""); + goto send; + } + reply = dbus_message_new_method_return(msg); if (!reply) { fprintf(stderr, "Can't create reply message\n"); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + return DBUS_HANDLER_RESULT_NEED_MEMORY; } + printf("Passkey request for device %s\n", address); + dbus_message_append_args(reply, DBUS_TYPE_STRING, &passkey, DBUS_TYPE_INVALID); +send: dbus_connection_send(conn, reply, NULL); dbus_connection_flush(conn); @@ -109,35 +117,63 @@ static DBusHandlerResult request_message(DBusConnection *conn, return DBUS_HANDLER_RESULT_HANDLED; } -static DBusHandlerResult release_message(DBusConnection *conn, +static DBusHandlerResult cancel_message(DBusConnection *conn, DBusMessage *msg, void *data) { DBusMessage *reply; + const char *path, *address; - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) { - fprintf(stderr, "Invalid arguments for passkey Release method"); + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_STRING, &path, DBUS_TYPE_STRING, &address, + DBUS_TYPE_INVALID)) { + fprintf(stderr, "Invalid arguments for passkey Confirm method"); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } + printf("Request canceled for device %s\n", address); + reply = dbus_message_new_method_return(msg); if (!reply) { fprintf(stderr, "Can't create reply message\n"); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + return DBUS_HANDLER_RESULT_NEED_MEMORY; } - dbus_message_append_args(reply, DBUS_TYPE_INVALID); - dbus_connection_send(conn, reply, NULL); dbus_connection_flush(conn); dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; +} + +static DBusHandlerResult release_message(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + DBusMessage *reply; + + if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) { + fprintf(stderr, "Invalid arguments for passkey Release method"); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + if (!__io_canceled) fprintf(stderr, "Passkey service has been released\n"); __io_terminated = 1; + reply = dbus_message_new_method_return(msg); + if (!reply) { + fprintf(stderr, "Can't create reply message\n"); + return DBUS_HANDLER_RESULT_NEED_MEMORY; + } + + dbus_connection_send(conn, reply, NULL); + + dbus_connection_flush(conn); + + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; } @@ -147,6 +183,9 @@ static DBusHandlerResult agent_message(DBusConnection *conn, if (dbus_message_is_method_call(msg, "org.bluez.PasskeyAgent", "Request")) return request_message(conn, msg, data); + if (dbus_message_is_method_call(msg, "org.bluez.PasskeyAgent", "Cancel")) + return cancel_message(conn, msg, data); + if (dbus_message_is_method_call(msg, "org.bluez.PasskeyAgent", "Release")) return release_message(conn, msg, data); @@ -166,7 +205,7 @@ static int register_agent(DBusConnection *conn, const char *agent_path, if (!dbus_connection_register_object_path(conn, agent_path, &agent_table, NULL)) { - fprintf(stderr, "Can't register path object path for agent\n"); + fprintf(stderr, "Can't register object path for agent\n"); return -1; } @@ -231,7 +270,7 @@ static int unregister_agent(DBusConnection *conn, const char *agent_path, msg = dbus_message_new_method_call("org.bluez", path, INTERFACE, method); if (!msg) { fprintf(stderr, "Can't allocate new method call\n"); - dbus_connection_close(conn); + dbus_connection_unref(conn); exit(1); } @@ -268,21 +307,16 @@ static int unregister_agent(DBusConnection *conn, const char *agent_path, static void usage(void) { -// printf("Bluetooth passkey agent ver %s\n\n", VERSION); + printf("Bluetooth passkey agent ver %s\n\n", VERSION); printf("Usage:\n" - "\tadd-passkey [--passkey-fd n] [--default] [--path agent-path] [address]\n" - "\n" - "add-passkey will read from passkey-fd (default: stdin) adding a default passkey\n" - "if --default is given, or for a specific address if supplied on commandline.\n\n" - "--default or address are mandatory.\n" - "this program is based on bluez passkey-agent.c from http://bluez.sf.net\n" + "\tpasskey-agent [--default] [--path agent-path] <passkey> [address]\n" "\n"); } static struct option main_options[] = { - { "passkey-fd", 1, 0, 'f'}, { "default", 0, 0, 'd' }, + { "reject", 0, 0, 'r' }, { "path", 1, 0, 'p' }, { "help", 0, 0, 'h' }, { 0, 0, 0, 0 } @@ -293,19 +327,19 @@ int main(int argc, char *argv[]) struct sigaction sa; DBusConnection *conn; char match_string[128], default_path[128], *agent_path = NULL; - int opt, use_default = 0, passkey_fd = 0; - char *tmppasskey; + int opt, use_default = 0; snprintf(default_path, sizeof(default_path), "/org/bluez/passkey_agent_%d", getpid()); - while ((opt = getopt_long(argc, argv, "+fdp:h", main_options, NULL)) != EOF) { + while ((opt = getopt_long(argc, argv, "+dp:h", main_options, NULL)) != EOF) { switch(opt) { - case 'f': - passkey_fd = atoi(optarg); case 'd': use_default = 1; break; + case 'r': + do_reject = 1; + break; case 'p': if (optarg[0] != '/') { fprintf(stderr, "Invalid path\n"); @@ -324,24 +358,14 @@ int main(int argc, char *argv[]) argc -= optind; argv += optind; optind = 0; - - if (argc < 1 && !use_default) { + + if (argc < 1) { usage(); exit(1); } - - passkey = malloc(PASSKEYMAXLENGTH * sizeof(char)); - - if (!read(passkey_fd, passkey, PASSKEYMAXLENGTH)) { - fprintf(stderr, "Unable to read passkey from fd %d\n", passkey_fd); - exit(1); - } - - if (tmppasskey = index(passkey, '\n')) { - *tmppasskey = '\0'; - } - address = (argc > 0) ? strdup(argv[0]) : NULL; + passkey = strdup(argv[0]); + address = (argc > 1) ? strdup(argv[1]) : NULL; if (!use_default && !address) { usage(); @@ -358,7 +382,7 @@ int main(int argc, char *argv[]) } if (register_agent(conn, agent_path, address, use_default) < 0) { - dbus_connection_close(conn); + dbus_connection_unref(conn); exit(1); } @@ -378,7 +402,7 @@ int main(int argc, char *argv[]) sigaction(SIGINT, &sa, NULL); while (!__io_canceled && !__io_terminated) { - if (dbus_connection_read_write_dispatch(conn, 100) != TRUE) + if (dbus_connection_read_write_dispatch(conn, 500) != TRUE) break; } @@ -388,7 +412,7 @@ int main(int argc, char *argv[]) if (passkey) free(passkey); - dbus_connection_close(conn); + dbus_connection_unref(conn); return 0; } diff --git a/source/n/bluez/patches/bluez-dbus-config.patch b/source/n/bluez/patches/bluez-dbus-config.patch new file mode 100644 index 000000000..4160600a5 --- /dev/null +++ b/source/n/bluez/patches/bluez-dbus-config.patch @@ -0,0 +1,25 @@ +Use the plugdev group for bluetooth on Slackware, and allow this to + work as expected with our current setup. + +diff -Nur bluez-4.61.orig//src/bluetooth.conf bluez-4.61/src/bluetooth.conf +--- bluez-4.61.orig//src/bluetooth.conf 2010-02-18 17:48:50.434527785 -0600 ++++ bluez-4.61/src/bluetooth.conf 2010-02-18 17:47:30.727431004 -0600 +@@ -11,11 +11,16 @@ + <allow own="org.bluez"/> + <allow send_destination="org.bluez"/> + <allow send_interface="org.bluez.Agent"/> ++ <allow send_interface="org.bluez.Adapter"/> + <allow send_interface="org.bluez.HandsfreeAgent"/> + </policy> + +- <policy at_console="true"> +- <allow send_destination="org.bluez"/> ++ <policy group="plugdev"> ++ <allow send_destination="org.bluez"/> ++ <allow send_interface="org.bluez.Agent"/> ++ <allow send_interface="org.bluez.Adapter"/> ++ <allow send_destination="org.bluez" ++ send_interface="org.freedesktop.DBus.Introspectable"/> + </policy> + + <!-- allow users of lp group (printing subsystem) to diff --git a/source/n/bluez/patches/bluez-run_udev_helper.patch b/source/n/bluez/patches/bluez-run_udev_helper.patch new file mode 100644 index 000000000..188607453 --- /dev/null +++ b/source/n/bluez/patches/bluez-run_udev_helper.patch @@ -0,0 +1,12 @@ +Instead of automatically starting the bluetooth subsystem when devices + are added, let's invoke a wrapper script in /lib/udev and have that + wrapper check whether /etc/rc.d/rc.bluetooth is executable first. + +diff -Nur bluez-4.59.orig/scripts/bluetooth.rules.in bluez-4.59/scripts/bluetooth.rules.in +--- bluez-4.59.orig/scripts/bluetooth.rules.in 2009-07-06 15:21:40.000000000 -0500 ++++ bluez-4.59/scripts/bluetooth.rules.in 2009-12-30 11:50:37.069164823 -0600 +@@ -1,3 +1,3 @@ + # Run helper every time a Bluetooth device appears + # On remove actions, bluetoothd should go away by itself +-ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="@prefix@/sbin/bluetoothd --udev" ++ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/lib/udev/bluetooth.sh" diff --git a/source/n/bluez/patches/bluez-unbreak_dell_mouse.patch b/source/n/bluez/patches/bluez-unbreak_dell_mouse.patch new file mode 100644 index 000000000..ec0b4a96b --- /dev/null +++ b/source/n/bluez/patches/bluez-unbreak_dell_mouse.patch @@ -0,0 +1,14 @@ +One of the Dell USB mice gets broken by this rule, so we'll unbreak it. + +diff -Nur bluez-4.59.orig/scripts/bluetooth-hid2hci.rules bluez-4.59/scripts/bluetooth-hid2hci.rules +--- bluez-4.59.orig/scripts/bluetooth-hid2hci.rules 2009-05-19 04:04:10.000000000 -0500 ++++ bluez-4.59/scripts/bluetooth-hid2hci.rules 2009-12-30 12:34:14.165164370 -0600 +@@ -8,7 +8,7 @@ + # 413c:8154 + # 413c:8158 + # 413c:8162 +-ACTION=="add", ENV{ID_VENDOR}=="413c", ENV{ID_CLASS}=="mouse", ATTRS{bmAttributes}=="e0", KERNEL=="mouse*", RUN+="/usr/sbin/hid2hci --method dell -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci" ++# ACTION=="add", ENV{ID_VENDOR}=="413c", ENV{ID_CLASS}=="mouse", ATTRS{bmAttributes}=="e0", KERNEL=="mouse*", RUN+="/usr/sbin/hid2hci --method dell -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci" + + # Logitech devices + ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c703" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci" diff --git a/source/n/bluez/slack-desc b/source/n/bluez/slack-desc new file mode 100644 index 000000000..607fa4d96 --- /dev/null +++ b/source/n/bluez/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +bluez: bluez (Bluetooth libraries and utilities) +bluez: +bluez: Bluez is the Bluetooth stack for Linux, allowing Bluetooth adaptors +bluez: and devices to be used with Linux. This package contains the Bluez +bluez: libraries, utilities, and other support files. +bluez: +bluez: For more info, visit: http://www.bluez.org +bluez: +bluez: +bluez: +bluez: |