diff --git a/Makefile.am b/Makefile.am
index 5207c17..450e931 100644
--- a/Makefile.am
+++ b/Makefile.am
confdir = $(sysconfdir)/bluetooth
statedir = $(localstatedir)/lib/bluetooth
-install-data-hook:
+bluetoothd-fix-permissions:
install -dm555 $(DESTDIR)$(confdir)
install -dm700 $(DESTDIR)$(statedir)
include android/Makefile.am
include Makefile.mesh
+install-data-hook: bluetoothd-fix-permissions obexd-add-service-symlink
+uninstall-hook: obexd-remove-service-symlink
+
if HID2HCI
rulesdir = $(UDEV_DIR)/rules.d
diff --git a/Makefile.obexd b/Makefile.obexd
index 8145654..0e8bc6d 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
systemduserunitdir = $(SYSTEMD_USERUNITDIR)
systemduserunit_DATA = obexd/src/obex.service
-install-data-hook:
+obexd-add-service-symlink:
$(LN_S) -f obex.service $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service
-uninstall-hook:
+obexd-remove-service-symlink:
rm -f $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service
+else
+obexd-add-service-symlink:
+obexd-remove-service-symlink:
endif
dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
obexd_src_obexd_CFLAGS = $(AM_CFLAGS) -fPIC
+else
+obexd-add-service-symlink:
+obexd-remove-service-symlink:
endif
obexd_src_obexd_SHORTNAME = obexd