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:=dy_reset_button

include $(INCLUDE_DIR)/package.mk

define Package/dy_reset_button
	SECTION:=DYIOT
	CATEGORY:=DYIOT Software
	TITLE:=process for reset button control
	DEPENDS:= +libdyutils +libuci +libsqlite3 +paho_mqtt +zlib +libopenssl +liblua python +libubox
endef

define Package/dy_reset_button/description
	control the reset button logic
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

define Package/dy_reset_button/install
	$(INSTALL_DIR) $(1)/app/
	$(INSTALL_DIR) $(1)/etc/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/dy_reset_button $(1)/app/
	$(INSTALL_BIN) ./files/reset_button $(1)/etc/init.d/reset_button
endef


$(eval $(call BuildPackage,dy_reset_button))

