From e48d0e582ae824bc3d692cde5bd8ab1d871b69a5 Mon Sep 17 00:00:00 2001 From: Tim Yardley Date: Wed, 29 Nov 2006 02:02:11 +0000 Subject: [PATCH] update based on db90h's changes to the whiterussian package. note: this still needs to be converted to uci for kamikaze, so WiP. SVN-Revision: 5672 --- net/miniupnpd/Makefile | 15 ++++------- net/miniupnpd/files/miniupnpd.init | 13 +++++++-- .../patches/001-makefile-tweaks.patch | 27 +++++++------------ 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/net/miniupnpd/Makefile b/net/miniupnpd/Makefile index a4788f999d..3c5a8072a5 100644 --- a/net/miniupnpd/Makefile +++ b/net/miniupnpd/Makefile @@ -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/ diff --git a/net/miniupnpd/files/miniupnpd.init b/net/miniupnpd/files/miniupnpd.init index 4dd2df0561..6a2c0d15c4 100644 --- a/net/miniupnpd/files/miniupnpd.init +++ b/net/miniupnpd/files/miniupnpd.init @@ -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." diff --git a/net/miniupnpd/patches/001-makefile-tweaks.patch b/net/miniupnpd/patches/001-makefile-tweaks.patch index 7b57a059e3..0dfbc21b96 100644 --- a/net/miniupnpd/patches/001-makefile-tweaks.patch +++ b/net/miniupnpd/patches/001-makefile-tweaks.patch @@ -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) -- 2.30.2