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

include $(INCLUDE_DIR)/package.mk

define Package/pcie_rst
	SECTION:=DYIOT
	CATEGORY:=DYIOT Software
	TITLE:=gw lora utilities
	DEPENDS:=+libsqlite3 +paho_mqtt +zlib +libopenssl
endef

define Package/pcie_rst/description
	pcie_rst to communicate to HM
endef

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

define Package/pcie_rst/install
	$(INSTALL_DIR) $(1)/app/
	$(INSTALL_DIR) $(1)/bin/
	$(INSTALL_DIR) $(1)/lib/
	$(INSTALL_DIR) $(1)/usr/lib/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/pcie_rst $(1)/bin/

endef


$(eval $(call BuildPackage,pcie_rst))
