Makefile (4826B)
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.38 12 PKG_RELEASE:=1 13 14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz 15 PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ 16 PKG_MD5SUM:=dae2ed00c63791800ea7d10a381270a5 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/proximity.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 96 TARGET_CPPFLAGS += \ 97 -D_GNU_SOURCE 98 99 define Build/InstallDev 100 $(INSTALL_DIR) $(1)/usr/include 101 $(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/ 102 $(INSTALL_DIR) $(1)/usr/lib 103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.{a,so*} $(1)/usr/lib/ 104 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig 105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/ 106 endef 107 108 define Package/bluez-examples/install 109 $(INSTALL_DIR) $(1)/usr/bin/bluez 110 $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/* $(1)/usr/bin/bluez/ 111 endef 112 113 define Package/bluez-libs/install 114 $(INSTALL_DIR) $(1)/usr/lib 115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/ 116 endef 117 118 define Package/bluez-utils/install 119 $(INSTALL_DIR) $(1)/usr/bin 120 $(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/ 121 $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/ 122 $(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/ 123 $(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/ 124 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/ 125 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/ 126 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/ 127 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/ 128 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/ 129 $(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/ 130 $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/ 131 $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/ 132 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/ 133 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/ 134 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/ 135 $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/ 136 endef 137 138 define Package/bluez-daemon/install 139 $(INSTALL_DIR) $(1)/usr/bin 140 $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/ 141 $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/ 142 $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/ 143 $(INSTALL_DIR) $(1)/etc/config 144 $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth 145 $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/ 146 $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf 147 $(INSTALL_DIR) $(1)/etc/bluetooth 148 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf 149 $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf 150 $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf 151 $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf 152 $(INSTALL_DIR) $(1)/etc/init.d 153 $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd 154 endef 155 156 $(eval $(call BuildPackage,bluez-examples)) 157 $(eval $(call BuildPackage,bluez-libs)) 158 $(eval $(call BuildPackage,bluez-utils)) 159 $(eval $(call BuildPackage,bluez-daemon))