diff --git a/Makefile.am b/Makefile.am
index 68bf058..88044aa 100644
--- a/Makefile.am
+++ b/Makefile.am
systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
systemdsystemunit_DATA = src/bluetooth.service
+systemduserunitdir = $(SYSTEMD_USERUNITDIR)
+systemduserunit_DATA =
+
dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
dbussystembus_DATA = src/org.bluez.service
endif
diff --git a/Makefile.obexd b/Makefile.obexd
index b7e9f2d..4cdce73 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
if OBEX
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 5b90340..48bc47b 100644
--- a/Makefile.tools
+++ b/Makefile.tools
tools_mpris_proxy_SOURCES = tools/mpris-proxy.c
tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS) $(DBUS_LIBS)
+if SYSTEMD
+systemduserunit_DATA += tools/mpris-proxy.service
+endif
tools_gatt_service_SOURCES = tools/gatt-service.c
tools_gatt_service_LDADD = gdbus/libgdbus-internal.la \
diff --git a/configure.ac b/configure.ac
index a7fb51f..790a195 100644
--- a/configure.ac
+++ b/configure.ac
#
# Otherwise we'll end up with literal references in the final binaries or
# manuals, which is not something we really want.
+#
+pkgbindir="${bindir}"
+if (test "$bindir" = '${exec_prefix}/bin'); then
+ pkgbindir="${exec_prefix}/bin"
+else
+ pkgbindir="${bindir}"
+fi
+AC_SUBST(PKGBINDIR, "${pkgbindir}")
if (test "$libexecdir" = '${exec_prefix}/libexec'); then
pkglibexecdir="${exec_prefix}/libexec/bluetooth"
src/bluetoothd.rst
src/bluetooth.service
tools/bluetooth-logger.service
+ tools/mpris-proxy.service
)
AC_OUTPUT
diff --git a/tools/mpris-proxy.service.in b/tools/mpris-proxy.service.in
new file mode 100644
index 0000000..5307490
--- /dev/null
+++ b/tools/mpris-proxy.service.in
+[Unit]
+Description=Bluetooth mpris proxy
+Documentation=man:mpris-proxy(1)
+
+Wants=dbus.socket
+After=dbus.socket
+
+[Service]
+Type=simple
+ExecStart=@PKGBINDIR@/mpris-proxy
+
+[Install]
+WantedBy=default.target