
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:=simple_http_server

include $(INCLUDE_DIR)/package.mk

define Package/simple_http_server
	ECTION:=DYIOT
	CATEGORY:=DYIOT Software
	TITLE:=$(PKG_NAME)
  	DEPENDS:=+python
endef

define Package/simple_http_server/description
  Simple HTTP Server
endef

define Build/Prepare
endef

define Build/Configure
endef

define Build/Compile
endef

define Build/Install
endef

define Package/simple_http_server/install
	$(INSTALL_DIR) $(1)/app/simple_http_server/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./simple_http_server.initd $(1)/etc/init.d/simple_http_server
	$(INSTALL_BIN) ./start_http_server.sh $(1)/app/
	$(CP) ./files/* $(1)/app/simple_http_server/
endef

$(eval $(call BuildPackage,simple_http_server))
