--- bluemon-1.4.orig/debian/bluemon.init +++ bluemon-1.4/debian/bluemon.init @@ -0,0 +1,88 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: bluemon +# Required-Start: bluetooth +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 6 +# Short-Description: Bluetooth monitoring daemon +# Description: Debian init script for bluemon +### END INIT INFO +# +# Author: Matthew Johnson +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/bluemon +NAME=bluemon +DESC=bluemon + +test -x $DAEMON || exit 0 +. /lib/lsb/init-functions + +# Include bluemon defaults if available +if [ -f /etc/default/$NAME ] ; then + . /etc/default/$NAME +elif [ -f /etc/$NAME.conf ] ; then + . /etc/$NAME.conf +elif [ -f /etc/$NAME/$NAME.conf ] ; then + . /etc/$NAME/$NAME.conf +fi + +BTIDS="" +for i in $BLUETOOTHID; +do + BTIDS="$BTIDS -b $i" +done + +case "$1" in + start) + log_action_begin_msg "Starting $DESC" + if [ "$BLUEMON_ENABLE" != "yes" ]; then + echo "disabled in /etc/default/bluemon" + exit 0 + fi + start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON -- -t $THRESHOLD $BTIDS -i $INTERVAL $STDOUT $NOFORK $VERBOSE $DISCONNECTHACK $QUALITY + log_action_end_msg $? + ;; + stop) + log_action_begin_msg "Stopping $DESC" + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + --oknodo --exec $DAEMON + log_action_end_msg $? + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # /var/run/$NAME.pid --exec $DAEMON + #;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + log_action_begin_msg "Restarting $DESC" + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + --oknodo --exec $DAEMON + start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON -- -t $THRESHOLD $BTIDS -i $INTERVAL $STDOUT $NOFORK $DISCONNECTHACK $QUALITY + log_action_end_msg $? + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- bluemon-1.4.orig/debian/rules +++ bluemon-1.4/debian/rules @@ -0,0 +1,75 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/quilt/quilt.make + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +build: build-stamp + +build-stamp: patch + dh_testdir + + # Add here commands to compile the package. + $(MAKE) bluemon bluemon-query bluemon.1 bluemon-query.1 bluemon-client bluemon-client.1 bluemon-dbus.7 + + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/bluemon. + $(MAKE) DESTDIR=$(CURDIR)/debian/bluemon install-bin install-readme install-man install-dbus + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install + dh_installinit + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- bluemon-1.4.orig/debian/copyright +++ bluemon-1.4/debian/copyright @@ -0,0 +1,19 @@ +This package was debianized by Matthew Johnson on Tue, +9 Nov 2004 13:28:09 +0000. + +It was downloaded from http://www.matthew.ath.cx/projects/bluemon + +Copyright: + +Upstream Author: Matthew Johnson + +This software is copyright (c) 2004-2006 by Matthew Johnson. + +You are free to distribute this software under the terms of the GNU General +Public License version 2. On Debian systems, the complete text of the GNU +General Public License can be found in the file +`/usr/share/common-licenses/GPL-2'. + +The packaging is copyright (c) 2004-2007 Matthew Johnson + and is also licensed under the terms of the GNU General +Public License version 2. --- bluemon-1.4.orig/debian/compat +++ bluemon-1.4/debian/compat @@ -0,0 +1 @@ +4 --- bluemon-1.4.orig/debian/bluemon.default +++ bluemon-1.4/debian/bluemon.default @@ -0,0 +1,37 @@ +# +# BlueMon sample config file +# + +# Disable bluemon by default, +# WARNING: Enabling bluemon can break other bluetooth applications +# as it hooks on the bluetooth stack with a fake MAC address. +# kbluetoothd is confirmed to stop working if bluemon is enabled. +# Taking this in consideration, you can change 'no' to 'yes' below +# to enable bluemon. +BLUEMON_ENABLE='no' + +# Bluetooth ID of the device to monitor. +# Multiple devices may be separated by spaces. +# EG: BLUETOOTHID='aa:bb:cc:dd:ee:ff 00:00:00:00:00:00:00' +BLUETOOTHID='aa:bb:cc:dd:ee:ff' + +# Signal threshold (out of 255) +THRESHOLD=200 + +# Interval in ms to check the signal +INTERVAL=100 + +# Uncomment to enable link-quality checking +QUALITY=-q + +# Uncomment to log to stdout not to syslog +# STDOUT=-s + +# Uncomment to prevent running in daemon mode +# NOFORK=-n + +# Uncomment to enable verbose output +# VERBOSE=-v + +# Uncomment to enable anti-disconnect hack +# DISCONNECTHACK=-d --- bluemon-1.4.orig/debian/control +++ bluemon-1.4/debian/control @@ -0,0 +1,19 @@ +Source: bluemon +Section: net +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Matthew Johnson +Build-Depends: debhelper (>= 4.0.0), libbluetooth-dev, docbook-to-man, libdbus-1-dev (>= 0.60), pkg-config, quilt (>= 0.40) +Standards-Version: 3.7.3 + +Package: bluemon +Architecture: any +Depends: ${shlibs:Depends}, bluez +Description: Activate or deactivate programs based on Bluetooth link quality + BlueMon monitors the quality of the link to a Bluetooth device and can start + or stop programs when the threshold drops below a certain value. This can be + used to perform actions like locking the terminal when you walk away from it. + . + Bluemon uses the DBus system bus to alert other applications to the presence + of Bluetooth devices. A user binary can then start or stop programs when such + signals are received. --- bluemon-1.4.orig/debian/prerm +++ bluemon-1.4/debian/prerm @@ -0,0 +1,31 @@ +#! /bin/sh +# prerm script for bluemon +# +# see: dh_installdeb(1) + +set -e + +case "$1" in + failed-upgrade) + # exit when upgrading from broken version as init.d + # script is not replaced is. + if dpkg --compare-versions "$2" lt "1.3-1.2" ; then + exit 0 + fi + ;; + upgrade|remove|deconfigure) + ;; + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- bluemon-1.4.orig/debian/changelog +++ bluemon-1.4/debian/changelog @@ -0,0 +1,116 @@ +bluemon (1.4-6ubuntu1) oneiric; urgency=low + + * debian/patches/ftbfs-as-needed.diff: (LP: #765921) + - move LIBS after object/sources to fix FTBFS + + -- Andreas Moog Sun, 19 Jun 2011 18:42:54 +0000 + +bluemon (1.4-6) unstable; urgency=low + + * Change dependency bluez-utils => bluez (Closes: #534315) + * Change build-dep libbluetooth2-dev => libbluetooth-dev (Closes: #530353) + * Dummy closes to mark bug which was fixed ages ago an fixed here (Closes: #399021) + + -- Matthew Johnson Thu, 25 Jun 2009 08:21:00 +0100 + +bluemon (1.4-5) unstable; urgency=high + + * Add fix-system-bus-permissions.diff so that it works + with the fixed dbus (Closes: #510628) + * Urgency high because it blocks #503532 + * Adding a dependency on quilt to apply the patch + + -- Matthew Johnson Sat, 03 Jan 2009 21:31:53 +0000 + +bluemon (1.4-4) unstable; urgency=low + + * Bump Standards-Version + + -- Matthew Johnson Tue, 05 Feb 2008 09:28:01 +0000 + +bluemon (1.4-3) unstable; urgency=low + + * Update copyright + * Ensure init.d-script-missing-lsb-section fix is actually included this + time... + * Remove superfluous files. + * Update maintainer address + + -- Matthew Johnson Wed, 05 Dec 2007 10:24:56 +0000 + +bluemon (1.4-2) unstable; urgency=low + + * Fix init.d-script-missing-lsb-section + * Use lsb-functions in init script + + -- Matthew Johnson Mon, 27 Nov 2006 13:19:41 +0000 + +bluemon (1.4-1) unstable; urgency=low + + * New Upstream Release + * Don't enable by default. (Closes: #392260) + Patch from Jeroen van Wolffelaar + * Starting with default config file confirmed working + (Closes: #359240) + + -- Matthew Johnson Tue, 14 Nov 2006 13:36:50 +0000 + +bluemon (1.3-1.2) unstable; urgency=medium + + * Non-maintainer upload. + * Don't fail when bluemon is already stopped. (Closes: #387433) + + -- Arjan Oosting Fri, 29 Sep 2006 20:18:47 +0200 +bluemon (1.3-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix dependency from libbluetooth1 to libbluetooth2. (closes: #376875) + * Bump standards version + + -- Julien Danjou Tue, 11 Jul 2006 13:43:16 +0200 +bluemon (1.3-1) unstable; urgency=low + + * New Upstream Release: + - bug fixes + Closes: #348693: manpage misplaced + Closes: #349791: Does not have DBus privileges to start + * Clarify description + Closes: #348691: bluemon description could mention dbus + + -- Matthew Johnson Wed, 25 Jan 2006 10:23:50 +0000 + +bluemon (1.2-1) unstable; urgency=low + + * New Upstream Release: + - Added support for monitoring multiple devices, disabling of link quality + monitoring and defaults for threshold and interval + + -- Matthew Johnson Mon, 9 Jan 2006 14:50:24 +0000 + +bluemon (1.1-1) unstable; urgency=low + + * New Upstream Release: + - DBUS integration, Separate client and server binaries, + fix for disconnects + + -- matthew johnson Tue, 1 Nov 2005 14:20:04 +0000 + +bluemon (1.0-1) unstable; urgency=low + + * Released version 1.0, documentation and build fixes. + + -- Matthew Johnson Tue, 18 Oct 2005 12:45:24 +0100 + +bluemon (0.02-1) unstable; urgency=low + + * New Upstream Release: + - Many fixes and upgrades, Query infrastructure. + + -- Matthew Johnson Wed, 13 Apr 2005 08:40:42 +0100 + +bluemon (0.01-1) unstable; urgency=low + + * Initial Release. + + -- Matthew Johnson Tue, 9 Nov 2004 13:28:09 +0000 + --- bluemon-1.4.orig/debian/watch +++ bluemon-1.4/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.matthew.ath.cx/projects/bluemon (?:.*/)?bluemon-?_?([\d+\.]+|\d+)\.tar.* debian uupdate --- bluemon-1.4.orig/debian/dirs +++ bluemon-1.4/debian/dirs @@ -0,0 +1 @@ +usr/sbin --- bluemon-1.4.orig/debian/README.Debian +++ bluemon-1.4/debian/README.Debian @@ -0,0 +1,8 @@ +bluemon for Debian +------------------ + +Config for the init script is in /etc/default/bluemon. The config is read by +the init script and passed to the program as parameters, not read by the +program directly. + + -- Matthew Johnson , Tue, 9 Nov 2004 13:28:09 +0000 --- bluemon-1.4.orig/debian/preinst +++ bluemon-1.4/debian/preinst @@ -0,0 +1,44 @@ +#! /bin/sh +# preinst script for bluemon +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + if [ "$1" = "upgrade" ] + then + start-stop-daemon --stop --quiet --oknodo \ + --pidfile /var/run/bluemon.pid \ + --exec /usr/sbin/bluemon 2>/dev/null || true + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- bluemon-1.4.orig/debian/patches/series +++ bluemon-1.4/debian/patches/series @@ -0,0 +1,2 @@ +fix-system-bus-permissions.diff +ftbfs-as-needed.diff --- bluemon-1.4.orig/debian/patches/ftbfs-as-needed.diff +++ bluemon-1.4/debian/patches/ftbfs-as-needed.diff @@ -0,0 +1,23 @@ +Description: Libs go after objects and sources else + ld doesn't include them with flag --as-needed. +Bug-Ubuntu: https://launchpad.net/bugs/765921 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612181 +Author: Andreas Moog + +--- bluemon.orig/Makefile ++++ bluemon/Makefile +@@ -20,11 +20,11 @@ + echo $(DEB_RELEASE) + + bluemon: bluetooth-monitor.c +- $(CC) $(CFLAGS) $(INCLUDES) $(LIBS) -DVERSION=\"$(VERSION)\" -o $@ $< ++ $(CC) $(CFLAGS) $(INCLUDES) -DVERSION=\"$(VERSION)\" -o $@ $< $(LIBS) + bluemon-query: bluemon-query.c +- $(CC) $(CFLAGS) $(INCLUDES) $(LIBS) -DVERSION=\"$(VERSION)\" -o $@ $< ++ $(CC) $(CFLAGS) $(INCLUDES) -DVERSION=\"$(VERSION)\" -o $@ $< $(LIBS) + bluemon-client: bluemon-client.c +- $(CC) $(CFLAGS) $(INCLUDES) $(LIBS) -DVERSION=\"$(VERSION)\" -o $@ $< ++ $(CC) $(CFLAGS) $(INCLUDES) -DVERSION=\"$(VERSION)\" -o $@ $< $(LIBS) + + %.1: %.sgml + docbook-to-man $< > $@ --- bluemon-1.4.orig/debian/patches/fix-system-bus-permissions.diff +++ bluemon-1.4/debian/patches/fix-system-bus-permissions.diff @@ -0,0 +1,25 @@ +This patch fixes the permission file for talking on the system bus. +Has always been broken, but wasn't noticed because the system bus +was allowing things anyway. This ensures that introspection is also +allowed. +--- bluemon-1.4/bluemon-dbus.conf.old 2009-01-03 21:14:39.096906916 +0000 ++++ bluemon-1.4/bluemon-dbus.conf 2009-01-03 21:15:33.122191802 +0000 +@@ -7,15 +7,14 @@ + + + ++ + + + + ++ + +- +- +- +- ++ + + +