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.

110 lines
3.1 KiB

  1. #
  2. # Copyright (C) 2012-2013 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:=bluelog
  9. PKG_VERSION:=1.1.2
  10. PKG_RELEASE:=4
  11. PKG_SOURCE:=Bluelog-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/MS3FGX/Bluelog/tar.gz/$(PKG_VERSION)?
  13. PKG_HASH:=ebbc1357e14bc46cbddd8390cdbd29c0131b09b8ab680a1c382164ef076cb53e
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/Bluelog-$(PKG_VERSION)
  15. OUI_SOURCE:=oui-2016-05-30.txt.gz
  16. OUI_URL:=https://sources.openwrt.org/
  17. OUI_HASH:=19d0b02eeb0d42507ee17b637a295782c14956fe1ac4803589ed93ef92c4fad5
  18. PKG_LICENSE:=GPL-2.0
  19. PKG_LICENSE_FILES:=COPYING
  20. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  21. PKG_BUILD_PARALLEL:=1
  22. PKG_INSTALL:=1
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/bluelog/Default
  25. SECTION:=utils
  26. CATEGORY:=Utilities
  27. TITLE:=Bluetooth scanner and logger
  28. URL:=https://github.com/MS3FGX/Bluelog
  29. DEPENDS:=+bluez-libs +kmod-bluetooth
  30. endef
  31. define Package/bluelog/Default/description
  32. Bluelog is a simple Bluetooth scanner designed to tell you how many
  33. discoverable devices there are in an area as quickly as possible. It is
  34. intended to be used as a site survey tool, identifying the number of possible
  35. Bluetooth targets there are in the surrounding environment.
  36. endef
  37. define Package/bluelog
  38. $(call Package/bluelog/Default)
  39. endef
  40. define Package/bluelog/description
  41. $(call Package/bluelog/Default/description)
  42. endef
  43. define Package/bluelog-live
  44. $(call Package/bluelog/Default)
  45. TITLE+= (live output)
  46. DEPENDS+= bluelog
  47. endef
  48. define Package/bluelog-live/description
  49. $(call Package/bluelog/Default/description)
  50. This package contains the files for "Bluelog Live", an optional mode of
  51. Bluelog which creates a real-time webpage of discovered Bluetooth devices.
  52. endef
  53. define Download/oui.txt
  54. FILE:=$(OUI_SOURCE)
  55. URL:=$(OUI_URL)
  56. HASH:=$(OUI_HASH)
  57. endef
  58. TARGET_CFLAGS += -DOPENWRT
  59. MAKE_FLAGS += \
  60. LIBS="$(TARGET_LDFLAGS) -lbluetooth -lm"
  61. define Build/Prepare
  62. $(eval $(call Download,oui.txt))
  63. $(Build/Prepare/Default)
  64. zcat $(DL_DIR)/$(OUI_SOURCE) > $(PKG_BUILD_DIR)/oui.tmp
  65. endef
  66. define Package/bluelog/install
  67. $(INSTALL_DIR) $(1)/usr/bin
  68. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bluelog $(1)/usr/bin/
  69. $(INSTALL_DIR) $(1)/etc/init.d
  70. $(INSTALL_BIN) ./files/bluelog.init $(1)/etc/init.d/bluelog
  71. endef
  72. define Package/bluelog-live/install
  73. $(INSTALL_DIR) $(1)/www/bluelog
  74. $(CP) $(PKG_INSTALL_DIR)/usr/share/bluelog/*.html $(1)/www/bluelog/
  75. $(CP) \
  76. $(PKG_INSTALL_DIR)/usr/share/bluelog/openwrt.css \
  77. $(1)/www/bluelog/style.css
  78. $(INSTALL_DIR) $(1)/www/bluelog/images
  79. $(CP) \
  80. $(PKG_INSTALL_DIR)/usr/share/bluelog/images/digifail_logo.png \
  81. $(PKG_INSTALL_DIR)/usr/share/bluelog/images/email.png \
  82. $(PKG_INSTALL_DIR)/usr/share/bluelog/images/favicon.png \
  83. $(PKG_INSTALL_DIR)/usr/share/bluelog/images/openwrt_logo.png \
  84. $(PKG_INSTALL_DIR)/usr/share/bluelog/images/qrcontact.png \
  85. $(1)/www/bluelog/images/
  86. $(INSTALL_DIR) $(1)/www/cgi-bin
  87. $(CP) $(PKG_INSTALL_DIR)/usr/share/bluelog/cgi-bin/* $(1)/www/cgi-bin/
  88. endef
  89. $(eval $(call BuildPackage,bluelog))
  90. $(eval $(call BuildPackage,bluelog-live))