]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/bluez5_utils/bluez5_utils.mk
bluez5_utils: Make systemd link correctly
[coffee/buildroot.git] / package / bluez5_utils / bluez5_utils.mk
1 ################################################################################
2 #
3 # bluez5_utils
4 #
5 ################################################################################
6
7 BLUEZ5_UTILS_VERSION = 5.48
8 BLUEZ5_UTILS_SOURCE = bluez-$(BLUEZ5_UTILS_VERSION).tar.xz
9 BLUEZ5_UTILS_SITE = $(BR2_KERNEL_MIRROR)/linux/bluetooth
10 BLUEZ5_UTILS_INSTALL_STAGING = YES
11 BLUEZ5_UTILS_DEPENDENCIES = dbus libglib2
12 BLUEZ5_UTILS_LICENSE = GPL-2.0+, LGPL-2.1+
13 BLUEZ5_UTILS_LICENSE_FILES = COPYING COPYING.LIB
14
15 BLUEZ5_UTILS_CONF_OPTS = \
16         --enable-tools \
17         --enable-library \
18         --disable-cups
19
20 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_OBEX),y)
21 BLUEZ5_UTILS_CONF_OPTS += --enable-obex
22 BLUEZ5_UTILS_DEPENDENCIES += libical
23 else
24 BLUEZ5_UTILS_CONF_OPTS += --disable-obex
25 endif
26
27 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_CLIENT),y)
28 BLUEZ5_UTILS_CONF_OPTS += --enable-client
29 BLUEZ5_UTILS_DEPENDENCIES += readline
30 else
31 BLUEZ5_UTILS_CONF_OPTS += --disable-client
32 endif
33
34 # experimental plugins
35 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL),y)
36 BLUEZ5_UTILS_CONF_OPTS += --enable-experimental
37 else
38 BLUEZ5_UTILS_CONF_OPTS += --disable-experimental
39 endif
40
41 # enable health plugin
42 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_HEALTH),y)
43 BLUEZ5_UTILS_CONF_OPTS += --enable-health
44 else
45 BLUEZ5_UTILS_CONF_OPTS += --disable-health
46 endif
47
48 # enable midi profile
49 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_MIDI),y)
50 BLUEZ5_UTILS_CONF_OPTS += --enable-midi
51 BLUEZ5_UTILS_DEPENDENCIES += alsa-lib
52 else
53 BLUEZ5_UTILS_CONF_OPTS += --disable-midi
54 endif
55
56 # enable nfc plugin
57 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_NFC),y)
58 BLUEZ5_UTILS_CONF_OPTS += --enable-nfc
59 else
60 BLUEZ5_UTILS_CONF_OPTS += --disable-nfc
61 endif
62
63 # enable sap plugin
64 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_SAP),y)
65 BLUEZ5_UTILS_CONF_OPTS += --enable-sap
66 else
67 BLUEZ5_UTILS_CONF_OPTS += --disable-sap
68 endif
69
70 # enable sixaxis plugin
71 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_SIXAXIS),y)
72 BLUEZ5_UTILS_CONF_OPTS += --enable-sixaxis
73 else
74 BLUEZ5_UTILS_CONF_OPTS += --disable-sixaxis
75 endif
76
77 # install gatttool (For some reason upstream choose not to do it by default)
78 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED),y)
79 define BLUEZ5_UTILS_INSTALL_GATTTOOL
80         $(INSTALL) -D -m 0755 $(@D)/attrib/gatttool $(TARGET_DIR)/usr/bin/gatttool
81 endef
82 BLUEZ5_UTILS_POST_INSTALL_TARGET_HOOKS += BLUEZ5_UTILS_INSTALL_GATTTOOL
83 # hciattach_bcm43xx defines default firmware path in `/etc/firmware`, but
84 # Broadcom firmware blobs are usually located in `/lib/firmware`.
85 BLUEZ5_UTILS_CONF_ENV += \
86         CPPFLAGS='$(TARGET_CPPFLAGS) -DFIRMWARE_DIR=\"/lib/firmware\"'
87 BLUEZ5_UTILS_CONF_OPTS += --enable-deprecated
88 else
89 BLUEZ5_UTILS_CONF_OPTS += --disable-deprecated
90 endif
91
92 # enable test
93 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_TEST),y)
94 BLUEZ5_UTILS_CONF_OPTS += --enable-test
95 else
96 BLUEZ5_UTILS_CONF_OPTS += --disable-test
97 endif
98
99 # use udev if available
100 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
101 BLUEZ5_UTILS_CONF_OPTS += --enable-udev
102 BLUEZ5_UTILS_DEPENDENCIES += udev
103 else
104 BLUEZ5_UTILS_CONF_OPTS += --disable-udev
105 endif
106
107 # integrate with systemd if available
108 ifeq ($(BR2_PACKAGE_SYSTEMD),y)
109 BLUEZ5_UTILS_CONF_OPTS += --enable-systemd
110 BLUEZ5_UTILS_DEPENDENCIES += systemd
111 else
112 BLUEZ5_UTILS_CONF_OPTS += --disable-systemd
113 endif
114
115 define BLUEZ5_UTILS_INSTALL_INIT_SYSTEMD
116         mkdir -p $(TARGET_DIR)/etc/systemd/system/bluetooth.target.wants
117         ln -fs ../../../../usr/lib/systemd/system/bluetooth.service \
118                 $(TARGET_DIR)/etc/systemd/system/bluetooth.target.wants/bluetooth.service
119         ln -fs ../../../usr/lib/systemd/system/bluetooth.service \
120                 $(TARGET_DIR)/etc/systemd/system/dbus-org.bluez.service
121 endef
122
123 $(eval $(autotools-package))