miniupnpd: add IGDv2 support as build option
[feed/routing.git] / miniupnpd / Makefile
index ceed43c79a0daab50b55ca86ff024a3e173551e8..5537e2c886f711f0dbe696cac1a63f6c4553a065 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=miniupnpd
-PKG_VERSION:=1.9.20141128
+PKG_VERSION:=2.0.20161216
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://miniupnp.free.fr/files
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=a9e71952bebb80e643a9c7a0e2c58faa
+PKG_MD5SUM:=9e73d50ac830b5e08b6eb1df4e4c917833a5ab54351809f615d15d0f30cdeef3
 
 PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi>
 PKG_LICENSE:=BSD-3-Clause
@@ -23,12 +23,19 @@ include $(INCLUDE_DIR)/package.mk
 define Package/miniupnpd
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables +libnfnetlink
+  DEPENDS:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables +libuuid
   TITLE:=Lightweight UPnP IGD, NAT-PMP & PCP daemon
   SUBMENU:=Firewall
   URL:=http://miniupnp.free.fr/
 endef
 
+define Package/miniupnpd/config
+config MINIUPNPD_IGDv2
+       bool
+       default y
+       prompt "Enable IGDv2"
+endef
+
 define Package/miniupnpd/conffiles
 /etc/config/upnpd
 endef
@@ -46,17 +53,21 @@ endef
 
 define Build/Prepare
        $(call Build/Prepare/Default)
-       echo "OpenWrt/$(OPENWRTVERSION)" | tr \(\)\  _ >$(PKG_BUILD_DIR)/os.openwrt
+       echo "OpenWrt" | tr \(\)\  _ >$(PKG_BUILD_DIR)/os.openwrt
 endef
 
 MAKE_FLAGS += \
-       TEST=0 \
+       TARGET_OPENWRT=1 TEST=0 \
        LIBS="" \
-       CC="$(TARGET_CC) -DIPTABLES_143 -lnfnetlink -lip4tc $(if $(CONFIG_IPV6),-lip6tc)" \
-       CONFIG_OPTIONS="$(if $(CONFIG_IPV6),--ipv6) --leasefile" \
+       CC="$(TARGET_CC) -DIPTABLES_143 \
+               -lip4tc $(if $(CONFIG_IPV6),-lip6tc) -luuid" \
+       CONFIG_OPTIONS="--portinuse --leasefile \
+               $(if $(CONFIG_IPV6),--ipv6) \
+               $(if $(CONFIG_MINIUPNPD_IGDv2),--igd2)" \
        -f Makefile.linux \
        miniupnpd
 
+
 define Package/miniupnpd/install
        $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/hotplug.d/iface $(1)/usr/share/miniupnpd
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/sbin/miniupnpd