include $(TOPDIR)/rules.mk

VERSION_YEAR=$(shell date +%Y)
VERSION_MAJOR=$(shell expr $(VERSION_YEAR) - 2018)
VERSION_MINOR=$(shell date +%V%u)
#VERSION_REVISION=$(shell date +%H%M)
VERSION_REVISION=0000
PKG_VERSION:=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)

PKG_NAME:=selftest

include $(INCLUDE_DIR)/package.mk

define Package/selftest
	SECTION:=DYIOT
	CATEGORY:=DYIOT Software
	TITLE:=Factory Seft Test
	# DEPENDS:=+libuci +libdyutils +libubox +libmodbus_dy +libipc_session
endef

define Package/selftest/description
	This module is used for factory self-test
endef

define Build/Prepare
endef

define Build/Configure
endef

define Build/Compile
endef

define Build/Install
endef

define Package/selftest/install
	$(INSTALL_DIR) $(1)/app/hmi4rack/script/
	$(INSTALL_DIR) $(1)/app/config/
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_DATA) ./script/* $(1)/app/hmi4rack/script/
	$(INSTALL_BIN) ./files/selftest_lua.initd $(1)/etc/init.d/selftest_lua
	$(INSTALL_CONF) ./config/rs485_port_cfg.json $(1)/app/config/
endef


$(eval $(call BuildPackage,selftest))
