Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=bcca739b792f15414da5a6bd9f62428bf14d59bf

commit bcca739b792f15414da5a6bd9f62428bf14d59bf
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Mon Dec 27 14:47:39 2010 +0100

bluez-4.83-1-i686

- version bump
- add systemd units
- installing udev rules manually is no longer necessary

diff --git a/source/apps/bluez/FrugalBuild b/source/apps/bluez/FrugalBuild
index 8ea5c79..27d0371 100644
--- a/source/apps/bluez/FrugalBuild
+++ b/source/apps/bluez/FrugalBuild
@@ -2,7 +2,7 @@
# Maintainer: Priyank Gosalia <priyan...@gmail.com>

pkgname=bluez
-pkgver=4.81
+pkgver=4.83
pkgrel=1
pkgdesc="Library to use the BlueZ Linux Bluetooth stack"
url="http://bluez.sourceforge.net/";
@@ -11,11 +11,13 @@ groups=('apps')
archs=('i686' 'x86_64' 'ppc')
up2date="Flasttar http://www.bluez.org/download/";
source=(http://www.kernel.org/pub/linux/bluetooth/$pkgname-$pkgver.tar.gz \
-        rc.bluetooth bluetooth.default Fix_netdevgroup.diff)
-sha1sums=('852c79e2af55ca7db4e4dd66a2e98f839464093b' \
+        rc.bluetooth bluetooth.default Fix_netdevgroup.diff \
+        install-systemd-unit-files.patch)
+sha1sums=('4d76b38695fbd4af4ec346fdf6d40d0bfac1c498' \
'c9db2651400cc9261798afcc7e438acffbd2cc37' \
'b54b6eb3606edcbac635f32f94d0afe32091c89f' \
-          '21f7a64b47eb9578c91799a341a3a7ef67d786b6')
+          '21f7a64b47eb9578c91799a341a3a7ef67d786b6' \
+          '00734341bcee052f77a6d3cd7b7ab420b51e2d58')
conflicts=('bluez-utils' 'bluez-libs')
provides=('bluez-utils' 'bluez-libs')
replaces=('bluez-utils' 'bluez-libs')
@@ -25,7 +27,9 @@ backup=(etc/sysconfig/bluetooth etc/bluetooth/rfcomm.conf

build() {
Ffile bluetooth.default /etc/sysconfig/bluetooth
-        Fbuild --enable-serial \
+       Fpatchall
+       Fautoreconf
+       Fmake --enable-serial \
--enable-input \
--enable-audio \
--enable-alsa \
@@ -41,10 +45,9 @@ build() {
--enable-cups \
--enable-configfiles \
--localstatedir=/var \
-               --enable-udevrules
-       Fmkdir /etc/udev/rules.d
-       cd scripts || Fdie
-       Fcprel bluetooth.rules /etc/udev/rules.d/bluetooth.rules
+               --enable-udevrules \
+               --with-systemdsystemunitdir=/lib/systemd/system
+       Fmakeinstall
Frcd2 bluetooth
}

diff --git a/source/apps/bluez/bluez.install b/source/apps/bluez/bluez.install
index 5ea3d4b..d0e5d34 100644
--- a/source/apps/bluez/bluez.install
+++ b/source/apps/bluez/bluez.install
@@ -1,15 +1,28 @@
-# arg 1:  the new package version
post_install()
{
chkconfig --add rc.bluetooth
+       # bluetoothd supports bus activation, no systemctl enable here
+       systemctl daemon-reload >/dev/null 2>&1
+}
+
+post_upgrade()
+{
+       systemctl daemon-reload >/dev/null 2>&1
+       systemctl try-restart bluetooth.service >/dev/null 2>&1
}

-# arg 1:  the old package version
pre_remove()
{
+       systemctl stop bluetooth.service >/dev/null 2>&1
+       systemctl disable bluetooth.service >/dev/null 2>&1
chkconfig --del rc.bluetooth
}

+post_remove()
+{
+       systemctl daemon-reload >/dev/null 2>&1
+}
+
op=$1
shift

diff --git a/source/apps/bluez/install-systemd-unit-files.patch 
b/source/apps/bluez/install-systemd-unit-files.patch
new file mode 100644
index 0000000..d4b905d
--- /dev/null
+++ b/source/apps/bluez/install-systemd-unit-files.patch
@@ -0,0 +1,124 @@
+From d3cf8827053a239009d35995c0e06744d2bd331a Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lenn...@poettering.net>
+Date: Wed, 21 Jul 2010 19:20:44 +0200
+Subject: [PATCH] systemd: install systemd unit files
+
+This also enables bus activation for bluetoothd, but only if systemd is
+running. Only if that's the case we can make sure in a race-free fashion
+that bluetoothd is not started twice at the same time.
+---
+ Makefile.am                  |   21 ++++++++++++++++++---
+ configure.ac                 |    9 +++++++++
+ scripts/.gitignore           |    1 +
+ scripts/bluetooth.service.in |   12 ++++++++++++
+ scripts/org.bluez.service    |    5 +++++
+ 5 files changed, 45 insertions(+), 3 deletions(-)
+ create mode 100644 scripts/.gitignore
+ create mode 100644 scripts/bluetooth.service.in
+ create mode 100644 scripts/org.bluez.service
+
+diff --git a/Makefile.am b/Makefile.am
+index 6044082..3ed5bcc 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -346,7 +346,8 @@ endif
+ CLEANFILES += $(rules_DATA)
+
+ EXTRA_DIST += scripts/bluetooth.rules \
+-              scripts/bluetooth-hid2hci.rules scripts/bluetooth-serial.rules
++              scripts/bluetooth-hid2hci.rules scripts/bluetooth-serial.rules \
++              scripts/bluetooth.service.in scripts/org.bluez.service
+
+ if PCMCIA
+ udevdir = $(libexecdir)/udev
+@@ -354,6 +355,20 @@ udevdir = $(libexecdir)/udev
+ dist_udev_SCRIPTS = scripts/bluetooth_serial
+ endif
+
++if HAVE_SYSTEMD
++systemdsystemunit_DATA = \
++       scripts/bluetooth.service
++
++scripts/bluetooth.service: scripts/bluetooth.service.in
++      @$(SED) -e "s|\...@sbindir\@|$(sbindir)|" $< >$@
++
++dbussystemservicesdir = $(datadir)/dbus-1/system-services
++
++dbussystemservices_DATA = \
++      scripts/org.bluez.service
++
++endif
++
+ EXTRA_DIST += doc/manager-api.txt \
+               doc/adapter-api.txt doc/device-api.txt \
+               doc/service-api.txt doc/agent-api.txt doc/attribute-api.txt \
+@@ -378,9 +393,9 @@ pkgconfigdir = $(libdir)/pkgconfig
+
+ pkgconfig_DATA = bluez.pc
+
+-DISTCHECK_CONFIGURE_FLAGS = --disable-udevrules --enable-attrib
++DISTCHECK_CONFIGURE_FLAGS = --disable-udevrules --enable-attrib 
--with-systemdsystemunitdir=
+
+-DISTCLEANFILES = $(pkgconfig_DATA)
++DISTCLEANFILES = $(pkgconfig_DATA) scripts/bluetooth.service
+
+ MAINTAINERCLEANFILES = Makefile.in \
+       aclocal.m4 configure config.h.in config.sub config.guess \
+diff --git a/configure.ac b/configure.ac
+index 3348ee8..5244f73 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -56,5 +56,14 @@ if (test "${enable_capng}" = "yes"); then
+       AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities 
library.])
+ fi
+
++# systemd
++
++AC_ARG_WITH([systemdsystemunitdir],
++      AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for 
systemd service files]),
++      [],
++      [with_systemdsystemunitdir=$($PKG_CONFIG 
--variable=systemdsystemunitdir systemd)])
++AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
++AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
++
+ AC_OUTPUT(Makefile scripts/bluetooth.rules doc/version.xml
+                                       src/bluetoothd.8 bluez.pc)
+diff --git a/scripts/.gitignore b/scripts/.gitignore
+new file mode 100644
+index 0000000..4b9f765
+--- /dev/null
++++ b/scripts/.gitignore
+@@ -0,0 +1 @@
++bluetooth.service
+diff --git a/scripts/bluetooth.service.in b/scripts/bluetooth.service.in
+new file mode 100644
+index 0000000..f95b0b0
+--- /dev/null
++++ b/scripts/bluetooth.service.in
+@@ -0,0 +1,12 @@
++[Unit]
++Description=Bluetooth Manager
++After=syslog.target
++
++[Service]
++Type=dbus
++BusName=org.bluez
++execsta...@sbindir@/bluetoothd -n
++StandardOutput=syslog
++
++[Install]
++WantedBy=bluetooth.target
+diff --git a/scripts/org.bluez.service b/scripts/org.bluez.service
+new file mode 100644
+index 0000000..2a3b057
+--- /dev/null
++++ b/scripts/org.bluez.service
+@@ -0,0 +1,5 @@
++[D-BUS Service]
++Name=org.bluez
++Exec=/bin/false
++User=root
++SystemdService=bluetooth.service
+--
+1.7.3.2
+
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to