include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=miniupnpd
-PKG_VERSION:=1.5
-PKG_RELEASE:=6
-PKG_MD5SUM:=063f03a2a8363b9d4cb0f73b20b8dfce
+PKG_VERSION:=1.5.20110302
+PKG_RELEASE:=1
+PKG_MD5SUM:=9c2906a2f87d9b9504e4fc09488afe41
PKG_SOURCE_URL:=http://miniupnp.free.fr/files
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
endef
define Build/Compile
- ln -sf $(PKG_BUILD_DIR)/config.h.openwrt $(PKG_BUILD_DIR)/config.h
+ echo "OpenWRT/$(OPENWRTVERSION)" | tr \(\)\ _ >$(PKG_BUILD_DIR)/os.openwrt
$(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.openwrt \
$(TARGET_CONFIGURE_OPTS) \
STAGING_DIR="$(STAGING_DIR)" \
--- /dev/null
+--- a/Makefile.openwrt
++++ b/Makefile.openwrt
+@@ -59,8 +59,8 @@ depend: config.h
+ $(ALLOBJS:.o=.c) $(TESTUPNPDESCGENOBJS:.o=.c) \
+ 2>/dev/null
+
+-config.h: config.h.openwrt
+- $(CP) $< $@
++config.h: genconfig.sh
++ ./genconfig.sh
+
+ # DO NOT DELETE
+
+--- a/genconfig.sh
++++ b/genconfig.sh
+@@ -28,6 +28,12 @@ if [ -f /etc/platform ]; then
+ fi
+ fi
+
++# OpenWRT special case
++if [ -f ./os.openwrt ]; then
++ OS_NAME=OpenWRT
++ OS_VERSION=$(cat ./os.openwrt)
++fi
++
+ ${RM} ${CONFIGFILE}
+
+ echo "/* MiniUPnP Project" >> ${CONFIGFILE}
+@@ -176,6 +182,11 @@ case $OS_NAME in
+ echo "#define USE_NETFILTER 1" >> ${CONFIGFILE}
+ FW=netfilter
+ ;;
++ OpenWRT)
++ OS_URL=http://www.openwrt.org/
++ echo "#define USE_NETFILTER 1" >> ${CONFIGFILE}
++ FW=netfilter
++ ;;
+ Darwin)
+ echo "#define USE_IPFW 1" >> ${CONFIGFILE}
+ FW=ipfw
+--- a/config.h.openwrt
++++ /dev/null
+@@ -1,29 +0,0 @@
+-/* $Id: config.h.openwrt,v 1.4 2011/02/28 17:30:24 nanard Exp $ */
+-/* MiniUPnP Project
+- * http:///miniupnp.free.fr
+- * (c) 2006-2011 Thomas Bernard
+- */
+-#ifndef __CONFIG_H__
+-#define __CONFIG_H__
+-
+-#define MINIUPNPD_VERSION "1.5"
+-
+-#define UPNP_VERSION "20070228"
+-#define USE_NETFILTER 1
+-#define OS_NAME "OpenWRT"
+-/* OS/version */
+-#define OS_VERSION "OpenWRT/kamikaze"
+-#define OS_URL "http://openwrt.org/"
+-
+-#define LOG_MINIUPNPD LOG_DAEMON
+-
+-/* Comment the following line to disable NAT-PMP operations */
+-#define ENABLE_NATPMP
+-
+-/* Comment the following line to use home made daemonize() func instead
+- * of BSD daemon() */
+-#define USE_DAEMON
+-
+-#define ENABLE_L3F_SERVICE
+-
+-#endif
+--- /dev/null
++++ b/config.h.openwrt.old
+@@ -0,0 +1,29 @@
++/* $Id: config.h.openwrt,v 1.4 2011/02/28 17:30:24 nanard Exp $ */
++/* MiniUPnP Project
++ * http:///miniupnp.free.fr
++ * (c) 2006-2011 Thomas Bernard
++ */
++#ifndef __CONFIG_H__
++#define __CONFIG_H__
++
++#define MINIUPNPD_VERSION "1.5"
++
++#define UPNP_VERSION "20070228"
++#define USE_NETFILTER 1
++#define OS_NAME "OpenWRT"
++/* OS/version */
++#define OS_VERSION "OpenWRT/kamikaze"
++#define OS_URL "http://openwrt.org/"
++
++#define LOG_MINIUPNPD LOG_DAEMON
++
++/* Comment the following line to disable NAT-PMP operations */
++#define ENABLE_NATPMP
++
++/* Comment the following line to use home made daemonize() func instead
++ * of BSD daemon() */
++#define USE_DAEMON
++
++#define ENABLE_L3F_SERVICE
++
++#endif