summaryrefslogtreecommitdiffstats
path: root/patches/source/blueman
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2018-05-25 23:29:36 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 15:18:32 -0700
commit8ff4f2f51a6cf07fc33742ce3bee81328896e49b (patch)
tree4a166b8389404be98a6c098babaa444e2dec8f48 /patches/source/blueman
parent76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (diff)
downloadcurrent-8ff4f2f51a6cf07fc33742ce3bee81328896e49b.tar.gz
current-8ff4f2f51a6cf07fc33742ce3bee81328896e49b.tar.xz
Fri May 25 23:29:36 UTC 201814.1
patches/packages/glibc-zoneinfo-2018e-noarch-2_slack14.1.txz: Rebuilt. Handle removal of US/Pacific-New timezone. If we see that the machine is using this, it will be automatically switched to US/Pacific.
Diffstat (limited to 'patches/source/blueman')
-rw-r--r--patches/source/blueman/blueman-open114
-rw-r--r--patches/source/blueman/blueman-use_blueman-open_for_obexfs.diff12
-rw-r--r--patches/source/blueman/blueman.CVE-2015-8612.diff21
-rwxr-xr-xpatches/source/blueman/blueman.SlackBuild134
-rw-r--r--patches/source/blueman/doinst.sh23
-rw-r--r--patches/source/blueman/slack-desc19
6 files changed, 323 insertions, 0 deletions
diff --git a/patches/source/blueman/blueman-open b/patches/source/blueman/blueman-open
new file mode 100644
index 000000000..0cfa688fa
--- /dev/null
+++ b/patches/source/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/patches/source/blueman/blueman-use_blueman-open_for_obexfs.diff b/patches/source/blueman/blueman-use_blueman-open_for_obexfs.diff
new file mode 100644
index 000000000..542ee6e5d
--- /dev/null
+++ b/patches/source/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/patches/source/blueman/blueman.CVE-2015-8612.diff b/patches/source/blueman/blueman.CVE-2015-8612.diff
new file mode 100644
index 000000000..163d66083
--- /dev/null
+++ b/patches/source/blueman/blueman.CVE-2015-8612.diff
@@ -0,0 +1,21 @@
+--- ./blueman/plugins/mechanism/Network.py.orig 2010-02-05 13:16:27.000000000 -0600
++++ ./blueman/plugins/mechanism/Network.py 2015-12-19 16:07:25.509562573 -0600
+@@ -22,6 +22,9 @@
+ import gobject
+ from blueman.main.NetConf import NetConf, DnsMasqHandler, DhcpdHandler
+
++DHCPDHANDLERS = {"DnsMasqHandler": DnsMasqHandler,
++ "DhcpdHandler": DhcpdHandler},
++
+ class Network(MechanismPlugin):
+ def on_load(self):
+ self.add_dbus_method(self.SetGN, in_signature="b", out_signature="", sender_keyword="caller")
+@@ -67,7 +70,7 @@
+ def EnableNetwork(self, ip_address, netmask, dhcp_handler, caller):
+ nc = NetConf.get_default()
+ nc.set_ipv4(ip_address, netmask)
+- eval("nc.set_dhcp_handler(%s)" % dhcp_handler)
++ nc.set_dhcp_handler(DHCPDHANDLERS[dhcp_handler])
+ nc.apply_settings()
+
+ def ReloadNetwork(self, caller):
diff --git a/patches/source/blueman/blueman.SlackBuild b/patches/source/blueman/blueman.SlackBuild
new file mode 100755
index 000000000..6757da5de
--- /dev/null
+++ b/patches/source/blueman/blueman.SlackBuild
@@ -0,0 +1,134 @@
+#!/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:-4_slack14.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
+
+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 {} \;
+
+# 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 --verbose || exit 1
+
+zcat $CWD/blueman.CVE-2015-8612.diff.gz | patch -p1 --verbose || exit 1
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./autogen.sh \
+ --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 \
+ --disable-hal \
+ --enable-polkit \
+ --build=$ARCH-slackware-linux
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# 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/patches/source/blueman/doinst.sh b/patches/source/blueman/doinst.sh
new file mode 100644
index 000000000..17b18ef35
--- /dev/null
+++ b/patches/source/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/patches/source/blueman/slack-desc b/patches/source/blueman/slack-desc
new file mode 100644
index 000000000..d9b80088d
--- /dev/null
+++ b/patches/source/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