Merge pull request #4950 from StevenHessing/noddos
[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.47
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
16 PKG_HASH:=cf75bf7cd5d564f21cc4a2bd01d5c39ce425397335fd47d9bbe43af0a58342c8
17
18 PKG_LICENSE:=GPL-2.0+
19 PKG_LICENSE_FILES:=COPYING
20 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
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-examples
34 $(call Package/bluez/Default)
35 SECTION:=utils
36 CATEGORY:=Utilities
37 TITLE+= python example apps
38 DEPENDS:=+python
39 endef
40
41 define Package/bluez-examples/description
42 contains many examples apps for bluetooth, requiring python
43 endef
44
45 define Package/bluez-libs
46 $(call Package/bluez/Default)
47 SECTION:=libs
48 CATEGORY:=Libraries
49 TITLE+= library
50 DEPENDS:=+libpthread +kmod-bluetooth
51 endef
52
53 define Package/bluez-utils
54 $(call Package/bluez/Default)
55 SECTION:=utils
56 CATEGORY:=Utilities
57 TITLE+= utilities
58 DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
59 endef
60
61 define Package/bluez-daemon
62 $(call Package/bluez/Default)
63 SECTION:=utils
64 CATEGORY:=Utilities
65 TITLE+= daemon
66 DEPENDS:=+bluez-libs +bluez-utils +dbus +libical $(INTL_DEPENDS) $(ICONV_DEPENDS)
67 endef
68
69 define Package/bluez-daemon/conffiles
70 /etc/bluetooth/main.conf
71 /etc/bluetooth/network.conf
72 /etc/bluetooth/input.conf
73 /etc/bluetooth/audio.conf
74 /etc/config/bluetooth
75 endef
76
77 CONFIGURE_ARGS += \
78 --enable-static \
79 --enable-shared \
80 --enable-client \
81 --enable-datafiles \
82 --enable-experimental \
83 --enable-library \
84 --enable-monitor \
85 --enable-obex \
86 --enable-threads \
87 --enable-tools \
88 --disable-android \
89 --disable-cups \
90 --disable-manpages \
91 --disable-sixaxis \
92 --disable-systemd \
93 --disable-test \
94 --disable-udev \
95 --enable-deprecated
96
97 TARGET_CPPFLAGS += \
98 -D_GNU_SOURCE
99
100 define Build/InstallDev
101 $(INSTALL_DIR) $(1)/usr/include
102 $(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/
103 $(INSTALL_DIR) $(1)/usr/lib
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.{a,so*} $(1)/usr/lib/
105 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
106 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/
107 endef
108
109 define Package/bluez-examples/install
110 $(INSTALL_DIR) $(1)/usr/bin/bluez
111 $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/* $(1)/usr/bin/bluez/
112 endef
113
114 define Package/bluez-libs/install
115 $(INSTALL_DIR) $(1)/usr/lib
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/
117 endef
118
119 define Package/bluez-utils/install
120 $(INSTALL_DIR) $(1)/usr/bin
121 $(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/
122 $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/
123 $(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/
124 $(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/
125 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/
126 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/
127 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/
128 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/
129 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/
130 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/
131 $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/
132 $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/
133 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/
134 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/
135 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/
136 $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/
137 endef
138
139 define Package/bluez-daemon/install
140 $(INSTALL_DIR) $(1)/usr/bin
141 $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/
142 $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/
143 $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/
144 $(INSTALL_DIR) $(1)/etc/config
145 $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
146 $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
147 $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
148 $(INSTALL_DIR) $(1)/etc/bluetooth
149 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
150 $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
151 $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
152 $(INSTALL_DATA) ./files/audio.conf $(1)/etc/bluetooth/audio.conf
153 $(INSTALL_DIR) $(1)/etc/init.d
154 $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
155 endef
156
157 $(eval $(call BuildPackage,bluez-examples))
158 $(eval $(call BuildPackage,bluez-libs))
159 $(eval $(call BuildPackage,bluez-utils))
160 $(eval $(call BuildPackage,bluez-daemon))