summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-03-19 22:51:51 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-03-19 22:51:51 +0000
commit682367d8ec7ec429de0f89a5b6679ec2abd70325 (patch)
tree27e1619e831268ea1fef78626ca3380be26e4325
parent97d994fb22b2c9044f5e8ee72b9842c3827ddeb9 (diff)
downloadmtk-20170518-682367d8ec7ec429de0f89a5b6679ec2abd70325.zip
mtk-20170518-682367d8ec7ec429de0f89a5b6679ec2abd70325.tar.gz
mtk-20170518-682367d8ec7ec429de0f89a5b6679ec2abd70325.tar.bz2
add downloading script (with md5sum checking and sourceforge downloading support)
SVN-Revision: 391
-rw-r--r--openwrt/package/arptables/Makefile4
-rw-r--r--openwrt/package/bridge/Makefile4
-rw-r--r--openwrt/package/busybox/busybox.mk2
-rw-r--r--openwrt/package/dnsmasq/Makefile2
-rw-r--r--openwrt/package/dropbear/Makefile2
-rw-r--r--openwrt/package/ebtables/Makefile4
-rw-r--r--openwrt/package/haserl/Makefile4
-rw-r--r--openwrt/package/iproute2/Makefile2
-rw-r--r--openwrt/package/iptables/Makefile2
-rw-r--r--openwrt/package/libelf/Makefile2
-rw-r--r--openwrt/package/libpcap/Makefile2
-rw-r--r--openwrt/package/linux/linux.mk4
-rw-r--r--openwrt/package/lzo/Makefile2
-rw-r--r--openwrt/package/matrixssl/Makefile2
-rw-r--r--openwrt/package/microperl/Makefile2
-rw-r--r--openwrt/package/ncurses/Makefile2
-rw-r--r--openwrt/package/openssl/Makefile2
-rw-r--r--openwrt/package/openvpn/Makefile4
-rw-r--r--openwrt/package/openwrt/Makefile2
-rw-r--r--openwrt/package/pcre/Makefile2
-rw-r--r--openwrt/package/popt/Makefile2
-rw-r--r--openwrt/package/ppp/Makefile2
-rw-r--r--openwrt/package/pptp/Makefile4
-rw-r--r--openwrt/package/pptpd/Makefile4
-rw-r--r--openwrt/package/strace/Makefile4
-rw-r--r--openwrt/package/tcpdump/Makefile2
-rw-r--r--openwrt/package/zlib/Makefile2
-rwxr-xr-xopenwrt/scripts/download.pl76
-rw-r--r--openwrt/target/jffs2/jffs2root.mk2
-rw-r--r--openwrt/target/squashfs-lzma/squashfslzmaroot.mk2
-rw-r--r--openwrt/toolchain/binutils/binutils.mk2
-rw-r--r--openwrt/toolchain/gcc/gcc-uclibc-3.x.mk2
-rw-r--r--openwrt/toolchain/ipkg-utils/Makefile2
-rw-r--r--openwrt/toolchain/kernel-headers/kernel-headers.mk3
-rw-r--r--openwrt/toolchain/sed/sed.mk2
-rw-r--r--openwrt/toolchain/uClibc/uclibc.mk2
36 files changed, 121 insertions, 44 deletions
diff --git a/openwrt/package/arptables/Makefile b/openwrt/package/arptables/Makefile
index 961ee5e..f27a353 100644
--- a/openwrt/package/arptables/Makefile
+++ b/openwrt/package/arptables/Makefile
@@ -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) -
diff --git a/openwrt/package/bridge/Makefile b/openwrt/package/bridge/Makefile
index 2f3f4c6..5aba7d3 100644
--- a/openwrt/package/bridge/Makefile
+++ b/openwrt/package/bridge/Makefile
@@ -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) -
diff --git a/openwrt/package/busybox/busybox.mk b/openwrt/package/busybox/busybox.mk
index ab67544..03b1c78 100644
--- a/openwrt/package/busybox/busybox.mk
+++ b/openwrt/package/busybox/busybox.mk
@@ -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)
diff --git a/openwrt/package/dnsmasq/Makefile b/openwrt/package/dnsmasq/Makefile
index 761b798..9d1506e 100644
--- a/openwrt/package/dnsmasq/Makefile
+++ b/openwrt/package/dnsmasq/Makefile
@@ -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) -
diff --git a/openwrt/package/dropbear/Makefile b/openwrt/package/dropbear/Makefile
index 5003130..a62e251 100644
--- a/openwrt/package/dropbear/Makefile
+++ b/openwrt/package/dropbear/Makefile
@@ -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) -
diff --git a/openwrt/package/ebtables/Makefile b/openwrt/package/ebtables/Makefile
index d4a7584..f79f686 100644
--- a/openwrt/package/ebtables/Makefile
+++ b/openwrt/package/ebtables/Makefile
@@ -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) -
diff --git a/openwrt/package/haserl/Makefile b/openwrt/package/haserl/Makefile
index 7e6c97a..2ad1083 100644
--- a/openwrt/package/haserl/Makefile
+++ b/openwrt/package/haserl/Makefile
@@ -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)
diff --git a/openwrt/package/iproute2/Makefile b/openwrt/package/iproute2/Makefile
index 6c786ea..313435a 100644
--- a/openwrt/package/iproute2/Makefile
+++ b/openwrt/package/iproute2/Makefile
@@ -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) -
diff --git a/openwrt/package/iptables/Makefile b/openwrt/package/iptables/Makefile
index c50c4bd..9108645 100644
--- a/openwrt/package/iptables/Makefile
+++ b/openwrt/package/iptables/Makefile
@@ -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
diff --git a/openwrt/package/libelf/Makefile b/openwrt/package/libelf/Makefile
index 6510569..3767f17 100644
--- a/openwrt/package/libelf/Makefile
+++ b/openwrt/package/libelf/Makefile
@@ -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)
diff --git a/openwrt/package/libpcap/Makefile b/openwrt/package/libpcap/Makefile
index 279190c..6d0dfaf 100644
--- a/openwrt/package/libpcap/Makefile
+++ b/openwrt/package/libpcap/Makefile
@@ -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)
diff --git a/openwrt/package/linux/linux.mk b/openwrt/package/linux/linux.mk
index 225683d..e0d0acc 100644
--- a/openwrt/package/linux/linux.mk
+++ b/openwrt/package/linux/linux.mk
@@ -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)
diff --git a/openwrt/package/lzo/Makefile b/openwrt/package/lzo/Makefile
index 414ec3e..05bb95e 100644
--- a/openwrt/package/lzo/Makefile
+++ b/openwrt/package/lzo/Makefile
@@ -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)
diff --git a/openwrt/package/matrixssl/Makefile b/openwrt/package/matrixssl/Makefile
index 2352742..cd39be3 100644
--- a/openwrt/package/matrixssl/Makefile
+++ b/openwrt/package/matrixssl/Makefile
@@ -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)
diff --git a/openwrt/package/microperl/Makefile b/openwrt/package/microperl/Makefile
index ca6368e..5ec836e 100644
--- a/openwrt/package/microperl/Makefile
+++ b/openwrt/package/microperl/Makefile
@@ -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) -
diff --git a/openwrt/package/ncurses/Makefile b/openwrt/package/ncurses/Makefile
index 1a3ad4a..633fc9f 100644
--- a/openwrt/package/ncurses/Makefile
+++ b/openwrt/package/ncurses/Makefile
@@ -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)
diff --git a/openwrt/package/openssl/Makefile b/openwrt/package/openssl/Makefile
index c038f02..cced77d 100644
--- a/openwrt/package/openssl/Makefile
+++ b/openwrt/package/openssl/Makefile
@@ -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)
diff --git a/openwrt/package/openvpn/Makefile b/openwrt/package/openvpn/Makefile
index 1c7b06e..c549e66 100644
--- a/openwrt/package/openvpn/Makefile
+++ b/openwrt/package/openvpn/Makefile
@@ -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) -
diff --git a/openwrt/package/openwrt/Makefile b/openwrt/package/openwrt/Makefile
index 2c695bc..8a9ff25 100644
--- a/openwrt/package/openwrt/Makefile
+++ b/openwrt/package/openwrt/Makefile
@@ -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) -
diff --git a/openwrt/package/pcre/Makefile b/openwrt/package/pcre/Makefile
index de5680b..8f4e550 100644
--- a/openwrt/package/pcre/Makefile
+++ b/openwrt/package/pcre/Makefile
@@ -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)
diff --git a/openwrt/package/popt/Makefile b/openwrt/package/popt/Makefile
index e00a10b..b35e097 100644
--- a/openwrt/package/popt/Makefile
+++ b/openwrt/package/popt/Makefile
@@ -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)
diff --git a/openwrt/package/ppp/Makefile b/openwrt/package/ppp/Makefile
index 69a934b..032a228 100644
--- a/openwrt/package/ppp/Makefile
+++ b/openwrt/package/ppp/Makefile
@@ -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)
diff --git a/openwrt/package/pptp/Makefile b/openwrt/package/pptp/Makefile
index d080310..0ddd247 100644
--- a/openwrt/package/pptp/Makefile
+++ b/openwrt/package/pptp/Makefile
@@ -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) -
diff --git a/openwrt/package/pptpd/Makefile b/openwrt/package/pptpd/Makefile
index a320b15..5714e4d 100644
--- a/openwrt/package/pptpd/Makefile
+++ b/openwrt/package/pptpd/Makefile
@@ -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) -
diff --git a/openwrt/package/strace/Makefile b/openwrt/package/strace/Makefile
index 2702b72..a5235ea 100644
--- a/openwrt/package/strace/Makefile
+++ b/openwrt/package/strace/Makefile
@@ -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) -
diff --git a/openwrt/package/tcpdump/Makefile b/openwrt/package/tcpdump/Makefile
index 82abd30..01cef5e 100644
--- a/openwrt/package/tcpdump/Makefile
+++ b/openwrt/package/tcpdump/Makefile
@@ -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) -
diff --git a/openwrt/package/zlib/Makefile b/openwrt/package/zlib/Makefile
index 6d9144f..b01ff46 100644
--- a/openwrt/package/zlib/Makefile
+++ b/openwrt/package/zlib/Makefile
@@ -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
index 0000000..a3a5f09
--- /dev/null
+++ b/openwrt/scripts/download.pl
@@ -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;
+
diff --git a/openwrt/target/jffs2/jffs2root.mk b/openwrt/target/jffs2/jffs2root.mk
index 1c7b962..450c741 100644
--- a/openwrt/target/jffs2/jffs2root.mk
+++ b/openwrt/target/jffs2/jffs2root.mk
@@ -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 -
diff --git a/openwrt/target/squashfs-lzma/squashfslzmaroot.mk b/openwrt/target/squashfs-lzma/squashfslzmaroot.mk
index ee7ede8..62b7dbb 100644
--- a/openwrt/target/squashfs-lzma/squashfslzmaroot.mk
+++ b/openwrt/target/squashfs-lzma/squashfslzmaroot.mk
@@ -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 -
diff --git a/openwrt/toolchain/binutils/binutils.mk b/openwrt/toolchain/binutils/binutils.mk
index 8fccbac..1bce3f9 100644
--- a/openwrt/toolchain/binutils/binutils.mk
+++ b/openwrt/toolchain/binutils/binutils.mk
@@ -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)
diff --git a/openwrt/toolchain/gcc/gcc-uclibc-3.x.mk b/openwrt/toolchain/gcc/gcc-uclibc-3.x.mk
index 878a55d..09829db 100644
--- a/openwrt/toolchain/gcc/gcc-uclibc-3.x.mk
+++ b/openwrt/toolchain/gcc/gcc-uclibc-3.x.mk
@@ -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)
diff --git a/openwrt/toolchain/ipkg-utils/Makefile b/openwrt/toolchain/ipkg-utils/Makefile
index 0cfe3c0..d46e4f3 100644
--- a/openwrt/toolchain/ipkg-utils/Makefile
+++ b/openwrt/toolchain/ipkg-utils/Makefile
@@ -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)
diff --git a/openwrt/toolchain/kernel-headers/kernel-headers.mk b/openwrt/toolchain/kernel-headers/kernel-headers.mk
index 9ef884e..73a13cd 100644
--- a/openwrt/toolchain/kernel-headers/kernel-headers.mk
+++ b/openwrt/toolchain/kernel-headers/kernel-headers.mk
@@ -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)
diff --git a/openwrt/toolchain/sed/sed.mk b/openwrt/toolchain/sed/sed.mk
index a4f1466..2dfd205 100644
--- a/openwrt/toolchain/sed/sed.mk
+++ b/openwrt/toolchain/sed/sed.mk
@@ -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)
diff --git a/openwrt/toolchain/uClibc/uclibc.mk b/openwrt/toolchain/uClibc/uclibc.mk
index eec100f..f7b6d2b 100644
--- a/openwrt/toolchain/uClibc/uclibc.mk
+++ b/openwrt/toolchain/uClibc/uclibc.mk
@@ -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)