add downloading script (with md5sum checking and sourceforge downloading support)
authorFelix Fietkau <nbd@openwrt.org>
Sat, 19 Mar 2005 22:51:51 +0000 (22:51 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 19 Mar 2005 22:51:51 +0000 (22:51 +0000)
SVN-Revision: 391

36 files changed:
openwrt/package/arptables/Makefile
openwrt/package/bridge/Makefile
openwrt/package/busybox/busybox.mk
openwrt/package/dnsmasq/Makefile
openwrt/package/dropbear/Makefile
openwrt/package/ebtables/Makefile
openwrt/package/haserl/Makefile
openwrt/package/iproute2/Makefile
openwrt/package/iptables/Makefile
openwrt/package/libelf/Makefile
openwrt/package/libpcap/Makefile
openwrt/package/linux/linux.mk
openwrt/package/lzo/Makefile
openwrt/package/matrixssl/Makefile
openwrt/package/microperl/Makefile
openwrt/package/ncurses/Makefile
openwrt/package/openssl/Makefile
openwrt/package/openvpn/Makefile
openwrt/package/openwrt/Makefile
openwrt/package/pcre/Makefile
openwrt/package/popt/Makefile
openwrt/package/ppp/Makefile
openwrt/package/pptp/Makefile
openwrt/package/pptpd/Makefile
openwrt/package/strace/Makefile
openwrt/package/tcpdump/Makefile
openwrt/package/zlib/Makefile
openwrt/scripts/download.pl [new file with mode: 0755]
openwrt/target/jffs2/jffs2root.mk
openwrt/target/squashfs-lzma/squashfslzmaroot.mk
openwrt/toolchain/binutils/binutils.mk
openwrt/toolchain/gcc/gcc-uclibc-3.x.mk
openwrt/toolchain/ipkg-utils/Makefile
openwrt/toolchain/kernel-headers/kernel-headers.mk
openwrt/toolchain/sed/sed.mk
openwrt/toolchain/uClibc/uclibc.mk

index 961ee5e2a8029a08c5348ea11f34b24afb2ef6ea..f27a35333f20f91423ffb0c6cddd65d4a625edc0 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=arptables
 PKG_VERSION:=0.0.3
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://unc.dl.sourceforge.net/sourceforge/ebtables/
+PKG_SOURCE_URL:=@SF/ebtables
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
 PKG_CAT:=zcat
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index 2f3f4c63019831eafe81b57bc5076b4e8d66e9c1..5aba7d30ef5b9e3d5788bb155c81bb7130dbe580 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=bridge
 PKG_VERSION:=1.0.4
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://unc.dl.sourceforge.net/sourceforge/bridge
+PKG_SOURCE_URL:=@SF/bridge
 PKG_SOURCE:=bridge-utils-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(BUILD_DIR)/bridge-utils-$(PKG_VERSION)
 PKG_CAT:=zcat
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index ab675444988a230539618e178f56998c15b82ef9..03b1c78bd559a4131deddb5b385afdc556d6e9c4 100644 (file)
@@ -18,7 +18,7 @@ endif
 BUSYBOX_UNZIP=bzcat
 
 $(DL_DIR)/$(BUSYBOX_SOURCE):
-        $(WGET) -P $(DL_DIR) $(BUSYBOX_SITE)/$(BUSYBOX_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(BUSYBOX_SOURCE) x $(BUSYBOX_SITE)
 
 busybox-source: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_CONFIG)
 
index 761b79843b87f42585688d86cec2ac38e6a7649c..9d1506e85001a15b601145fa4b0a8a0d842e9f5f 100644 (file)
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index 50031300b92743045a1cad92f58539b42757152e..a62e25131bce6e3380a1a3f8bd39c28224635c22 100644 (file)
@@ -16,7 +16,7 @@ DROPBEAR_IPK:=dropbear_$(DROPBEAR_VERSION)-1_$(ARCH).ipk
 DROPBEAR_IPK_DIR:=$(DROPBEAR_DIR)/ipkg
 
 $(DL_DIR)/$(DROPBEAR_SOURCE):
-        $(WGET) -P $(DL_DIR) $(DROPBEAR_SITE)/$(DROPBEAR_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(DROPBEAR_SOURCE) x $(DROPBEAR_SITE)
 
 $(DROPBEAR_DIR)/.patched: $(DL_DIR)/$(DROPBEAR_SOURCE)
        $(DROPBEAR_CAT) $(DL_DIR)/$(DROPBEAR_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index d4a7584e13dd26d0469a1715dec1e575efe1458f..f79f6864c1720b6fb2f3953aa65a003a89f2390a 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ebtables
 PKG_VERSION:=2.0.6
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://unc.dl.sourceforge.net/sourceforge/ebtables/
+PKG_SOURCE_URL:=@SF/ebtables
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(BUILD_DIR)/ebtables-v$(PKG_VERSION)
 PKG_CAT:=zcat
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index 7e6c97af9307c10bb694318a4daae262f1ab9b41..2ad108343fb33a7528e39b194d7cfe6536de8f35 100644 (file)
@@ -4,7 +4,7 @@ PKG_NAME := haserl
 PKG_VERSION := 0.7.3
 PKG_RELEASE := 3
 
-PKG_SOURCE_SITE := http://dl.sourceforge.net/sourceforge/haserl/
+PKG_SOURCE_SITE := @SF/haserl
 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_CAT := zcat
 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
@@ -14,7 +14,7 @@ PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/ipkg/rules: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index 6c786eacfeafd0fdec73f4b921648694ba87648d..313435a47b07c11c07ace4ffa2093e8a0532d877 100644 (file)
@@ -20,7 +20,7 @@ PKG_TC:=$(PACKAGE_DIR)/tc_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_TC_DIR:=$(PKG_BUILD_DIR)/ipkg/tc
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index c50c4bdb38d3aad6e1ac271386571b9950ab17c0..910864583fc566ab86dea5993a03c8188f853828 100644 (file)
@@ -38,7 +38,7 @@ endif
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(PKG_BUILD_DIR)/modules
index 65105697a59142c6bd27df13754172233cc4bbc6..3767f17c96958dfe72168b183b974c2904844450 100644 (file)
@@ -15,7 +15,7 @@ PKG_IPK_DIR :=$(PKG_BUILD_DIR)/ipkg/
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index 279190c02ad3b72079dabceaca86f445b4046ed4..6d0dfafe7d15ecc010d00e3db1e85ccc3940d011 100644 (file)
@@ -13,7 +13,7 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index 225683d08dfcdb239b06c6f3bf267deeb399944d..e0d0acc84622884c3ff3256bd1c43d1159ad308b 100644 (file)
@@ -36,10 +36,10 @@ LINUX_BINARY_ET_DRIVER=kernel-binary-et.tar.gz
 TARGET_MODULES_DIR=$(TARGET_DIR)/lib/modules/$(LINUX_VERSION)
 
 $(DL_DIR)/$(LINUX_BINARY_WL_DRIVER):
-       $(WGET) -P $(DL_DIR) $(LINUX_BINARY_DRIVER_SITE)/$(LINUX_BINARY_WL_DRIVER)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_BINARY_WL_DRIVER) x $(LINUX_BINARY_DRIVER_SITE)
 
 $(DL_DIR)/$(LINUX_BINARY_ET_DRIVER):
-       $(WGET) -P $(DL_DIR) $(LINUX_BINARY_DRIVER_SITE)/$(LINUX_BINARY_ET_DRIVER)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_BINARY_ET_DRIVER) x $(LINUX_BINARY_DRIVER_SITE)
 
 $(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE) $(DL_DIR)/$(LINUX_BINARY_WL_DRIVER) $(DL_DIR)/$(LINUX_BINARY_ET_DRIVER)
        -mkdir -p $(BUILD_DIR)
index 414ec3eb26570405dcb6ab6f869a8a85f4f295dc..05bb95e9cb1de2bc62cd1f4baba88d44418733a7 100644 (file)
@@ -14,7 +14,7 @@ PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index 2352742b9a56c9a4d4e03823bc5504392714e146..cd39be304ca0af83856df968a8526b529d012948 100644 (file)
@@ -14,7 +14,7 @@ PKG_IPK := $(PACKAGE_DIR)/lib$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).i
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index ca6368ef5dc1d6b3e430eb96f58d8a6a563203e0..5ec836e6fd54282b9c5bbbca63629b033367b9ae 100644 (file)
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index 1a3ad4a5617d501dac6b31fe76cf86ff290bc7f4..633fc9f76545ec009a815ec7c8105d1457196711 100644 (file)
@@ -14,7 +14,7 @@ PKG_IPK := $(PACKAGE_DIR)/lib$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).i
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/ipkg/rules: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index c038f02cee04c70dca98a5908c0eedaabff0b012..cced77d742aba04cbd43164c2ad33180601f9405 100644 (file)
@@ -15,7 +15,7 @@ OPENSSL_NO_CIPHERS:=no-idea no-mdc2 no-rc5 no-rc2 no-md2 no-md4
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index 1c7b06e5fad79404dccb00abae1686c21210c292..c549e66a4d462c09e98011f70ec1cd7bf7345a0a 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=openvpn
 PKG_VERSION:=2.0_rc16
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://puzzle.dl.sourceforge.net/sourceforge/openvpn
+PKG_SOURCE_URL:=@SF/openvpn
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_CAT:=zcat
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index 2c695bc409509ebe59756cff3adbd053e69ec480..8a9ff25cff8eb385f0dcf0b93470f35defd92b3b 100644 (file)
@@ -26,7 +26,7 @@ LINKSYS_WLCONF_TGZ=linksys-wlconf.tar.gz
 LINKSYS_WLCONF_DIR=$(BUILD_DIR)/linksys-wlconf
 
 $(DL_DIR)/$(LINKSYS_WLCONF_TGZ):
-       $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_WLCONF_TGZ)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINKSYS_WLCONF_TGZ) x $(LINKSYS_TGZ_SITE)
 
 $(LINKSYS_WLCONF_DIR)/.unpacked: $(DL_DIR)/$(LINKSYS_WLCONF_TGZ)
        zcat $(DL_DIR)/$(LINKSYS_WLCONF_TGZ) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index de5680b8bebb9e83fef44a2743ec9661cd7937ed..8f4e550befb8cad634aae9c105f5316fe021f05b 100644 (file)
@@ -14,7 +14,7 @@ PKG_IPK := $(PACKAGE_DIR)/lib$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).i
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/ipkg/rules: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index e00a10b49f22f4f8e1848e8948fae7ae86a73619..b35e097136d740f8a1a1700beba61cf8764522d0 100644 (file)
@@ -14,7 +14,7 @@ PKG_IPK := $(PACKAGE_DIR)/lib$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).i
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/ipkg/rules: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index 69a934bea2672b2d253859f40a4f0a2fa0a507c7..032a228e00993aeb070dc5c2b5ddf1d0f950419f 100644 (file)
@@ -53,7 +53,7 @@ endif
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index d0803103bba20342ada7823ab6771cb4c3e7de04..0ddd247dc6536bcd88e713192717c01a69fb87da 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=pptp
 PKG_VERSION:=1.6.0
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://unc.dl.sourceforge.net/sourceforge/pptpclient/
+PKG_SOURCE_URL:=@SF/pptpclient
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_CAT:=zcat
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index a320b15ac67a473fbbe9831e5684e223dfc151ef..5714e4d7865d722c3e47027bd65da4b6128b59be 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=pptpd
 PKG_VERSION:=1.2.3
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://unc.dl.sourceforge.net/sourceforge/poptop
+PKG_SOURCE_URL:=@SF/poptop
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_CAT:=zcat
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index 2702b72e7d8afd66a72b2bd8b450a5b8efbcb2b1..a5235eaa485e37f98bdcfc014a1a25d0264e988a 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=strace
 PKG_VERSION:=4.5.9
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://aleron.dl.sourceforge.net/sourceforge/strace
+PKG_SOURCE_URL:=@SF/strace
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_CAT:=bzcat
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index 82abd30ff75ab7054d5d233f182008578bab339f..01cef5e2d06d6231cb7211d436f4c5202e44912b 100644 (file)
@@ -16,7 +16,7 @@ PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
 
 $(DL_DIR)/$(PKG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
+        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) x $(PKG_SOURCE_URL)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
        $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index 6d9144f16c55f50d0f8fc352efa53f7b673b10ef..b01ff469506e57186198f75d4dba3ce85460a642 100644 (file)
@@ -14,7 +14,7 @@ PKG_IPK := $(PACKAGE_DIR)/zlib_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
diff --git a/openwrt/scripts/download.pl b/openwrt/scripts/download.pl
new file mode 100755 (executable)
index 0000000..a3a5f09
--- /dev/null
@@ -0,0 +1,76 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my $target = shift @ARGV;
+my $filename = shift @ARGV;
+my $md5sum = shift @ARGV;
+my @mirrors = @ARGV;
+
+my $ok;
+
+@mirrors > 0 or die "Syntax: $0 <target dir> <filename> <md5sum> <mirror> [<mirror> ...]\n";
+
+sub download
+{
+       my $mirror = shift;
+       
+       open WGET, "wget -t1 --connect-timeout=20 --read-timeout=15 -O- \"$mirror/$filename\" |" or die "Cannot launch wget.\n";
+       open MD5SUM, "| md5sum > \"$target/$filename.md5sum\"" or die "Cannot launch md5sum.\n";
+       open OUTPUT, "> $target/$filename.dl" or die "Cannot create file $target/$filename.dl: $!\n";
+       my $buffer;
+       while (read WGET, $buffer, 1048576) {
+               print MD5SUM $buffer;
+               print OUTPUT $buffer;
+       }
+       close MD5SUM;
+       close WGET;
+       close OUTPUT;
+       
+       if (($? >> 8) != 0 ) {
+               print STDERR "Download failed.\n";
+               cleanup();
+               return;
+       }
+       
+       my $sum = `cat "$target/$filename.md5sum"`;
+       $sum =~ /^(\w+)\s+/ or die "Could not generate md5sum\n";
+       $sum = $1;
+       
+       if (($md5sum =~ /\w{32}/) and ($sum ne $md5sum)) {
+               print STDERR "MD5 sum of the downloaded file does not match - deleting download.\n";
+               cleanup();
+               return;
+       }
+       
+       unlink "$target/$filename";
+       system("mv \"$target/$filename.dl\" \"$target/$filename\"");
+}
+
+sub cleanup
+{
+       unlink "$target/$filename.dl";
+       unlink "$target/$filename.md5sum";
+}
+
+while (!$ok) {
+       my $mirror = shift @mirrors;
+       $mirror or die "No more mirrors to try - giving up.\n";
+       
+       if ($mirror =~ /^\@SF\/(.+)$/) {
+               my $sfpath = $1;
+               open SF, "wget -t1 -q -O- 'http://prdownloads.sf.net/$sfpath/$filename' |";
+               while (<SF>) {
+                       /RADIO NAME=use_default VALUE=(\w+) OnClick="form\.submit\(\)">/ and do {
+                               push @mirrors, "http://$1.dl.sourceforge.net/sourceforge/$sfpath";
+                       };
+               }
+               close SF;
+       } else {
+               download($mirror);
+       }
+       -f "$target/$filename" and $ok = 1;
+}
+
+$SIG{INT} = \&cleanup;
+
index 1c7b962cfe4540b9038117ef4d93d9fee25bbabd..450c741f72e0b58e8b2e0c69e485955e881525f2 100644 (file)
@@ -10,7 +10,7 @@ MTD_SITE=http://ftp.debian.org/debian/pool/main/m/mtd
 MKFS_JFFS2=$(shell which mkfs.jffs2 2>/dev/null || echo $(MTD_DIR)/util/mkfs.jffs2)
 
 $(DL_DIR)/$(MTD_SOURCE):
-       $(WGET) -P $(DL_DIR) $(MTD_SITE)/$(MTD_SOURCE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(MTD_SOURCE) x $(MTD_SITE)
 
 $(MTD_DIR)/.unpacked: $(DL_DIR)/$(MTD_SOURCE)
        zcat $(DL_DIR)/$(MTD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
index ee7ede84b0b36fa222775333bf92c333cc2ae770..62b7dbb7b7f15845085a58432c47370cc9be85a4 100644 (file)
@@ -9,7 +9,7 @@ SQUASHFSLZMA_SOURCE=squashfs2.1-r2-lzma.tar.gz
 SQUASHFSLZMA_SITE=http://openwrt.openbsd-geek.de
 
 $(DL_DIR)/$(SQUASHFSLZMA_SOURCE):
-       $(WGET) -P $(DL_DIR) $(SQUASHFSLZMA_SITE)/$(SQUASHFSLZMA_SOURCE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SQUASHFSLZMA_SOURCE) x $(SQUASHFSLZMA_SITE)
 
 $(SQUASHFSLZMA_DIR)/.unpacked: $(DL_DIR)/$(SQUASHFSLZMA_SOURCE) 
        zcat $(DL_DIR)/$(SQUASHFSLZMA_SOURCE) | tar -C $(BUILD_DIR) -xvf -
index 8fccbac370998f81a68283efac435bf0f6a9e0bd..1bce3f932f2ba502fadc879d130c121d7119ba89 100644 (file)
@@ -24,7 +24,7 @@ BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)-build
 
 $(DL_DIR)/$(BINUTILS_SOURCE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(BINUTILS_SITE)/$(BINUTILS_SOURCE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(BINUTILS_SOURCE) x $(BINUTILS_SITE)
 
 $(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
        mkdir -p $(TOOL_BUILD_DIR)
index 878a55d270dbe6d7f8178f58f08ab6038ee1235e..09829db003de4c3ec11a0cd4ec2cb1590dc24104 100644 (file)
@@ -57,7 +57,7 @@ GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-initial
 
 $(DL_DIR)/$(GCC_SOURCE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(GCC_SOURCE) x $(GCC_SITE)
 
 $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
        mkdir -p $(TOOL_BUILD_DIR)
index 0cfe3c06e44441f82b9511a464d668e5584d3620..d46e4f365c1829669c52d390d242606b15de56cd 100644 (file)
@@ -18,7 +18,7 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
 
 $(DL_DIR)/$(PKG_SOURCE_FILE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
 
 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE_FILE)
        mkdir -p $(TOOL_BUILD_DIR)
index 9ef884ef4c97baca6d6b959b35b9e8d82cb05321..73a13cdcae0a9a5b4cf7d5e12e1f774889513d64 100644 (file)
@@ -1,6 +1,7 @@
 # linux kernel headers for toolchain
 
 LINUX_HEADERS_VERSION=2.4.29
+LINUX_KERNEL_MD5SUM:=fcf8b6bb620467f27b657c1c4a60bbff
 LINUX_HEADERS_SITE=http://www.kernel.org/pub/linux/kernel/v2.4
 LINUX_HEADERS_SOURCE=linux-$(LINUX_HEADERS_VERSION).tar.bz2
 LINUX_HEADERS_CONFIG=./linux.config
@@ -12,7 +13,7 @@ LINUX_HEADERS_ARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
 
 $(DL_DIR)/$(LINUX_HEADERS_SOURCE):
        -mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(LINUX_HEADERS_SITE)/$(LINUX_HEADERS_SOURCE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_HEADERS_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_HEADERS_SITE)
 
 $(LINUX_HEADERS_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
        mkdir -p $(TOOL_BUILD_DIR)
index a4f1466ec63c2b1f0a7d0fdeea565fc10022e0a0..2dfd205f2e1e2cd41498aee5955284365d4c3d43 100644 (file)
@@ -18,7 +18,7 @@ HOST_SED_TARGET=$(shell ./sedcheck.sh)
 
 $(DL_DIR)/$(SED_SOURCE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(SED_SITE)/$(SED_SOURCE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SED_SOURCE) x $(SED_SITE)
 
 sed-source: $(DL_DIR)/$(SED_SOURCE)
 
index eec100f83b099f5765e7cbb10fbbb868a9e76663..f7b6d2be6a9a6635255f6b8aeed53fbc49cd09fc 100644 (file)
@@ -33,7 +33,7 @@ UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
 
 $(DL_DIR)/$(UCLIBC_SOURCE):
        mkdir -p $(DL_DIR)
-       $(WGET) -P $(DL_DIR) $(UCLIBC_SITE)/$(UCLIBC_SOURCE)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(UCLIBC_SOURCE) x $(UCLIBC_SITE)
 
 $(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
        mkdir -p $(TOOL_BUILD_DIR)