@@ -16,7 +16,7 @@ CLEANFILES =
EXTRA_DIST =
-pkglibexecdir = $(libexecdir)/bluetooth
+pkglibexecdir = @PKGLIBEXECDIR@
pkglibexec_PROGRAMS =
@@ -401,6 +401,24 @@ if (test "${prefix}" = "NONE"); then
prefix="${ac_default_prefix}"
fi
+if (test "${exec_prefix}" = "NONE"); then
+ # exec_prefix defaults to prefix, although our manual handling of the
+ # latter (above) confuses autoconf. Manually set the exec_prefix.
+ exec_prefix="${prefix}"
+fi
+
+# Expand any variables containing relative references like ${prefix} and co.
+#
+# Otherwise we'll end up with literal references in the final binaries or
+# manuals, which is not something we really want.
+
+if (test "$libexecdir" = '${exec_prefix}/libexec'); then
+ pkglibexecdir="${exec_prefix}/libexec/bluetooth"
+else
+ pkglibexecdir="${libexecdir}/bluetooth"
+fi
+AC_SUBST(PKGLIBEXECDIR, "${pkglibexecdir}")
+
if (test "$localstatedir" = '${prefix}/var'); then
storagedir="${prefix}/var/lib/bluetooth"
else
@@ -5,7 +5,7 @@ ConditionPathIsDirectory=/sys/class/bluetooth
[Service]
Type=dbus
BusName=org.bluez.mesh
-ExecStart=@exec_prefix@/bluetooth/bluetooth-meshd
+ExecStart=@PKGLIBEXECDIR@/bluetooth-meshd
NotifyAccess=main
LimitNPROC=1
ProtectHome=true
@@ -4,7 +4,7 @@ Description=Bluetooth OBEX service
[Service]
Type=dbus
BusName=org.bluez.obex
-ExecStart=@exec_prefix@/bluetooth/obexd
+ExecStart=@PKGLIBEXECDIR@/obexd
[Install]
Alias=dbus-org.bluez.obex.service
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.bluez.obex
-Exec=@exec_prefix@/bluetooth/obexd
+Exec=@PKGLIBEXECDIR@/obexd
SystemdService=dbus-org.bluez.obex.service
@@ -6,7 +6,7 @@ ConditionPathIsDirectory=/sys/class/bluetooth
[Service]
Type=dbus
BusName=org.bluez
-ExecStart=@exec_prefix@/bluetooth/bluetoothd
+ExecStart=@PKGLIBEXECDIR@/bluetoothd
NotifyAccess=main
#WatchdogSec=10
#Restart=on-failure
@@ -4,7 +4,7 @@ ConditionPathIsDirectory=/sys/class/bluetooth
[Service]
Type=simple
-ExecStart=@exec_prefix@/bluetooth/btmon-logger -p -b /var/log/bluetooth/hci.log
+ExecStart=@PKGLIBEXECDIR@/btmon-logger -p -b /var/log/bluetooth/hci.log
NotifyAccess=main
CapabilityBoundingSet=CAP_NET_RAW
LimitNPROC=1
From: Emil Velikov <emil.l.velikov@gmail.com> With earlier commit, we've used exec_dir to reference the path of obexd and bluetoothd within the service files. At the same time, in my testing I was providing the complete path on the configure command line. As result, things just worked. In the default case, the variable contains relative references to ${} variables, which as result end up literal in the services. Ultimately the service files were broken. Document are reuse the existing pattern of manually expanding the variables. Closes: https://github.com/bluez/bluez/issues/736 Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com> --- Makefile.am | 2 +- configure.ac | 18 ++++++++++++++++++ mesh/bluetooth-mesh.service.in | 2 +- obexd/src/obex.service.in | 2 +- obexd/src/org.bluez.obex.service.in | 2 +- src/bluetooth.service.in | 2 +- tools/bluetooth-logger.service.in | 2 +- 7 files changed, 24 insertions(+), 6 deletions(-)