]> git.pld-linux.org Git - packages/bluez.git/commitdiff
- rel 2; systemd service
authorBartłomiej Zimoń <cactus@pld-linux.org>
Fri, 2 Dec 2011 16:23:45 +0000 (16:23 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bluez-systemd.patch -> 1.1
    bluez.spec -> 1.77

bluez-systemd.patch [new file with mode: 0644]
bluez.spec

diff --git a/bluez-systemd.patch b/bluez-systemd.patch
new file mode 100644 (file)
index 0000000..a036423
--- /dev/null
@@ -0,0 +1,121 @@
+From 0080ce8a37152b0ee7750799e01de3bf810f8caf Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@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 |   13 +++++++++++++
+ scripts/org.bluez.service    |    5 +++++
+ 5 files changed, 46 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 aecc8f2..6e18003 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -387,10 +387,25 @@ endif
+ rules_DATA = $(foreach file,$(udev_files), scripts/97-$(notdir $(file)))
+ 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
++
+ 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
+ EXTRA_DIST += doc/manager-api.txt \
+               doc/adapter-api.txt doc/device-api.txt \
+@@ -417,9 +432,9 @@ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = bluez.pc
+-DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles
++DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --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 bc2658c..b4502ab 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,5 +71,14 @@ if (test -n "${path_systemdunit}"); then
+ fi
+ AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
++# 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 src/bluetooth.service 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..d0089ea
+--- /dev/null
++++ b/scripts/bluetooth.service.in
+@@ -0,0 +1,13 @@
++[Unit]
++Description=Bluetooth Manager
++After=syslog.target
++
++[Service]
++Type=dbus
++BusName=org.bluez
++ExecStart=@sbindir@/bluetoothd -n
++StandardOutput=syslog
++
++[Install]
++WantedBy=bluetooth.target
++Alias=dbus-org.bluez.service
+diff --git a/scripts/org.bluez.service b/scripts/org.bluez.service
+new file mode 100644
+index 0000000..dd7ae8f
+--- /dev/null
++++ b/scripts/org.bluez.service
+@@ -0,0 +1,5 @@
++[D-BUS Service]
++Name=org.bluez
++Exec=/bin/false
++User=root
++SystemdService=dbus-org.bluez.service
+-- 
+1.7.6
+
index 357ca07c4043fb88352cb3416bf9d95e5b552192..959c3f09c59f588651ed7f479bdbf783f35988a4 100644 (file)
@@ -2,7 +2,7 @@ Summary:        Bluetooth utilities
 Summary(pl.UTF-8):     Narzędzia Bluetooth
 Name:          bluez
 Version:       4.96
-Release:       1
+Release:       2
 License:       GPL v2+
 Group:         Applications/System
 #Source0Download: http://www.bluez.org/download.html
@@ -15,6 +15,7 @@ Source4:      pand.init
 Source5:       rfcomm.init
 Patch0:                %{name}-etc_dir.patch
 Patch1:                %{name}-wacom-mode-2.patch
+Patch2:                %{name}-systemd.patch
 URL:           http://www.bluez.org/
 BuildRequires: alsa-lib-devel >= 1.0.10-1
 BuildRequires: autoconf >= 2.60
@@ -169,10 +170,19 @@ Bluetooth applications.
 Ten pakiet zawiera biblioteki statyczne, których można używać do
 aplikacji Bluetooth.
 
+%package systemd
+Summary:       systemd units for bluez
+Group:         Base
+Requires:      %{name} = %{epoch}:%{version}-%{release}
+
+%description systemd
+systemd units for bluez.
+
 %prep
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
@@ -182,6 +192,7 @@ aplikacji Bluetooth.
 %{__automake}
 %configure \
        --with-ouifile=%{_datadir}/hwdata/oui.txt \
+       --with-systemdsystemunitdir=/lib/systemd/system \
        --disable-silent-rules \
        --enable-shared \
        --enable-static \
@@ -342,3 +353,8 @@ fi
 %files libs-static
 %defattr(644,root,root,755)
 %{_libdir}/libbluetooth.a
+
+%files systemd
+%defattr(644,root,root,755)
+/lib/systemd/system/bluetooth.service
+%{_datadir}/dbus-1/system-services/org.bluez.service
This page took 0.15481 seconds and 4 git commands to generate.