diff --git a/Makefile.am b/Makefile.am
index a6afcac..34ee442 100644
--- a/Makefile.am
+++ b/Makefile.am
bin_PROGRAMS =
-sbin_PROGRAMS =
-
libexec_PROGRAMS =
noinst_PROGRAMS =
endif
endif
+EXTRA_DIST += src/bluetooth.service.in
+
plugindir = $(libdir)/bluetooth/plugins
if MAINTAINER_MODE
plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
endif
-sbin_PROGRAMS += src/bluetoothd
+libexec_PROGRAMS += src/bluetoothd
src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \
$(attrib_sources) $(btio_sources) \
aclocal.m4 configure config.h.in config.sub config.guess \
ltmain.sh depcomp compile missing install-sh mkinstalldirs
+SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
+ < $< > $@
+
+%.service: %.service.in Makefile
+ $(SED_PROCESS)
+
src/builtin.h: src/genbuiltin $(builtin_sources)
$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
diff --git a/bootstrap-configure b/bootstrap-configure
index 6735b3a..d70fead 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
--mandir=/usr/share/man \
--sysconfdir=/etc \
--localstatedir=/var \
- --libexecdir=/lib \
--enable-health \
--enable-tools \
--enable-hid2hci \
diff --git a/configure.ac b/configure.ac
index 4292978..0fc5c65 100644
--- a/configure.ac
+++ b/configure.ac
fi
AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
-AC_OUTPUT(Makefile doc/version.xml src/bluetoothd.8 src/bluetooth.service bluez.pc)
+AC_OUTPUT(Makefile doc/version.xml src/bluetoothd.8 bluez.pc)
diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in
index a8442a9..a3c5487 100644
--- a/src/bluetooth.service.in
+++ b/src/bluetooth.service.in
[Service]
Type=dbus
BusName=org.bluez
-ExecStart=@prefix@/sbin/bluetoothd -n
+ExecStart=@libexecdir@/bluetoothd -n
StandardOutput=null
[Install]