diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2010-05-19 08:58:23 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 22:43:05 +0200 |
commit | b76270bf9e6dd375e495fec92140a79a79415d27 (patch) | |
tree | 3dbed78b2279bf9f14207a16dc634b90995cbd40 /source/xap/blueman | |
parent | 5a12e7c134274dba706667107d10d231517d3e05 (diff) | |
download | current-b76270bf9e6dd375e495fec92140a79a79415d27.tar.gz |
Slackware 13.1slackware-13.1
Wed May 19 08:58:23 UTC 2010
Slackware 13.1 x86_64 stable is released!
Lots of thanks are due -- see the RELEASE_NOTES and the rest of the
ChangeLog for credits. The ISOs are on their way to replication,
a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD.
We are taking pre-orders now at store.slackware.com, and offering
a discount if you sign up for a subscription. Consider picking up
a copy to help support the project. Thanks again to the Slackware
community for testing, contributing, and generally holding us to a
high level of quality. :-)
Enjoy!
Diffstat (limited to 'source/xap/blueman')
-rw-r--r-- | source/xap/blueman/blueman-open | 114 | ||||
-rw-r--r-- | source/xap/blueman/blueman-use_blueman-open_for_obexfs.diff | 12 | ||||
-rwxr-xr-x | source/xap/blueman/blueman.SlackBuild | 142 | ||||
-rw-r--r-- | source/xap/blueman/doinst.sh | 23 | ||||
-rw-r--r-- | source/xap/blueman/fix_on_off_loop.diff | 58 | ||||
-rw-r--r-- | source/xap/blueman/no_hide_applet.diff | 30 | ||||
-rw-r--r-- | source/xap/blueman/slack-desc | 19 |
7 files changed, 398 insertions, 0 deletions
diff --git a/source/xap/blueman/blueman-open b/source/xap/blueman/blueman-open new file mode 100644 index 00000000..0cfa688f --- /dev/null +++ b/source/xap/blueman/blueman-open @@ -0,0 +1,114 @@ +#!/bin/sh +# Blueman Mount Script for Slackware +# by Zarren Spry & Robby Workman +# Based on http://kde-apps.org/content/show.php/kde4+bluetooth+files+open?content=108869 + +# Set to 0 if you want more debugging messages +DEBUG=1 + +device_addr="$1" +device_name="$(hcitool name $device_addr)" +own_name="$(basename $0)" +basedir="${basedir:-$HOME/obexfs}" +mountpoint="${basedir}/${device_addr}" +browser=${browser:-"xdg-open"} + +# If we're running in kde, use kdialog +if [ "$KDE_FULL_SESSION" = "true" ]; then + if which kdialog 1>/dev/null 2>/dev/null; then + messagetype="kdialog" + fi +# If not, then see if libnotify is available +# Even if it is, there may not be a notification daemon running, but there's +# no good way to check for this, so oh well... +elif which notify-send 1>/dev/null 2>/dev/null; then + messagetype="libnotify" +# If no libnotify, then use kdialog if it's installed +elif which kdialog 1>/dev/null 2>/dev/null; then + messagetype="kdialog" +# If all else fails, just don't do notifications +else + messagetype="" +fi + +# Mount function +mount_device () +{ + [ ! -z $DEBUG ] && logger -i -t $own_name "Attempting to mount device $device_name to $mountpoint..." + [ ! -z $DEBUG ] && logger -i -t $own_name "Execute: obexfs -b $device_addr $mountpoint" + + mkdir -p $mountpoint + obexfs -b $device_addr $mountpoint 2>&1 + + if [ $? != 0 ]; then + MSG_TXT="Failed to mount $device_name to $mountpoint. $dbg_msg" + FAILZOR=definitely + if [ ! -z $DEBUG ]; then + logger -i -t $own_name "Failed to mount $device_name to $mountpoint." + fi + else + MSG_TXT="Successfully mounted $device_name to $mountpoint" + if [ ! -z $DEBUG ]; then + logger -i -t $own_name "Successfully mounted $device_name to $mountpoint." + fi + fi + + if [ $messagetype == "kdialog" ]; then + kdialog --passivepopup "$MSG_TXT" 2 + elif [ $messagetype == "libnotify" ]; then + notify-send --expire-time=20000 --icon=blueman "$MSG_TXT" + fi + + [ "$FAILZOR" = "definitely" ] && exit 1 + + [ ! -z $DEBUG ] && logger -i -t $own_name "Opening $mountpoint with $browser..." + $browser $mountpoint 2>&1 + +} + +# Unmount function +umount_device () +{ + if grep -qw $mountpoint /proc/mounts 2>/dev/null ; then + [ ! -z $DEBUG ] && logger -i -t $own_name \ + "$mountpoint has something mounted on it already - unmounting it..." + + fusermount -u $mountpoint 1>/dev/null 2>/dev/null + + if [ $? != 0 ]; then + [ ! -z $DEBUG ] && logger -i -t $own_name "Failed to unmount $mountpoint with fusermount..." + umount -f $mountpoint 1>/dev/null 2>/dev/null + if [ $? != 0 ]; then + [ ! -z $DEBUG ] && \ + logger -i -t $own_name \ + "Failed to unmount $mountpoint with umount - try it manually as root and then start over." + FAILZOR=definitely + MSG_TXT="Failed to unmount $mountpoint with fusermount and umount - try it as root first." + else + break + fi + else + [ ! -z $DEBUG ] && logger -i -t $own_name "Successfully unmounted $device_name." + fi + else + [ ! -z $DEBUG ] && logger -i -t $own_name "$mountpoint has nothing mounted on it - continuing..." + fi + + if [ $messagetype == "kdialog" ]; then + kdialog --passivepopup "$MSG_TXT" 3 + elif [ $messagetype == "libnotify" ]; then + notify-send --expire-time=20000 --icon=blueman "$MSG_TXT" + fi + [ "$FAILZOR" = "definitely" ] && exit 1 +} + +MSG_TXT="Attempting to mount $device_name - please wait..." +if [ $messagetype == "kdialog" ]; then + kdialog --passivepopup "$MSG_TXT" 4 +elif [ $messagetype == "libnotify" ]; then + notify-send --expire-time=20000 --icon=blueman "$MSG_TXT" +fi + +umount_device +mount_device + diff --git a/source/xap/blueman/blueman-use_blueman-open_for_obexfs.diff b/source/xap/blueman/blueman-use_blueman-open_for_obexfs.diff new file mode 100644 index 00000000..542ee6e5 --- /dev/null +++ b/source/xap/blueman/blueman-use_blueman-open_for_obexfs.diff @@ -0,0 +1,12 @@ +diff -Nur blueman-1.21.orig/blueman/Constants.py.in blueman-1.21/blueman/Constants.py.in +--- blueman-1.21.orig/blueman/Constants.py.in 2009-09-20 05:01:26.000000000 -0500 ++++ blueman-1.21/blueman/Constants.py.in 2009-12-13 16:26:29.643850538 -0600 +@@ -10,7 +10,7 @@ + POLKIT = "@polkit_val@" == "yes" + HAL_ENABLED = "@hal_en@" == "yes" + +-DEF_BROWSE_COMMAND = "nautilus --browser obex://[%d]" ++DEF_BROWSE_COMMAND = "/usr/libexec/blueman-open %d" + + import os + import gettext diff --git a/source/xap/blueman/blueman.SlackBuild b/source/xap/blueman/blueman.SlackBuild new file mode 100755 index 00000000..bdb134e0 --- /dev/null +++ b/source/xap/blueman/blueman.SlackBuild @@ -0,0 +1,142 @@ +#!/bin/sh + +# Slackware build script for blueman + +# Copyright 2009 Robby Workman, Northport, Alabama, USA +# Copyright 2010 Patrick Volkerding, Sebeka, MN, 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=blueman +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} +POLKIT_OPTION=" --disable-polkit " + +# 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 + +NUMJOBS=${NUMJOBS:-" -j7 "} + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +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 {} \; + +# Address a couple of bugs that have been fixed in the bzr repo +zcat $CWD/no_hide_applet.diff.gz | patch -p0 --verbose || exit 1 +zcat $CWD/fix_on_off_loop.diff.gz | patch -p0 --verbose || exit 1 + +# Use blueman-open, a modified version of this, to browse obexfs shares: +# http://www.kde-apps.org/content/show.php/kde4+bluetooth+files+open?content=108869 +zcat $CWD/blueman-use_blueman-open_for_obexfs.diff.gz | patch -p1 || exit 1 + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PKGNAM-$VERSION \ + --disable-static \ + --with-dhcp-config=/etc/dhcpd.conf \ + --enable-hal \ + $POLKIT_OPTION \ + --build=$ARCH-slackware-linux + +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG || exit 1 + +if echo $POLKIT_OPTION | grep -q '\--disable-polkit' ; then + # Remove unneeded junk + rm -rf $PKG/usr/share/polkit-1 +fi + +# Add the blueman-open script to /usr/libexec for browsing obexfs shares +# I don't want to put this in PATH and have someone accidentally run it +mkdir -p $PKG/usr/libexec +cat $CWD/blueman-open > $PKG/usr/libexec/blueman-open +chmod 0755 $PKG/usr/libexec/blueman-open + +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true +) + +( cd $PKG/usr/man + find . -type f -exec gzip -9 {} \; + for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +) + +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 -p -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/xap/blueman/doinst.sh b/source/xap/blueman/doinst.sh new file mode 100644 index 00000000..17b18ef3 --- /dev/null +++ b/source/xap/blueman/doinst.sh @@ -0,0 +1,23 @@ +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 [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi + diff --git a/source/xap/blueman/fix_on_off_loop.diff b/source/xap/blueman/fix_on_off_loop.diff new file mode 100644 index 00000000..ac11c135 --- /dev/null +++ b/source/xap/blueman/fix_on_off_loop.diff @@ -0,0 +1,58 @@ +revno: 602 +committer: walmis +timestamp: Sun 2009-10-25 15:49:33 +0000 +message: + fix bluetooth on/off loop + +=== modified file 'blueman/plugins/applet/PowerManager.py' +--- blueman/plugins/applet/PowerManager.py 2009-10-25 15:16:14 +0000 ++++ blueman/plugins/applet/PowerManager.py 2009-10-25 15:49:33 +0000 +@@ -66,22 +66,6 @@ + dprint("adapter powered on while in off state, turning bluetooth on") + self.bluetooth_off = False + +- +- def on_manager_state_changed(self, state): +- if state: +- adapters = self.Applet.Manager.ListAdapters() +- for adapter in adapters: +- props = adapter.GetProperties() +- if not props["Powered"]: +- self.bluetooth_off = True +- if self.state_change_deferred != -1: +- break +- else: +- return +- +- if self.state_change_deferred != -1: +- self.bluetooth_off = self.state_change_deferred +- self.state_change_deferred = -1 + + def on_bluetooth_toggled(self): + self.bluetooth_off = not self.bluetooth_off +@@ -97,9 +81,17 @@ + + return pixbuf + ++ def process_deferred(self): ++ if self.state_change_deferred != -1: ++ dprint("Setting deferred status") ++ self.bluetooth_off = self.state_change_deferred ++ self.state_change_deferred = -1 ++ + def on_adapter_added(self, path): + adapter = Bluez.Adapter(path) + def on_ready(): ++ self.process_deferred() ++ + if self.bluetooth_off: + adapter.SetProperty("Powered", False) + else: +@@ -134,6 +126,7 @@ + self.__dict__[key] = value + + if not self.Applet.Manager: ++ dprint("deferring status change") + self.state_change_deferred = value + return + diff --git a/source/xap/blueman/no_hide_applet.diff b/source/xap/blueman/no_hide_applet.diff new file mode 100644 index 00000000..a57a2b8f --- /dev/null +++ b/source/xap/blueman/no_hide_applet.diff @@ -0,0 +1,30 @@ +revno: 647 +committer: Valmantas Palikša <walmis@balticum-tv.lt> +branch nick: trunk +timestamp: Wed 2009-12-02 21:31:16 +0200 +message: + don't force hide the applet if bluez manager is not initialized + +=== modified file 'blueman/plugins/applet/StatusIcon.py' +--- blueman/plugins/applet/StatusIcon.py 2009-10-27 16:10:53 +0000 ++++ blueman/plugins/applet/StatusIcon.py 2009-12-02 19:31:16 +0000 +@@ -55,15 +55,16 @@ + self.Query() + + def Query(self): +- if not self.Applet.Manager: +- self.props.visible = False +- return + + rets = self.Applet.Plugins.Run("on_query_status_icon_visibility") + if not StatusIcon.FORCE_HIDE in rets: + if StatusIcon.FORCE_SHOW in rets: + self.props.visible = True + else: ++ if not self.Applet.Manager: ++ self.props.visible = False ++ return ++ + try: + if self.Applet.Manager.ListAdapters() == []: + self.props.visible = False diff --git a/source/xap/blueman/slack-desc b/source/xap/blueman/slack-desc new file mode 100644 index 00000000..d9b80088 --- /dev/null +++ b/source/xap/blueman/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------------------------------------------------------| +blueman: Blueman (Graphical Bluetooth Manager) +blueman: +blueman: Blueman is a GTK+ Bluetooth Manager for tasks such as: +blueman: +blueman: - Connecting to 3G/EDGE/GPRS via DUN profile. +blueman: - Connecting to/Creating bluetooth networks +blueman: - Connecting to input and audio devices +blueman: - Sending/Receiving/Browsing files via OBEX +blueman: - Pairing +blueman: +blueman: Homepage: http://blueman-project.org |