#
# Copyright (C) 2022 Teltonika
#

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/download.mk

PKG_NAME:=tswconfig
PKG_VERSION:=2026-03-20
PKG_RELEASE:=1
PKG_LICENSE:=Teltonika-closed

PKG_SOURCE_VERSION:=1.4.14
include $(INCLUDE_DIR)/package.mk
# set to 1 to enable debugging
# DEBUG=1


define Package/tswconfig
  SECTION:=examples
  CATEGORY:=Examples
  TITLE:=tswconfig
  DEPENDS:=+libubus +libubox +libuci +librtusr +liblog
endef


define Package/tswconfig/description
  tswconfig application
endef


define Package/tswconfig/install
	$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/uci-defaults/1.8/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tswconfig $(1)/usr/bin
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/tswconfig.init $(1)/etc/init.d/tswconfig
	$(INSTALL_DIR) $(1)/sbin
	$(INSTALL_BIN) ./files/99_remove_auth_enable_from_tswconfig $(1)/etc/uci-defaults/1.8/99_remove_auth_enable_from_tswconfig
	$(INSTALL_BIN) ./files/bridge-stp $(1)/sbin/bridge-stp
endef

$(eval $(call BuildPackage,tswconfig))
