Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v2] build: Add support for systemd service configuration
@ 2011-06-17  1:46 Lucas De Marchi
  2011-06-17  4:15 ` Marcel Holtmann
  2011-06-22 11:13 ` Bastien Nocera
  0 siblings, 2 replies; 8+ messages in thread
From: Lucas De Marchi @ 2011-06-17  1:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 .gitignore               |    1 +
 Makefile.am              |    8 +++++++-
 configure.ac             |   11 ++++++++++-
 src/bluetooth.service.in |   12 ++++++++++++
 4 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 src/bluetooth.service.in

diff --git a/.gitignore b/.gitignore
index 2ef7cb5..2ce99e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -93,3 +93,4 @@ doc/version.xml
 doc/xml
 doc/html
 src/bluetoothd.8
+src/bluetooth.service
diff --git a/Makefile.am b/Makefile.am
index 4659c80..85f3d5f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,6 +35,12 @@ conf_DATA =
 statedir = $(localstatedir)/lib/bluetooth
 
 state_DATA =
+
+if SYSTEMD
+systemdunitdir = @SYSTEMD_UNITDIR@
+
+systemdunit_DATA = src/bluetooth.service
+endif
 endif
 
 plugindir = $(libdir)/bluetooth/plugins
@@ -385,7 +391,7 @@ pkgconfigdir = $(libdir)/pkgconfig
 
 pkgconfig_DATA = bluez.pc
 
-DISTCHECK_CONFIGURE_FLAGS = --disable-udevrules
+DISTCHECK_CONFIGURE_FLAGS = --disable-udevrules --with-systemdunitdir=
 
 DISTCLEANFILES = $(pkgconfig_DATA)
 
diff --git a/configure.ac b/configure.ac
index 2ce4acf..138a38f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,5 +57,14 @@ if (test "${enable_capng}" = "yes"); then
 	AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
 fi
 
+AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
+	[path to systemd system service directory]), [path_systemdunit=${withval}],
+		[path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
+if (test -n "${path_systemdunit}"); then
+	SYSTEMD_UNITDIR="${path_systemdunit}"
+	AC_SUBST(SYSTEMD_UNITDIR)
+fi
+AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
+
 AC_OUTPUT(Makefile scripts/bluetooth.rules doc/version.xml
-					src/bluetoothd.8 bluez.pc)
+			src/bluetoothd.8 src/bluetooth.service bluez.pc)
diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in
new file mode 100644
index 0000000..02b6707
--- /dev/null
+++ b/src/bluetooth.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Bluetooth service
+After=syslog.target
+
+[Service]
+Type=dbus
+BusName=org.bluez
+ExecStart=@prefix@/sbin/bluetoothd -n
+StandardOutput=syslog
+
+[Install]
+WantedBy=bluetooth.target
-- 
1.7.5.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-07-02  2:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17  1:46 [PATCH v2] build: Add support for systemd service configuration Lucas De Marchi
2011-06-17  4:15 ` Marcel Holtmann
2011-06-17 11:51   ` Lucas De Marchi
2011-06-30 19:44     ` Marcel Holtmann
2011-07-01 22:45       ` Lucas De Marchi
2011-07-02  2:38         ` Marcel Holtmann
2011-06-22 11:13 ` Bastien Nocera
2011-07-01 22:43   ` Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox