Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=gluon-status-page
  3. PKG_VERSION:=2
  4. PKG_RELEASE:=1
  5. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
  6. PKG_BUILD_DEPENDS:=node/host
  7. include $(INCLUDE_DIR)/package.mk
  8. RJS_VERSION:=2.1.10
  9. RJS:=r-$(RJS_VERSION).js
  10. define Download/rjs
  11. FILE:=$(RJS)
  12. URL:=http://requirejs.org/docs/release/$(RJS_VERSION)
  13. URL_FILE:=r.js
  14. HASH:=d0b7cfd962a7f8ac52a5d528df486341eed856609d9c75fa2566a32900f5b143
  15. endef
  16. $(eval $(call Download,rjs))
  17. BACON_VERSION:=0.7.71
  18. BACON:=Bacon-$(BACON_VERSION).js
  19. define Download/Bacon
  20. FILE:=$(BACON)
  21. URL:=http://cdnjs.cloudflare.com/ajax/libs/bacon.js/$(BACON_VERSION)
  22. URL_FILE:=Bacon.js
  23. HASH:=93d840d2167964ced7c53598f7d07151c3bfb1d8a7c3e8cff44cadd7dea25f1d
  24. endef
  25. $(eval $(call Download,Bacon))
  26. ALMOND_VERSION:=0.3.1
  27. ALMOND:=almond-$(ALMOND_VERSION).js
  28. define Download/almond
  29. FILE:=$(ALMOND)
  30. URL:=https://raw.githubusercontent.com/jrburke/almond/$(ALMOND_VERSION)
  31. URL_FILE:=almond.js
  32. HASH:=3df2baac13da29dab646f9b9ddd2c5e09d91a49ae3a4f3befb40ce1dd60937f2
  33. endef
  34. $(eval $(call Download,almond))
  35. define Package/gluon-status-page
  36. SECTION:=gluon
  37. CATEGORY:=Gluon
  38. TITLE:=Adds a status page showing information about the node.
  39. DEPENDS:=+gluon-status-page-api
  40. endef
  41. define Package/gluon-status-page/description
  42. Adds a status page showing information about the node.
  43. Especially useful in combination with the next-node feature.
  44. endef
  45. define Build/Prepare
  46. mkdir -p $(PKG_BUILD_DIR)
  47. $(CP) $(DL_DIR)/$(RJS) $(PKG_BUILD_DIR)/r.js
  48. $(CP) $(DL_DIR)/$(BACON) $(PKG_BUILD_DIR)/Bacon.js
  49. $(CP) $(DL_DIR)/$(ALMOND) $(PKG_BUILD_DIR)/almond.js
  50. endef
  51. define Build/Configure
  52. $(CP) ./src/* $(PKG_BUILD_DIR)/
  53. endef
  54. define Build/Compile
  55. cd $(PKG_BUILD_DIR) && \
  56. node r.js -o build.js && \
  57. node r.js -o cssIn=css/main.css out=style.css && \
  58. $(M4) index.html.m4 > index.html
  59. endef
  60. define Package/gluon-status-page/install
  61. $(INSTALL_DIR) $(1)/lib/gluon/status-page/www/
  62. $(INSTALL_DATA) $(PKG_BUILD_DIR)/index.html $(1)/lib/gluon/status-page/www/
  63. endef
  64. $(eval $(call BuildPackage,gluon-status-page))