Merge pull request #9466 from mstorchak/tgt2
[feed/packages.git] / utils / bluez / Makefile
1 #
2 # Copyright (C) 2006-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=bluez
11 PKG_VERSION:=5.50
12 PKG_RELEASE:=4
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
16 PKG_HASH:=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
17
18 PKG_LICENSE:=GPL-2.0+
19 PKG_LICENSE_FILES:=COPYING
20 PKG_MAINTAINER:=
21
22 PKG_BUILD_PARALLEL:=1
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/nls.mk
27
28 define Package/bluez/Default
29 TITLE:=Bluetooth
30 URL:=http://www.bluez.org/
31 endef
32
33 define Package/bluez-libs
34 $(call Package/bluez/Default)
35 SECTION:=libs
36 CATEGORY:=Libraries
37 TITLE+= library
38 DEPENDS:=+libpthread +USB_SUPPORT:kmod-bluetooth
39 endef
40
41 define Package/bluez-utils
42 $(call Package/bluez/Default)
43 SECTION:=utils
44 CATEGORY:=Utilities
45 TITLE+= utilities
46 DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS) +dbus
47 endef
48
49 define Package/bluez-daemon
50 $(call Package/bluez/Default)
51 SECTION:=utils
52 CATEGORY:=Utilities
53 TITLE+= daemon
54 DEPENDS:=+bluez-libs +bluez-utils +dbus +libical $(INTL_DEPENDS) $(ICONV_DEPENDS)
55 endef
56
57 define Package/bluez-daemon/conffiles
58 /etc/bluetooth/main.conf
59 /etc/bluetooth/network.conf
60 /etc/bluetooth/input.conf
61 /etc/bluetooth/keys
62 /etc/config/bluetooth
63 endef
64
65 TARGET_CFLAGS += -D_GNU_SOURCE -ffunction-sections -fdata-sections
66 TARGET_LDFLAGS += -Wl,--gc-sections
67
68 CONFIGURE_ARGS += \
69 --enable-static \
70 --enable-shared \
71 --enable-client \
72 --enable-datafiles \
73 --enable-experimental \
74 --enable-library \
75 --enable-monitor \
76 --enable-obex \
77 --enable-threads \
78 --enable-tools \
79 --disable-android \
80 --disable-cups \
81 --disable-manpages \
82 --disable-sixaxis \
83 --disable-systemd \
84 --disable-test \
85 --disable-udev \
86 --enable-deprecated
87
88 define Build/InstallDev
89 $(INSTALL_DIR) $(1)/usr/include
90 $(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/
91 $(INSTALL_DIR) $(1)/usr/lib
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.{a,so*} $(1)/usr/lib/
93 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
94 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/
95 endef
96
97 define Package/bluez-libs/install
98 $(INSTALL_DIR) $(1)/usr/lib
99 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/
100 endef
101
102 define Package/bluez-utils/install
103 $(INSTALL_DIR) $(1)/usr/bin
104 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/bdaddr $(1)/usr/bin/
105 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/
106 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/
107 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/btattach $(1)/usr/bin/
108 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/
109 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/
110 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/
111 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/
112 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/
113 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/
114 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/
115 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/
116 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/
117 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/
118 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpris-proxy $(1)/usr/bin/
119 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/
120 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/
121 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/
122 $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/
123 endef
124
125 define Package/bluez-daemon/install
126 $(INSTALL_DIR) $(1)/usr/bin
127 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/
128 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/
130 $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
131 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bluetooth.conf $(1)/etc/dbus-1/system.d/bluetooth.conf
132 $(INSTALL_DIR) $(1)/etc/bluetooth
133 $(INSTALL_DIR) $(1)/etc/bluetooth/keys
134 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
135 $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
136 $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
137 $(INSTALL_DIR) $(1)/etc/init.d
138 $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
139 endef
140
141 $(eval $(call BuildPackage,bluez-libs))
142 $(eval $(call BuildPackage,bluez-utils))
143 $(eval $(call BuildPackage,bluez-daemon))