mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-15 00:04:29 +08:00
build: Add support for systemd service configuration
This commit is contained in:
parent
c053eac034
commit
7849eeee2a
1
.gitignore
vendored
1
.gitignore
vendored
@ -93,3 +93,4 @@ doc/version.xml
|
||||
doc/xml
|
||||
doc/html
|
||||
src/bluetoothd.8
|
||||
src/bluetooth.service
|
||||
|
@ -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
|
||||
|
11
configure.ac
11
configure.ac
@ -61,5 +61,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)
|
||||
|
12
src/bluetooth.service.in
Normal file
12
src/bluetooth.service.in
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user