update based on db90h's changes to the whiterussian package. note: this still needs...
authorTim Yardley <lst@openwrt.org>
Wed, 29 Nov 2006 02:02:11 +0000 (02:02 +0000)
committerTim Yardley <lst@openwrt.org>
Wed, 29 Nov 2006 02:02:11 +0000 (02:02 +0000)
SVN-Revision: 5672

net/miniupnpd/Makefile
net/miniupnpd/files/miniupnpd.init
net/miniupnpd/patches/001-makefile-tweaks.patch

index a4788f9..3c5a807 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=miniupnpd
-PKG_VERSION:=0.1
-PKG_RELEASE:=2
-PKG_MD5SUM:=4ba2a49c593d0c1088cc5791b8c6a985
+PKG_VERSION:=20061129
+PKG_RELEASE:=1
+PKG_MD5SUM:=1826c480e61e0573dfa1d835ee9d8802
 
-PKG_SOURCE_URL:=http://ftp.berlios.de/pub/xwrt/storage/
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://miniupnp.tuxfamily.org/files
+PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).tar.gz
 PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@@ -36,11 +36,6 @@ define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.openwrt
 endef
 
-define Build/Clean
-       # remove the client dir since the build system doesnt know about it
-       rm -rf $(PKG_BUILD_DIR)/../miniupnpc
-endef
-
 define Package/miniupnpd/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/bin/
index 4dd2df0..6a2c0d1 100644 (file)
@@ -6,11 +6,20 @@ if [ "$upnpd_enabled" = "1" ]; then
        killall miniupnpd 2>&-
        iptables_removeall.sh 2>&- >&-
        iptables_init.sh
+       # get bitspeed information, if provided
+       upnpd_up_bitspeed=$(nvram get upnpd_up_bitspeed)
+       upnpd_down_bitspeed=$(nvram get upnpd_down_bitspeed)
+       [ -n "$upnpd_up_bitspeed" ] && [ -n "$upnpd_down_bitspeed" ] && {
+               # covert to bytespeed
+               let upnpd_up_bytespeed=$upnpd_up_bitspeed*1024/8
+               let upnpd_down_bytespeed=$upnpd_down_bitspeed*1024/8
+               bitspeed_str="-B $upnpd_down_bytespeed $upnpd_up_bytespeed"
+       }
        upnpd_log=$(nvram get upnpd_log_output)
        if [ "$upnpd_log" = "1" ]; then
-               miniupnpd -i $(nvram get wan_ifname) -a $(nvram get lan_ipaddr) -p 5000 -U -d | logger -t miniupnpd &
+               miniupnpd -i $(nvram get wan_ifname) -a $(nvram get lan_ipaddr) -p 5000 -U "$bitspeed_str" -d | logger -t miniupnpd &
        else
-               miniupnpd -i $(nvram get wan_ifname) -a $(nvram get lan_ipaddr) -p 5000 -U
+               miniupnpd -i $(nvram get wan_ifname) -a $(nvram get lan_ipaddr) -p 5000 -U "$bitspeed_str"
        fi
 else
        echo "miniupnpd service is disabled. Set nvram upnp_enabled to '1' to enable."
index 7b57a05..0dfbc21 100644 (file)
@@ -1,33 +1,24 @@
---- miniupnpd.orig/Makefile.openwrt    2006-11-23 06:31:06.000000000 -0600
-+++ miniupnpd/Makefile.openwrt 2006-11-26 17:16:20.000000000 -0600
-@@ -2,12 +2,13 @@
- # http://miniupnp.free.fr/
- # Author : Thomas Bernard
- # for use with GNU Make
--#CFLAGS = -Wall -O -D_GNU_SOURCE -g
--CFLAGS = -Wall -Os -D_GNU_SOURCE
--CC = mipsel-linux-gcc
-+include $(TOPDIR)/rules.mk
-+CC = $(TARGET_CC)
-+CFLAGS = $(TARGET_CFLAGS)
-+CFLAGS += -D_GNU_SOURCE
+--- miniupnpd/Makefile.openwrt.orig    2006-11-26 16:44:21.000000000 -0600
++++ miniupnpd/Makefile.openwrt 2006-11-28 19:48:06.000000000 -0600
+@@ -11,7 +11,7 @@
+ CFLAGS += -D_GNU_SOURCE
  RM = rm -f
  INSTALL = install
--IPTABLESINC=/home/nanard/code/openwrt/iptables-1.3.3/include
+-IPTABLESINC=$(BUILD_DIR)/iptables-1.3.3/include
 +IPTABLESINC=$(STAGING_DIR)/usr/include
  
  BASEOBJS = miniupnpd.o upnphttp.o upnpdescgen.o upnpsoap.o \
-            ../miniupnpc/upnpreplyparse.o ../miniupnpc/minixml.o \
-@@ -15,7 +16,7 @@
+            upnpreplyparse.o minixml.o \
+@@ -19,7 +19,7 @@
  
  LNXOBJS = linux/getifstats.o linux/iptcrdr.o
  
--LIBS = /home/nanard/code/openwrt/iptables-1.3.3/libiptc/libiptc.a
+-LIBS = $(BUILD_DIR)/iptables-1.3.3/libiptc/libiptc.a
 +LIBS = $(STAGING_DIR)/usr/lib/libiptc.a
  
  TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o
  
-@@ -32,6 +33,7 @@
+@@ -36,6 +36,7 @@
        @echo no install for now...
  
  miniupnpd:    $(BASEOBJS) $(LNXOBJS) $(LIBS)