#
# Copyright (C) 2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=huaxing_mqtt
PKG_RELEASE:=1
VERSION_YEAR=$(shell date +%Y)
VERSION_MAJOR=$(shell expr $(VERSION_YEAR) - 2018)
VERSION_MINOR=$(shell date +%V%u)
VERSION_REVISION=0000
PKG_VERSION:=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)

# PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/huaxing_mqtt
  SECTION:=DYIOT
  CATEGORY:=DYIOT Software
  TITLE:=Hua Xing MQTT forward application
  DEPENDS:= +lua-mosquitto
endef

define Build/Configure
endef

define Build/Compile
	@echo "Nothing to do to compile huaxing_mqtt" ; exit 0
endef

define Package/huaxing_mqtt/install
	$(INSTALL_DIR) $(1)/app $(1)/etc/init.d
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/huaxing_mqtt.lua $(1)/app/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/huaxing_mqtt.init $(1)/etc/init.d/huaxing_mqtt
endef

$(eval $(call BuildPackage,huaxing_mqtt))
