gluon/package/gluon-status-page/Makefile

79 lines
2.0 KiB
Makefile
Raw Normal View History

2014-01-29 16:17:49 +00:00
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-status-page
PKG_VERSION:=2
2014-01-29 16:17:49 +00:00
PKG_RELEASE:=1
2014-08-18 12:58:16 +00:00
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS:=node/host
2014-01-29 16:17:49 +00:00
include $(INCLUDE_DIR)/package.mk
2016-07-10 18:08:44 +00:00
RJS_VERSION:=2.1.10
RJS:=r-$(RJS_VERSION).js
2014-08-18 12:58:16 +00:00
define Download/rjs
FILE:=$(RJS)
URL:=http://requirejs.org/docs/release/$(RJS_VERSION)
URL_FILE:=r.js
HASH:=d0b7cfd962a7f8ac52a5d528df486341eed856609d9c75fa2566a32900f5b143
2014-08-18 12:58:16 +00:00
endef
$(eval $(call Download,rjs))
2014-08-18 12:58:16 +00:00
BACON_VERSION:=0.7.71
BACON:=Bacon-$(BACON_VERSION).js
2014-08-18 12:58:16 +00:00
define Download/Bacon
FILE:=$(BACON)
URL:=http://cdnjs.cloudflare.com/ajax/libs/bacon.js/$(BACON_VERSION)
URL_FILE:=Bacon.js
HASH:=93d840d2167964ced7c53598f7d07151c3bfb1d8a7c3e8cff44cadd7dea25f1d
2014-08-18 12:58:16 +00:00
endef
$(eval $(call Download,Bacon))
2014-08-18 12:58:16 +00:00
ALMOND_VERSION:=0.3.1
ALMOND:=almond-$(ALMOND_VERSION).js
2014-08-18 12:58:16 +00:00
define Download/almond
FILE:=$(ALMOND)
URL:=https://raw.githubusercontent.com/jrburke/almond/$(ALMOND_VERSION)
URL_FILE:=almond.js
HASH:=3df2baac13da29dab646f9b9ddd2c5e09d91a49ae3a4f3befb40ce1dd60937f2
2014-08-18 12:58:16 +00:00
endef
$(eval $(call Download,almond))
2014-01-29 16:17:49 +00:00
define Package/gluon-status-page
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Adds a status page showing information about the node.
DEPENDS:=+gluon-status-page-api
2014-01-29 16:17:49 +00:00
endef
define Package/gluon-status-page/description
Adds a status page showing information about the node.
Especially useful in combination with the next-node feature.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) $(DL_DIR)/$(RJS) $(PKG_BUILD_DIR)/r.js
$(CP) $(DL_DIR)/$(BACON) $(PKG_BUILD_DIR)/Bacon.js
$(CP) $(DL_DIR)/$(ALMOND) $(PKG_BUILD_DIR)/almond.js
2014-01-29 16:17:49 +00:00
endef
define Build/Configure
2014-08-18 12:58:16 +00:00
$(CP) ./src/* $(PKG_BUILD_DIR)/
2014-01-29 16:17:49 +00:00
endef
define Build/Compile
2014-08-18 12:58:16 +00:00
cd $(PKG_BUILD_DIR) && \
node r.js -o build.js && \
node r.js -o cssIn=css/main.css out=style.css && \
$(M4) index.html.m4 > index.html
2014-01-29 16:17:49 +00:00
endef
define Package/gluon-status-page/install
2014-08-18 12:58:16 +00:00
$(INSTALL_DIR) $(1)/lib/gluon/status-page/www/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/index.html $(1)/lib/gluon/status-page/www/
2014-01-29 16:17:49 +00:00
endef
$(eval $(call BuildPackage,gluon-status-page))