You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
4.7 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=bluez
  9. PKG_VERSION:=5.37
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
  13. PKG_MD5SUM:=33177e5743e24b2b3738f72be64e3ffb
  14. PKG_LICENSE:=GPL-2.0+
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/nls.mk
  21. define Package/bluez/Default
  22. TITLE:=Bluetooth
  23. URL:=http://www.bluez.org/
  24. endef
  25. define Package/bluez-examples
  26. $(call Package/bluez/Default)
  27. SECTION:=utils
  28. CATEGORY:=Utilities
  29. TITLE+= python example apps
  30. DEPENDS:=+python
  31. endef
  32. define Package/bluez-examples/description
  33. contains many examples apps for bluetooth, requiring python
  34. endef
  35. define Package/bluez-libs
  36. $(call Package/bluez/Default)
  37. SECTION:=libs
  38. CATEGORY:=Libraries
  39. TITLE+= library
  40. DEPENDS:=+libpthread +kmod-bluetooth
  41. endef
  42. define Package/bluez-utils
  43. $(call Package/bluez/Default)
  44. SECTION:=utils
  45. CATEGORY:=Utilities
  46. TITLE+= utilities
  47. DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
  48. endef
  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. define Package/bluez-daemon/conffiles
  57. /etc/bluetooth/main.conf
  58. /etc/bluetooth/network.conf
  59. /etc/bluetooth/input.conf
  60. /etc/bluetooth/proximity.conf
  61. /etc/config/bluetooth
  62. endef
  63. CONFIGURE_ARGS += \
  64. --enable-static \
  65. --enable-shared \
  66. --enable-client \
  67. --enable-datafiles \
  68. --enable-experimental \
  69. --enable-library \
  70. --enable-monitor \
  71. --enable-obex \
  72. --enable-threads \
  73. --enable-tools \
  74. --disable-android \
  75. --disable-cups \
  76. --disable-manpages \
  77. --disable-sixaxis \
  78. --disable-systemd \
  79. --disable-test \
  80. --disable-udev \
  81. TARGET_CPPFLAGS += \
  82. -D_GNU_SOURCE
  83. define Build/InstallDev
  84. $(INSTALL_DIR) $(1)/usr/include
  85. $(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/
  86. $(INSTALL_DIR) $(1)/usr/lib
  87. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.{a,so*} $(1)/usr/lib/
  88. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  89. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/
  90. endef
  91. define Package/bluez-examples/install
  92. $(INSTALL_DIR) $(1)/usr/bin/bluez
  93. $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/* $(1)/usr/bin/bluez/
  94. endef
  95. define Package/bluez-libs/install
  96. $(INSTALL_DIR) $(1)/usr/lib
  97. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/
  98. endef
  99. define Package/bluez-utils/install
  100. $(INSTALL_DIR) $(1)/usr/bin
  101. $(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/
  102. $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/
  103. $(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/
  104. $(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/
  105. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/
  106. $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/
  107. $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/
  108. $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/
  109. $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/
  110. $(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/
  111. $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/
  112. $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/
  113. $(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/
  114. $(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/
  115. $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/
  116. $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/
  117. endef
  118. define Package/bluez-daemon/install
  119. $(INSTALL_DIR) $(1)/usr/bin
  120. $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/
  121. $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/
  122. $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/
  123. $(INSTALL_DIR) $(1)/etc/config
  124. $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
  125. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
  126. $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
  127. $(INSTALL_DIR) $(1)/etc/bluetooth
  128. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
  129. $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
  130. $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
  131. $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf
  132. $(INSTALL_DIR) $(1)/etc/init.d
  133. $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
  134. endef
  135. $(eval $(call BuildPackage,bluez-examples))
  136. $(eval $(call BuildPackage,bluez-libs))
  137. $(eval $(call BuildPackage,bluez-utils))
  138. $(eval $(call BuildPackage,bluez-daemon))