#
# Copyright (c) 2014 Technicolor
# All Rights Reserved
#
# This program contains proprietary information which is a trade
# secret of TECHNICOLOR and/or its affiliates and also is protected as
# an unpublished work under applicable Copyright laws. Recipient is
# to retain this program in confidence and is not permitted to use or
# make copies thereof other than as permitted in a written agreement
# with TECHNICOLOR, UNLESS OTHERWISE EXPRESSLY ALLOWED BY APPLICABLE LAWS.
#
include $(TOPDIR)/rules.mk

PKG_NAME:=gre
PKG_VERSION:=1
PKG_RELEASE:=3

include $(INCLUDE_DIR)/package.mk

define Package/gre/Default
  CATEGORY:=Technicolor
  SUBMENU:=Network
  MAINTAINER:=Hans Dedecker <hans.dedecker@technicolor.com>
endef

define Package/gre
$(call Package/gre/Default)
  SECTION:=gre
  TITLE:=Generic Routing Encapsulation config support
endef

define Package/gre/description
 Generic Routing Encapsulation config support (IPv4 and IPv6) in /etc/config/network.
endef

define Package/grev4
$(call Package/gre/Default)
  SECTION:=grev4
  TITLE:=Generic Routing Encapsulation (IPv4) config support
  DEPENDS:=@(PACKAGE_gre) +kmod-gre
endef

define Package/grev4/description
 Generic Routing Encapsulation config support (IPv4) in /etc/config/network.
 See confluence for more details.
endef

define Package/grev6
$(call Package/gre/Default)
  SECTION:=grev6
  TITLE:=Generic Routing Encapsulation (IPv6) config support
  DEPENDS:=@(PACKAGE_gre) +kmod-ipv6 +kmod-ip6-gre
endef

define Package/grev6/description
 Generic Routing Encapsulation config support (IPv6) in /etc/config/network.
 See confluence for more details.
endef

define Build/Compile
endef

define Build/Configure
endef

define Package/gre/install
	$(INSTALL_DIR) $(1)/lib/netifd/proto
	$(INSTALL_BIN) ./files/gre.sh $(1)/lib/netifd/proto/gre.sh
endef

$(eval $(call BuildPackage,gre))
$(eval $(call BuildPackage,grev4))
$(eval $(call BuildPackage,grev6))
