include $(TOPDIR)/rules.mk
include $(TOPDIR)/draytek_include/draytek_info

PKG_NAME:=tacc
PKG_VERSION:=1.7
PKG_RELEASE:=1
PKG_LICENSE:=GPLv2
PKG_FIXUP:=autoreconf -ivf
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)/extra_provides
    		echo "libcrypto.so.1.1";\
			echo "libutil.so.1";
endef
define Package/tacc
	SECTION:=apps
	CATEGORY:=DrayOS5
	SUBMENU:=System
	TITLE:= simple TACACS+ client tool
	DEPENDS:=
endef

define Package/tacc/description
	simple TACACS+ client and login utility
endef

define Build/Prepare
$(call Build/Prepare/Default)
endef

ifeq ($(findstring an758,$(DRAY_PLATFORM)),an758)
CONFIGURE_VARS += CFLAGS+="-fcommon"
TARGET_CFLAGS += -D_DRAYTEK_PATCH
endif

define Build/Configure
	$(call Build/Configure/Default)
endef

define Build/Compile
	$(call Build/Compile/Default)
endef

define Package/tacc/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tacc $(1)/usr/bin/
endef

$(eval $(call BuildPackage,tacc))
