build: rework {install-data,uninstall}-hook

Currently autoconfigure throws a useful error, about a duplicate
install-data-hook.

Address that by making the two target specific and pulling them as
dependencies.

We have to create empty ones otherwise dependency tracking and
resolution will fail.
This commit is contained in:
Emil Velikov 2024-02-16 23:11:05 +00:00 committed by Luiz Augusto von Dentz
parent f79ccf6c42
commit 9fe4ccb79f
2 changed files with 12 additions and 3 deletions

View File

@ -31,7 +31,7 @@ AM_LDFLAGS = $(MISC_LDFLAGS)
confdir = $(sysconfdir)/bluetooth
statedir = $(localstatedir)/lib/bluetooth
install-data-hook:
bluetoothd-fix-permissions:
install -dm555 $(DESTDIR)$(confdir)
install -dm700 $(DESTDIR)$(statedir)
@ -422,6 +422,9 @@ include Makefile.obexd
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

View File

@ -3,11 +3,14 @@ if SYSTEMD
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)
@ -102,6 +105,9 @@ obexd_src_obexd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \
obexd_src_obexd_CFLAGS = $(AM_CFLAGS) -fPIC
else
obexd-add-service-symlink:
obexd-remove-service-symlink:
endif
obexd_src_obexd_SHORTNAME = obexd