[PATCH BlueZ] tools/mpris-proxy: Ship systemd unit file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 .gitignore                   |  1 +
 Makefile.am                  |  4 ++++
 Makefile.obexd               |  3 +--
 Makefile.tools               |  8 ++++++++
 tools/mpris-proxy.service.in | 11 +++++++++++
 5 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 tools/mpris-proxy.service.in

diff --git a/.gitignore b/.gitignore
index 9c8393a81..a34dd27f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -84,6 +84,7 @@ tools/nokfw
 tools/rtlfw
 tools/btiotest
 tools/mpris-proxy
+tools/mpris-proxy.service
 tools/bluetooth-player
 tools/l2cap-tester
 tools/sco-tester
diff --git a/Makefile.am b/Makefile.am
index 497f05f06..7a508404e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,6 +42,9 @@ if SYSTEMD
 systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
 systemdsystemunit_DATA = src/bluetooth.service
 
+systemduserunitdir = $(SYSTEMD_USERUNITDIR)
+systemduserunit_DATA =
+
 dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
 dbussystembus_DATA = src/org.bluez.service
 endif
@@ -617,6 +620,7 @@ MAINTAINERCLEANFILES = Makefile.in \
 
 SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
 		$(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
+		       -e 's,@bindir\@,$(bindir),g' \
 		< $< > $@
 
 if RUN_RST2MAN
diff --git a/Makefile.obexd b/Makefile.obexd
index 6f5dc04c0..1e3f51296 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 if SYSTEMD
-systemduserunitdir = $(SYSTEMD_USERUNITDIR)
-systemduserunit_DATA = obexd/src/obex.service
+systemduserunit_DATA += obexd/src/obex.service
 
 dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
 dbussessionbus_DATA = obexd/src/org.bluez.obex.service
diff --git a/Makefile.tools b/Makefile.tools
index c836b5984..c98228de5 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -290,6 +290,14 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c
 
 tools_mpris_proxy_SOURCES = tools/mpris-proxy.c
 tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS) $(DBUS_LIBS)
+tools_mpris_proxy_DEPENDENCIES = tools/mpris-proxy.service
+
+if SYSTEMD
+systemduserunit_DATA += tools/mpris-proxy.service
+endif
+
+CLEANFILES += tools/mpris-proxy.service
+EXTRA_DIST += tools/mpris-proxy.service.in
 
 tools_gatt_service_SOURCES = tools/gatt-service.c
 tools_gatt_service_LDADD = $(GLIB_LIBS) $(DBUS_LIBS) gdbus/libgdbus-internal.la
diff --git a/tools/mpris-proxy.service.in b/tools/mpris-proxy.service.in
new file mode 100644
index 000000000..c52450f4f
--- /dev/null
+++ b/tools/mpris-proxy.service.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=Bluetooth to MPRIS proxy
+
+[Service]
+Type=simple
+ExecStart=@bindir@/mpris-proxy
+NotifyAccess=main
+LimitNPROC=1
+
+[Install]
+WantedBy=bluetooth.target

base-commit: fa57cb68e13ea4a6cff5532830008d44254e7e83
-- 
2.31.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux