summaryrefslogtreecommitdiff
path: root/mk/fetch
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-06-06 03:05:48 +0000
committerjlam <jlam@pkgsrc.org>2006-06-06 03:05:48 +0000
commitc78510391e52c0843796b063d447cdb3d8e58d50 (patch)
tree24bd58d9b7fcd54a9caf78e4df46474a93a46ade /mk/fetch
parent67a4469e7a0a492bd82633bbfde57625c2b30b3d (diff)
downloadpkgsrc-c78510391e52c0843796b063d447cdb3d8e58d50.tar.gz
Refactor "fetch" and "extract" code into correspondingly named
subdirectories of pkgsrc/mk. Move the following files around for locality: pkgsrc/mk/scripts/extract -> pkgsrc/mk/extract/extract pkgsrc/mk/bsd.sites.mk -> pkgsrc/mk/fetch/sites.mk Also get rid of the recursive make for the "fetch" and "extract" targets. This basically merges the "fetch" and "extract" phases into the "patch" phase. There is still much more work to do to simplify the fetch code, but this is a good start.
Diffstat (limited to 'mk/fetch')
-rw-r--r--mk/fetch/bsd.fetch-vars.mk22
-rw-r--r--mk/fetch/bsd.fetch.mk9
-rw-r--r--mk/fetch/distclean.mk26
-rw-r--r--mk/fetch/fetch.mk453
-rw-r--r--mk/fetch/sites.mk398
5 files changed, 908 insertions, 0 deletions
diff --git a/mk/fetch/bsd.fetch-vars.mk b/mk/fetch/bsd.fetch-vars.mk
new file mode 100644
index 00000000000..b5b6897d707
--- /dev/null
+++ b/mk/fetch/bsd.fetch-vars.mk
@@ -0,0 +1,22 @@
+# $NetBSD: bsd.fetch-vars.mk,v 1.1 2006/06/06 03:05:48 jlam Exp $
+#
+# This Makefile fragment is included to bsd.prefs.mk and defines some
+# variables which must be defined earlier than where bsd.fetch.mk
+# is included.
+#
+# The following variables may be set by the user:
+#
+# DISTDIR is the top-level directory into which all original
+# distribution files are fetched.
+#
+# The following variables may be set in a package Makefile:
+#
+# DIST_SUBDIR is the subdirectory of ${DISTDIR} in which the original
+# distribution files for the package are fetched.
+#
+# DISTFILES is the list of distribution files that are fetched.
+#
+
+DISTDIR?= ${PKGSRCDIR}/distfiles
+_DISTDIR= ${DISTDIR}/${DIST_SUBDIR}
+DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
diff --git a/mk/fetch/bsd.fetch.mk b/mk/fetch/bsd.fetch.mk
new file mode 100644
index 00000000000..e311caea9bc
--- /dev/null
+++ b/mk/fetch/bsd.fetch.mk
@@ -0,0 +1,9 @@
+# $NetBSD: bsd.fetch.mk,v 1.1 2006/06/06 03:05:48 jlam Exp $
+#
+# This Makefile fragment is included by bsd.pkg.mk and defines the
+# relevant variables and targets for the "fetch" step.
+#
+
+.include "${PKGSRCDIR}/mk/fetch/sites.mk"
+.include "${PKGSRCDIR}/mk/fetch/fetch.mk"
+.include "${PKGSRCDIR}/mk/fetch/distclean.mk"
diff --git a/mk/fetch/distclean.mk b/mk/fetch/distclean.mk
new file mode 100644
index 00000000000..3140e1b286b
--- /dev/null
+++ b/mk/fetch/distclean.mk
@@ -0,0 +1,26 @@
+# $NetBSD: distclean.mk,v 1.1 2006/06/06 03:05:48 jlam Exp $
+
+.PHONY: pre-distclean
+.if !target(pre-distclean)
+pre-distclean:
+ @${DO_NADA}
+.endif
+
+.PHONY: distclean
+.if !target(distclean)
+distclean: pre-distclean clean
+ @${PHASE_MSG} "Dist cleaning for ${PKGNAME}"
+ ${_PKG_SILENT}${_PKG_DEBUG}if [ -d ${_DISTDIR} ]; then \
+ cd ${_DISTDIR} && \
+ ${TEST} -z "${DISTFILES}" || ${RM} -f ${DISTFILES}; \
+ if [ "${PKG_RESUME_TRANSFERS:M[Yy][Ee][Ss]}" ]; then \
+ ${TEST} -z "${DISTFILES}.temp" || ${RM} -f ${DISTFILES}.temp; \
+ fi; \
+ ${TEST} -z "${PATCHFILES}" || ${RM} -f ${PATCHFILES}; \
+ fi
+. if defined(DIST_SUBDIR)
+ -${_PKG_SILENT}${_PKG_DEBUG} \
+ ${TEST} ! -d ${_DISTDIR} || ${RMDIR} ${_DISTDIR} 2>/dev/null
+. endif
+ ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f README.html
+.endif
diff --git a/mk/fetch/fetch.mk b/mk/fetch/fetch.mk
new file mode 100644
index 00000000000..7f9a0176844
--- /dev/null
+++ b/mk/fetch/fetch.mk
@@ -0,0 +1,453 @@
+# $NetBSD: fetch.mk,v 1.1 2006/06/06 03:05:48 jlam Exp $
+
+######################################################################
+### fetch (PUBLIC)
+######################################################################
+### fetch is a public target to fetch all of the package distribution
+### files.
+###
+.PHONY: fetch
+.if !target(fetch)
+fetch: pre-fetch do-fetch post-fetch
+.endif
+
+# If this host is behind a filtering firewall, use passive ftp(1)
+FETCH_BEFORE_ARGS+= ${PASSIVE_FETCH:D-p}
+
+_MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
+_MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
+
+# Where to put distfiles that don't have any other master site
+MASTER_SITE_LOCAL?= ${MASTER_SITE_BACKUP:=LOCAL_PORTS/}
+
+ALLFILES?= ${DISTFILES} ${PATCHFILES}
+CKSUMFILES?= ${ALLFILES}
+.for __tmp__ in ${IGNOREFILES}
+CKSUMFILES:= ${CKSUMFILES:N${__tmp__}}
+.endfor
+
+# List of all files, with ${DIST_SUBDIR} in front. Used for fetch and checksum.
+.if defined(DIST_SUBDIR)
+_CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
+_DISTFILES?= ${DISTFILES:S/^/${DIST_SUBDIR}\//}
+_IGNOREFILES?= ${IGNOREFILES:S/^/${DIST_SUBDIR}\//}
+_PATCHFILES?= ${PATCHFILES:S/^/${DIST_SUBDIR}\//}
+.else
+_CKSUMFILES?= ${CKSUMFILES}
+_DISTFILES?= ${DISTFILES}
+_IGNOREFILES?= ${IGNOREFILES}
+_PATCHFILES?= ${PATCHFILES}
+.endif
+_ALLFILES?= ${_DISTFILES} ${_PATCHFILES}
+
+BUILD_DEFS+= _DISTFILES _PATCHFILES
+
+###
+### _RESUME_TRANSFER:
+###
+### Macro to resume a previous transfer, needs to have defined
+### the following options in mk.conf:
+###
+### PKG_RESUME_TRANSFERS
+### FETCH_RESUME_ARGS (if FETCH_CMD != default)
+### FETCH_OUTPUT_ARGS (if FETCH_CMD != default)
+###
+### For example if you want to use wget (pkgsrc/net/wget):
+###
+### FETCH_CMD=wget
+### FETCH_RESUME_ARGS=-c
+### FETCH_OUTPUT_ARGS=-O
+###
+### How does it work?
+###
+### FETCH_CMD downloads the file and saves it temporally into $$bfile.temp
+### if the checksum match the correct one, $$bfile.temp is renamed to
+### the original name.
+###
+
+_RESUME_TRANSFER= \
+ ofile="${DISTDIR}/${DIST_SUBDIR}/$$bfile"; \
+ tfile="${DISTDIR}/${DIST_SUBDIR}/$$bfile.temp"; \
+ tsize=`${AWK} '/^Size/ && $$2 == '"\"($$file)\""' { print $$4 }' ${DISTINFO_FILE}` || ${TRUE}; \
+ osize=`${WC} -c < $$ofile`; \
+ \
+ case "$$tsize" in \
+ "") ${ECHO_MSG} "No size in distinfo file (${DISTINFO_FILE})"; \
+ break;; \
+ esac; \
+ \
+ if [ "$$osize" -eq "$$tsize" ]; then \
+ if [ -f "$$tfile" ]; then \
+ ${RM} $$tfile; \
+ fi; \
+ need_fetch=no; \
+ elif [ "$$osize" -lt "$$tsize" -a ! -f "$$tfile" ]; then \
+ ${CP} $$ofile $$tfile; \
+ dsize=`${WC} -c < $$tfile`; \
+ need_fetch=yes; \
+ elif [ -f "$$tfile" -a "$$dsize" -gt "$$ossize" ]; then \
+ dsize=`${WC} -c < $$tfile`; \
+ need_fetch=yes; \
+ else \
+ if [ -f "$$tfile" ]; then \
+ dsize=`${WC} -c < $$tfile`; \
+ fi; \
+ need_fetch=yes; \
+ fi; \
+ if [ "$$need_fetch" = "no" ]; then \
+ break; \
+ elif [ -f "$$tfile" -a "$$dsize" -eq "$$tsize" ]; then \
+ ${MV} $$tfile $$ofile; \
+ break; \
+ elif [ -n "$$ftp_proxy" -o -n "$$http_proxy" ]; then \
+ ${ECHO_MSG} "===> Resume is not supported by ftp(1) using http/ftp proxies."; \
+ break; \
+ elif [ "$$need_fetch" = "yes" -a "$$dsize" -lt "$$tsize" ]; then \
+ if [ "${FETCH_CMD:T}" != "ftp" -a -z "${FETCH_RESUME_ARGS}" ]; then \
+ ${ECHO_MSG} "=> Resume transfers are not supported, FETCH_RESUME_ARGS is empty."; \
+ break; \
+ else \
+ for res_site in $$sites; do \
+ if [ -z "${FETCH_OUTPUT_ARGS}" ]; then \
+ ${ECHO_MSG} "=> FETCH_OUTPUT_ARGS has to be defined."; \
+ break; \
+ fi; \
+ ${ECHO_MSG} "=> $$bfile not completed, resuming:"; \
+ ${ECHO_MSG} "=> Downloaded: $$dsize Total: $$tsize."; \
+ ${ECHO_MSG}; \
+ cd ${DISTDIR}; \
+ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${FETCH_RESUME_ARGS} \
+ ${FETCH_OUTPUT_ARGS} $${bfile}.temp $${res_site}$${bfile}; \
+ if [ $$? -eq 0 ]; then \
+ ndsize=`${WC} -c < $$tfile`; \
+ if [ "$$tsize" -eq "$$ndsize" ]; then \
+ ${MV} $$tfile $$ofile; \
+ fi; \
+ break; \
+ fi; \
+ done; \
+ fi; \
+ elif [ "$$dsize" -gt "$$tsize" ]; then \
+ ${ECHO_MSG} "==> Downloaded file larger than the recorded size."; \
+ break; \
+ fi
+
+#
+# Define the elementary fetch macros.
+#
+_FETCH_FILE= \
+ if [ ! -f $$file -a ! -f $$bfile -a ! -h $$bfile ]; then \
+ ${ECHO_MSG} "=> $$bfile doesn't seem to exist on this system."; \
+ if [ ! -w ${_DISTDIR}/. ]; then \
+ ${ECHO_MSG} "=> Can't download to ${_DISTDIR} (permission denied?)."; \
+ exit 1; \
+ fi; \
+ for site in $$sites; do \
+ ${ECHO_MSG} "=> Attempting to fetch $$bfile from $${site}."; \
+ if [ -f ${DISTINFO_FILE} ]; then \
+ ${AWK} 'NF == 5 && $$1 == "Size" && $$2 == "('$$bfile')" { printf("=> [%s %s]\n", $$4, $$5) }' ${DISTINFO_FILE}; \
+ fi; \
+ if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${bfile} ${FETCH_AFTER_ARGS}; then \
+ if [ -n "${FAILOVER_FETCH}" -a -f ${DISTINFO_FILE} -a -f ${_DISTDIR}/$$bfile ]; then \
+ alg=`${AWK} 'NF == 4 && $$2 == "('$$file')" && $$3 == "=" {print $$1; exit}' ${DISTINFO_FILE}`; \
+ if [ -z "$$alg" ]; then \
+ alg=${PATCH_DIGEST_ALGORITHM};\
+ fi; \
+ CKSUM=`${DIGEST} $$alg < ${_DISTDIR}/$$bfile`; \
+ CKSUM2=`${AWK} '$$1 == "'$$alg'" && $$2 == "('$$file')" {print $$4; exit}' <${DISTINFO_FILE}`; \
+ if [ "$$CKSUM" = "$$CKSUM2" -o "$$CKSUM2" = "IGNORE" ]; then \
+ break; \
+ else \
+ ${ECHO_MSG} "=> Checksum failure - trying next site."; \
+ fi; \
+ elif [ ! -f ${_DISTDIR}/$$bfile ]; then \
+ ${ECHO_MSG} "=> FTP didn't fetch expected file, trying next site." ; \
+ else \
+ break; \
+ fi; \
+ fi \
+ done; \
+ if [ ! -f ${_DISTDIR}/$$bfile ]; then \
+ ${ECHO_MSG} "=> Couldn't fetch $$bfile - please try to retrieve this";\
+ ${ECHO_MSG} "=> file manually into ${_DISTDIR} and try again."; \
+ exit 1; \
+ fi; \
+ fi
+
+_CHECK_DIST_PATH= \
+ if [ "X${DIST_PATH}" != "X" ]; then \
+ for d in "" ${DIST_PATH:S/:/ /g}; do \
+ case $$d in "" | ${DISTDIR}) continue;; esac; \
+ if [ -f $$d/${DIST_SUBDIR}/$$bfile ]; then \
+ ${ECHO} "Using $$d/${DIST_SUBDIR}/$$bfile"; \
+ ${RM} -f $$bfile; \
+ ${LN} -s $$d/${DIST_SUBDIR}/$$bfile $$bfile; \
+ break; \
+ fi; \
+ done; \
+ fi
+
+#
+# Set up ORDERED_SITES to work out the exact list of sites for every file,
+# using the dynamic sites script, or sorting according to the master site
+# list or the patterns in MASTER_SORT or MASTER_SORT_REGEX as appropriate.
+# No actual sorting is done until ORDERED_SITES is expanded.
+#
+.if defined(MASTER_SORT) || defined(MASTER_SORT_REGEX)
+MASTER_SORT?=
+MASTER_SORT_REGEX?=
+MASTER_SORT_REGEX+= ${MASTER_SORT:S/./\\./g:C/.*/:\/\/[^\/]*&\//}
+
+MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S/\\/\\\\/g}"; }
+. for srt in ${MASTER_SORT_REGEX}
+MASTER_SORT_AWK+= /${srt:C/\//\\\//g}/ { good["${srt:S/\\/\\\\/g}"] = good["${srt:S/\\/\\\\/g}"] " " $$0 ; next; }
+. endfor
+MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
+
+SORT_SITES_CMD= ${ECHO} $$unsorted_sites | ${AWK} '${MASTER_SORT_AWK}'
+ORDERED_SITES= ${_MASTER_SITE_OVERRIDE} `${SORT_SITES_CMD:S/\\/\\\\/g:C/"/\"/g}`
+.else
+ORDERED_SITES= ${_MASTER_SITE_OVERRIDE} $$unsorted_sites
+.endif
+
+#
+# Associate each file to fetch with the correct site(s).
+#
+.if defined(DYNAMIC_MASTER_SITES)
+. for fetchfile in ${_ALLFILES}
+SITES_${fetchfile:T:S/=/--/}?= `${SH} ${FILESDIR}/getsite.sh ${fetchfile:T}`
+SITES.${fetchfile:T:S/=/--/}?= ${SITES_${fetchfile:T:S/=/--/}}
+. endfor
+.endif
+.if !empty(_DISTFILES)
+. for fetchfile in ${_DISTFILES}
+SITES_${fetchfile:T:S/=/--/}?= ${MASTER_SITES}
+SITES.${fetchfile:T:S/=/--/}?= ${SITES_${fetchfile:T:S/=/--/}}
+. endfor
+.endif
+.if !empty(_PATCHFILES)
+. for fetchfile in ${_PATCHFILES}
+SITES_${fetchfile:T:S/=/--/}?= ${PATCH_SITES}
+SITES.${fetchfile:T:S/=/--/}?= ${SITES_${fetchfile:T:S/=/--/}}
+. endfor
+.endif
+
+# This code is only called in a batch case, to check for the presence of
+# the distfiles
+.PHONY: batch-check-distfiles
+batch-check-distfiles:
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ gotfiles=yes; \
+ for file in "" ${_ALLFILES}; do \
+ case "$$file" in \
+ "") continue ;; \
+ *) if [ ! -f ${DISTDIR}/$$file ]; then \
+ gotfiles=no; \
+ fi ;; \
+ esac; \
+ done; \
+ case "$$gotfiles" in \
+ no) ${ECHO} "*** This package requires user intervention to download the distfiles"; \
+ ${ECHO} "*** Please fetch the distfiles manually and place them in"; \
+ ${ECHO} "*** ${DISTDIR}"; \
+ [ ! -z "${MASTER_SITES}" ] && \
+ ${ECHO} "*** The distfiles are available from ${MASTER_SITES}"; \
+ [ ! -z "${HOMEPAGE}" ] && \
+ ${ECHO} "*** See ${HOMEPAGE} for more details"; \
+ ${ECHO}; \
+ ${TOUCH} ${_INTERACTIVE_COOKIE}; \
+ ${FALSE} ;; \
+ esac
+
+.PHONY: do-fetch
+.if !target(do-fetch)
+do-fetch:
+. if !defined(ALLOW_VULNERABLE_PACKAGES)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ if [ -f ${PKGVULNDIR}/pkg-vulnerabilities ]; then \
+ ${PHASE_MSG} "Checking for vulnerabilities in ${PKGNAME}"; \
+ vul=`${MAKE} ${MAKEFLAGS} check-vulnerable`; \
+ case "$$vul" in \
+ "") ;; \
+ *) ${ECHO} "$$vul"; \
+ ${ECHO} "or define ALLOW_VULNERABLE_PACKAGES if this package is absolutely essential"; \
+ ${FALSE} ;; \
+ esac; \
+ else \
+ ${WARNING_MSG} "No ${PKGVULNDIR}/pkg-vulnerabilities file found,"; \
+ ${WARNING_MSG} "skipping vulnerability checks. To fix, install"; \
+ ${WARNING_MSG} "the pkgsrc/security/audit-packages package and run"; \
+ ${WARNING_MSG} "\`\`${LOCALBASE}/sbin/download-vulnerability-list''."; \
+ fi
+. endif
+. if !empty(_ALLFILES)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ ${TEST} -d ${_DISTDIR} || ${MKDIR} ${_DISTDIR}
+. if !empty(INTERACTIVE_STAGE:Mfetch) && defined(BATCH)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ ${MAKE} ${MAKEFLAGS} batch-check-distfiles
+. else
+. for fetchfile in ${_ALLFILES}
+. if defined(FETCH_MESSAGE) && !empty(FETCH_MESSAGE)
+ ${_PKG_SILENT}${_PKG_DEBUG} set -e; \
+ ${TEST} -f ${DISTDIR:Q}/${fetchfile:Q} || { \
+ h="==============="; h="$$h$$h$$h$$h$$h"; \
+ ${ECHO} "$$h"; ${ECHO} ""; \
+ for l in ${FETCH_MESSAGE}; do ${ECHO} "$$l"; done; \
+ ${ECHO} ""; ${ECHO} "$$h"; \
+ exit 1; \
+ }
+. elif defined(_FETCH_MESSAGE)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ file="${fetchfile}"; \
+ if [ ! -f ${DISTDIR}/$$file ]; then \
+ ${_FETCH_MESSAGE}; \
+ fi
+. else
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ cd ${_DISTDIR}; \
+ file="${fetchfile}"; \
+ bfile="${fetchfile:T}"; \
+ unsorted_sites="${SITES.${fetchfile:T:S/=/--/}} ${_MASTER_SITE_BACKUP}"; \
+ sites="${ORDERED_SITES}"; \
+ ${_CHECK_DIST_PATH}; \
+ if ${TEST} "${PKG_RESUME_TRANSFERS:M[Yy][Ee][Ss]}" ; then \
+ ${_FETCH_FILE}; ${_RESUME_TRANSFER}; \
+ else \
+ ${_FETCH_FILE}; \
+ fi
+. endif # defined(_FETCH_MESSAGE)
+. endfor
+. endif # INTERACTIVE_STAGE == fetch
+. endif # !empty(_ALLFILES)
+.endif
+
+.PHONY: show-distfiles
+.if !target(show-distfiles)
+show-distfiles:
+. if defined(PKG_FAIL_REASON)
+ ${_PKG_SILENT}${_PKG_DEBUG}${DO_NADA}
+. else
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ for file in "" ${_CKSUMFILES}; do \
+ if [ "X$$file" = "X" ]; then continue; fi; \
+ ${ECHO} $$file; \
+ done
+. endif
+.endif
+
+.if !target(pre-fetch)
+pre-fetch:
+ @${DO_NADA}
+.endif
+.if !target(post-fetch)
+post-fetch:
+ @${DO_NADA}
+.endif
+
+# This is for the use of sites which store distfiles which others may
+# fetch - only fetch the distfile if it is allowed to be
+# re-distributed freely
+.PHONY: mirror-distfiles
+mirror-distfiles:
+.if !defined(NO_SRC_ON_FTP)
+ @${_PKG_SILENT}${_PKG_DEBUG}${MAKE} ${MAKEFLAGS} fetch NO_SKIP=yes
+.endif
+
+# Prints out a script to fetch all needed files (no checksumming).
+.PHONY: fetch-list
+.if !target(fetch-list)
+
+fetch-list:
+ @${ECHO} '#!/bin/sh'
+ @${ECHO} '#'
+ @${ECHO} '# This is an auto-generated script, the result of running'
+ @${ECHO} '# `${MAKE} fetch-list'"'"' in directory "'"`${PWD_CMD}`"'"'
+ @${ECHO} '# on host "'"`${UNAME} -n`"'" on "'"`date`"'".'
+ @${ECHO} '#'
+ @${MAKE} ${MAKEFLAGS} fetch-list-recursive
+.endif # !target(fetch-list)
+
+.PHONY: fetch-list-recursive
+.if !target(fetch-list-recursive)
+
+fetch-list-recursive:
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ for dir in `${MAKE} ${MAKEFLAGS} show-all-depends-dirs`; do \
+ (cd ../../$$dir && \
+ ${MAKE} ${MAKEFLAGS} fetch-list-one-pkg \
+ | ${AWK} ' \
+ /^[^#]/ { FoundSomething = 1 } \
+ /^unsorted/ { gsub(/[[:space:]]+/, " \\\n\t") } \
+ /^echo/ { gsub(/;[[:space:]]+/, "\n") } \
+ { block[line_c++] = $$0 } \
+ END { if (FoundSomething) \
+ for (line = 0; line < line_c; line++) \
+ print block[line] } \
+ ') \
+ done
+.endif # !target(fetch-list-recursive)
+
+.PHONY: fetch-list-one-pkg
+.if !target(fetch-list-one-pkg)
+
+fetch-list-one-pkg:
+. if !empty(_ALLFILES)
+ @${ECHO}
+ @${ECHO} '#'
+ @location=`${PWD_CMD} | ${AWK} -F / '{ print $$(NF-1) "/" $$NF }'`; \
+ ${ECHO} '# Need additional files for ${PKGNAME} ('$$location')...'
+. for fetchfile in ${_ALLFILES}
+. if defined(_FETCH_MESSAGE)
+ @(if [ ! -f ${_DISTDIR}/${fetchfile:T} ]; then \
+ ${ECHO}; \
+ filesize=`${AWK} ' \
+ /^Size/ && $$2 == "(${fetchfile})" { print $$4 } \
+ ' ${DISTINFO_FILE}` || true; \
+ ${ECHO} '# Prompt user to get ${fetchfile} ('$${filesize-???}' bytes) manually:'; \
+ ${ECHO} '#'; \
+ ${ECHO} ${_FETCH_MESSAGE:Q}; \
+ fi)
+. elif defined(DYNAMIC_MASTER_SITES)
+ @(if [ ! -f ${_DISTDIR}/${fetchfile:T} ]; then \
+ ${ECHO}; \
+ filesize=`${AWK} ' \
+ /^Size/ && $$2 == "(${fetchfile})" { print $$4 } \
+ ' ${DISTINFO_FILE}` || true; \
+ ${ECHO} '# Fetch ${fetchfile} ('$${filesize-???}' bytes):'; \
+ ${ECHO} '#'; \
+ ${ECHO} '${SH} -s ${fetchfile:T} <<"EOF" |('; \
+ ${CAT} ${FILESDIR}/getsite.sh; \
+ ${ECHO} EOF; \
+ ${ECHO} read unsorted_sites; \
+ ${ECHO} 'unsorted_sites="$${unsorted_sites} ${_MASTER_SITE_BACKUP}"'; \
+ ${ECHO} sites='"'${ORDERED_SITES:Q}'"'; \
+ ${ECHO} "${MKDIR} ${_DISTDIR}"; \
+ ${ECHO} 'cd ${_DISTDIR} && [ -f ${fetchfile} -o -f ${fetchfile:T} ] ||'; \
+ ${ECHO} 'for site in $$sites; do'; \
+ ${ECHO} ' ${FETCH_CMD} ${FETCH_BEFORE_ARGS} "$${site}${fetchfile:T}" ${FETCH_AFTER_ARGS} && break ||'; \
+ ${ECHO} ' ${ECHO} ${fetchfile:T} not fetched'; \
+ ${ECHO} done; \
+ ${ECHO} ')'; \
+ fi)
+. else
+ @(if [ ! -f ${_DISTDIR}/${fetchfile:T} ]; then \
+ ${ECHO}; \
+ filesize=`${AWK} ' \
+ /^Size/ && $$2 == "(${fetchfile})" { print $$4 } \
+ ' ${DISTINFO_FILE}` || true; \
+ ${ECHO} '# Fetch ${fetchfile} ('$${filesize-???}' bytes):'; \
+ ${ECHO} '#'; \
+ ${ECHO} 'unsorted_sites="${SITES.${fetchfile:T:S/=/--/}} ${_MASTER_SITE_BACKUP}"'; \
+ ${ECHO} sites='"'${ORDERED_SITES:Q}'"'; \
+ ${ECHO} "${MKDIR} ${_DISTDIR}"; \
+ ${ECHO} 'cd ${_DISTDIR} && [ -f ${fetchfile} -o -f ${fetchfile:T} ] ||'; \
+ ${ECHO} 'for site in $$sites; do'; \
+ ${ECHO} ' ${FETCH_CMD} ${FETCH_BEFORE_ARGS} "$${site}${fetchfile:T}" ${FETCH_AFTER_ARGS} && break ||'; \
+ ${ECHO} ' ${ECHO} ${fetchfile:T} not fetched'; \
+ ${ECHO} done; \
+ fi)
+. endif # defined(_FETCH_MESSAGE) || defined(DYNAMIC_MASTER_SITES)
+. endfor
+. endif # !empty(_ALLFILES)
+.endif # !target(fetch-list-one-pkg)
diff --git a/mk/fetch/sites.mk b/mk/fetch/sites.mk
new file mode 100644
index 00000000000..8ee4cb604a3
--- /dev/null
+++ b/mk/fetch/sites.mk
@@ -0,0 +1,398 @@
+# $NetBSD: sites.mk,v 1.1 2006/06/06 03:05:48 jlam Exp $
+#
+# This Makefile fragment defines read-only MASTER_SITE_* variables
+# representing some well-known master distribution sites for software.
+#
+
+MASTER_SITE_XCONTRIB+= \
+ ftp://ftp.gwdg.de/pub/x11/x.org/contrib/ \
+ ftp://sunsite.doc.ic.ac.uk/sites/ftp.x.org/contrib/ \
+ ftp://sunsite.sut.ac.jp/pub/archives/X11/contrib/ \
+ ftp://sunsite.icm.edu.pl/pub/X11/contrib/ \
+ ftp://sunsite.cnlab-switch.ch/mirror/X11/contrib/ \
+ ftp://ftp.cica.es/pub/X/contrib/ \
+ ftp://ftp.unicamp.br/pub/X11/contrib/ \
+ ftp://ftp.x.org/contrib/
+
+MASTER_SITE_GNU+= \
+ ftp://ftp.gnu.org/pub/gnu/ \
+ ftp://ftp.funet.fi/pub/gnu/prep/ \
+ ftp://ftp.wustl.edu/mirrors/gnu/ \
+ ftp://ftp.kddlabs.co.jp/pub/gnu/gnu/ \
+ ftp://ftp.dti.ad.jp/pub/GNU/ \
+ ftp://ftp.mirror.ac.uk/sites/ftp.gnu.org/gnu/ \
+ ftp://ftp.informatik.hu-berlin.de/pub/gnu/ \
+ ftp://ftp.rediris.es/mirror/GNU/gnu/ \
+ ftp://ftp.lip6.fr/pub/gnu/ \
+ ftp://ftp.tuwien.ac.at/linux/gnu/gnusrc/ \
+ ftp://ftp.chg.ru/pub/gnu/ \
+ ftp://ftp.fi.muni.cz/pub/gnu/gnu/
+
+MASTER_SITE_GNUSTEP+= \
+ ftp://ftp.gnustep.org/pub/gnustep/ \
+ http://www.peanuts.org/peanuts/Mirrors/GNUstep/gnustep/ \
+ ftp://archive.progeny.com/gnustep/ \
+ http://archive.progeny.com/gnustep/ \
+ ftp://ftp.easynet.nl/mirror/GNUstep/pub/gnustep/ \
+ http://ftp.easynet.nl/mirror/GNUstep/pub/gnustep/
+
+MASTER_SITE_PERL_CPAN+= \
+ ftp://cpan.pair.com/modules/by-module/ \
+ http://ftp.u-paris10.fr/perl/CPAN/modules/by-module/ \
+ ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module/ \
+ ftp://ftp.gmd.de/mirrors/CPAN/modules/by-module/ \
+ ftp://ftp.tuwien.ac.at/pub/CPAN/modules/by-module/ \
+ ftp://mirrors.cloud9.net/mirrors/CPAN/modules/by-module/ \
+ http://cpan.perl.org/CPAN/modules/by-module/ \
+ ftp://ftp.fi.muni.cz/pub/CPAN/modules/by-module/
+
+MASTER_SITE_R_CRAN+= \
+ http://cran.r-project.org/src/ \
+ ftp://cran.r-project.org/pub/R/src/ \
+ http://cran.at.r-project.org/src/ \
+ ftp://cran.at.r-project.org/pub/R/src/ \
+ http://cran.dk.r-project.org/src/ \
+ http://cran.ch.r-project.org/src/ \
+ http://cran.uk.r-project.org/src/ \
+ http://cran.us.r-project.org/src/ \
+ http://lib.stat.cmu.edu/R/CRAN/src/ \
+ ftp://ftp.u-aizu.ac.jp/pub/lang/R/CRAN/src/ \
+ http://stat.ethz.ch/CRAN/src/ \
+ http://www.stats.bris.ac.uk/R/src/
+
+MASTER_SITE_TEX_CTAN+= \
+ ftp://ftp.funet.fi/pub/TeX/CTAN/ \
+ ftp://ftp.tex.ac.uk/tex-archive/ \
+ ftp://ftp.dante.de/tex-archive/ \
+ ftp://ftp.fi.muni.cz/pub/text/CTAN/
+
+MASTER_SITE_SUNSITE+= \
+ ftp://sunsite.unc.edu/pub/Linux/ \
+ ftp://ftp.chg.ru/pub/Linux/sunsite/ \
+ ftp://ftp.kddlabs.co.jp/Linux/metalab.unc.edu/ \
+ ftp://ftp.icm.edu.pl/pub/Linux/sunsite/ \
+ ftp://ftp.nvg.ntnu.no/pub/mirrors/metalab.unc.edu/ \
+ ftp://ftp.uvsq.fr/pub5/linux/sunsite/ \
+ ftp://ftp.lip6.fr/pub/linux/sunsite/ \
+ ftp://ftp.uni-stuttgart.de/pub/mirror/sunsite.unc.edu/pub/Linux/ \
+ ftp://ftp.cs.tu-berlin.de/pub/linux/Mirrors/sunsite.unc.edu/ \
+ ftp://sunsite.cnlab-switch.ch/mirror/linux/sunsite/ \
+ ftp://ftp.tuwien.ac.at/pub/linux/ibiblio/
+
+MASTER_SITE_GNOME+= \
+ ftp://ftp.gnome.org/pub/GNOME/ \
+ ftp://ftp.sunet.se/pub/X11/GNOME/ \
+ ftp://ftp.tuwien.ac.at/hci/GNOME/ \
+ ftp://ftp.cse.buffalo.edu/pub/Gnome/ \
+ ftp://ftp.dti.ad.jp/pub/X/gnome/ \
+ ftp://ftp.kddlabs.co.jp/pub/GNOME/ \
+ ftp://ftp.chg.ru/pub/X11/gnome/ \
+ ftp://ftp.dataplus.se/pub/linux/gnome/ \
+ ftp://ftp.dit.upm.es/linux/gnome/
+
+MASTER_SITE_KDE+= \
+ ftp://ftp.kde.org/pub/kde/stable/ \
+ ftp://ftp.uk.kde.org/pub/kde/stable/ \
+ ftp://download.au.kde.org/pub/kde/stable/ \
+ ftp://mirrors.midco.net/pub/kde/stable/ \
+ ftp://ftp.eu.uu.net/pub/kde/stable/ \
+ ftp://ftp.tiscali.nl/pub/mirrors/kde/stable/ \
+ ftp://ftp.roedu.net/pub/mirrors/ftp.kde.org/stable/ \
+ ftp://ftp.rediris.es/mirror/kde/stable/ \
+ ftp://ftp.du.se/pub/mirrors/kde/stable/ \
+ ftp://download.tw.kde.org/pub/kde/stable/ \
+ ftp://www.t.ring.gr.jp/pub/X/kde/stable/ \
+ http://www.t.ring.gr.jp/archives/X/kde/stable/ \
+ ftp://ftp.kddlabs.co.jp/pub/X/kde/stable/ \
+ ftp://ftp.de.kde.org/pub/kde/stable/ \
+ ftp://ftp.planetmirror.com.au/pub/kde/stable/ \
+ http://ftp.planetmirror.com.au/pub/kde/stable/
+
+MASTER_SITE_SOURCEFORGE+= \
+ http://easynews.dl.sourceforge.net/sourceforge/ \
+ http://heanet.dl.sourceforge.net/sourceforge/ \
+ http://internap.dl.sourceforge.net/sourceforge/ \
+ http://jaist.dl.sourceforge.net/sourceforge/ \
+ http://keihanna.dl.sourceforge.net/sourceforge/ \
+ http://kent.dl.sourceforge.net/sourceforge/ \
+ http://mesh.dl.sourceforge.net/sourceforge/ \
+ http://nchc.dl.sourceforge.net/sourceforge/ \
+ http://optusnet.dl.sourceforge.net/sourceforge/ \
+ http://ovh.dl.sourceforge.net/sourceforge/ \
+ http://puzzle.dl.sourceforge.net/sourceforge/ \
+ http://surfnet.dl.sourceforge.net/sourceforge/ \
+ http://switch.dl.sourceforge.net/sourceforge/ \
+ http://ufpr.dl.sourceforge.net/sourceforge/ \
+ http://voxel.dl.sourceforge.net/sourceforge/
+# http://belnet.dl.sourceforge.net/sourceforge/
+# http://citkit.dl.sourceforge.net/sourceforge/
+# ftp://ftp2.sourceforge.net/pub/sourceforge/
+# ftp://ftp.tuwien.ac.at/linux/sourceforge/
+# http://sf.gds.tuwien.ac.at/
+
+MASTER_SITE_SOURCEFORGE_JP+= \
+ http://prdownloads.sourceforge.jp/ \
+ http://downloads.sourceforge.jp/ \
+ http://osdn.dl.sourceforge.jp/ \
+ http://keihanna.dl.sourceforge.jp/
+
+MASTER_SITE_SUSE+= \
+ ftp://rpmfind.net/linux/SuSE-Linux/${MACHINE_ARCH}/update/${SUSE_VERSION}/ \
+ ftp://fr.rpmfind.net/linux/SuSE-Linux/${MACHINE_ARCH}/update/${SUSE_VERSION}/ \
+ ftp://fr2.rpmfind.net/linux/SuSE-Linux/${MACHINE_ARCH}/update/${SUSE_VERSION}/ \
+ ftp://ftp.duth.gr/pub/suse/suse/${MACHINE_ARCH}/${SUSE_VERSION}/suse/ \
+ ftp://ftp.kddlabs.co.jp/Linux/packages/SuSE/suse/${MACHINE_ARCH}/${SUSE_VERSION}/suse/ \
+ ftp://sunsite.cnlab-switch.ch/mirror/SuSE/suse/${MACHINE_ARCH}/${SUSE_VERSION}/suse/ \
+ ftp://ftp.mirror.ac.uk/sites/ftp.suse.com/${MACHINE_ARCH}/${SUSE_VERSION}/suse/ \
+ ftp://mirror.mcs.anl.gov/pub/ftp.suse.com/${MACHINE_ARCH}/${SUSE_VERSION}/suse/
+
+MASTER_SITE_MOZILLA+= \
+ ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/ \
+ ftp://ftp.fu-berlin.de/unix/network/www/mozilla/releases/ \
+ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.mozilla.org/pub/mozilla/releases/ \
+ ftp://ftp.funet.fi/pub/mirrors/ftp.mozilla.org/mozilla/releases/ \
+ http://public.planetmirror.com.au/pub/mozilla/releases/ \
+ ftp://ftp.rediris.es/mirror/mozilla/releases/ \
+ ftp://ftp.chg.ru/pub/WWW/mozilla/mozilla/releases/
+
+MASTER_SITE_XEMACS+= \
+ ftp://ftp.xemacs.org/pub/xemacs/ \
+ ftp://ftp.dti.ad.jp/pub/unix/editor/xemacs/ \
+ ftp://ftp.pasteur.fr/pub/computing/xemacs/ \
+ http://public.planetmirror.com.au/pub/xemacs/ \
+ ftp://mirror.aarnet.edu.au/pub/xemacs/ \
+ ftp://mirror.cict.fr/xemacs/ \
+ ftp://ftp.t.ring.gr.jp/pub/text/xemacs/ \
+ ftp://ftp.mpi-sb.mpg.de/pub/gnu/mirror/ftp.xemacs.org/xemacs/ \
+ ftp://ftp.tu-darmstadt.de/pub/editors/xemacs/
+
+MASTER_SITE_APACHE+= \
+ http://www.apache.org/dist/ \
+ http://mirrors.ccs.neu.edu/Apache/dist/ \
+ http://apache.planetmirror.com.au/dist/ \
+ http://www.ibiblio.org/pub/mirrors/apache/ \
+ http://apache.towardex.com/ \
+ http://apache.oregonstate.edu/ \
+ http://www.tux.org/pub/net/apache/dist/ \
+ http://apache.secsup.org/dist/ \
+ http://apache.osuosl.org/ \
+ http://sunsite.tus.ac.jp/pub/apache/ \
+ http://www.mirrorservice.org/sites/ftp.apache.org/ \
+ ftp://ftp.ccs.neu.edu/net/mirrors/Apache/dist/ \
+ ftp://ftp.planetmirror.com.au/pub/apache/dist/ \
+ ftp://ftp.tux.org/pub/net/apache/dist/ \
+ ftp://www.ibiblio.org/pub/mirrors/apache/ \
+ ftp://ftp.oregonstate.edu/pub/apache/ \
+ ftp://apache.secsup.org/pub/apache/dist/ \
+ ftp://sunsite.tus.ac.jp/pub/archives/www/apache/ \
+ ftp://ftp.mirrorservice.org/sites/ftp.apache.org/
+
+MASTER_SITE_MYSQL+= \
+ ftp://ftp.easynet.be/mysql/Downloads/ \
+ ftp://ftp.fi.muni.cz/pub/mysql/Downloads/ \
+ http://mysql.mirrors.cybercity.dk/Downloads/ \
+ ftp://ftp.fh-wolfenbuettel.de/pub/database/mysql/Downloads/ \
+ ftp://ftp.gwdg.de/pub/misc/mysql/Downloads/ \
+ http://netmirror.org/mirror/mysql.com/Downloads/ \
+ ftp://netmirror.org/mysql.com/Downloads/ \
+ http://mirrors.ntua.gr/MySQL/Downloads/ \
+ ftp://ftp.ntua.gr/pub/databases/mysql/Downloads/ \
+ http://mysql.sote.hu/Downloads/ \
+ ftp://ftp.rhnet.is/pub/mysql/Downloads/ \
+ ftp://mirror.widexs.nl/pub/mysql/Downloads/ \
+ ftp://mirror.etf.bg.ac.yu/mysql/Downloads/ \
+ ftp://mirror.switch.ch/mirror/mysql/Downloads/ \
+ http://mysql.dp.ua/Downloads/ \
+ http://mysql.mirrored.ca/Downloads/ \
+ ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/ \
+ ftp://ftp.orst.edu/pub/mysql/Downloads/ \
+ http://mysql.mirrors.pair.com/Downloads/ \
+ ftp://mysql.bannerlandia.com.ar/mirrors/mysql/Downloads/ \
+ ftp://ftp.linorg.usp.br/mysql/Downloads/ \
+ ftp://ftp.cbn.net.id/mirror/mysql/Downloads/ \
+ http://download.softagency.net/MySQL/Downloads/
+
+MASTER_SITE_DEBIAN+= \
+ http://ftp.debian.org/debian/ \
+ http://ftp.at.debian.org/debian/ \
+ http://ftp.au.debian.org/debian/ \
+ http://ftp.wa.au.debian.org/debian/ \
+ http://ftp.bg.debian.org/debian/ \
+ http://ftp.br.debian.org/debian/ \
+ http://ftp.cl.debian.org/debian/ \
+ http://ftp.cz.debian.org/debian/ \
+ http://ftp.de.debian.org/debian/ \
+ http://ftp2.de.debian.org/debian/ \
+ http://ftp.ee.debian.org/debian/ \
+ http://ftp.es.debian.org/debian/ \
+ http://ftp.fi.debian.org/debian/ \
+ http://ftp.fr.debian.org/debian/ \
+ http://ftp2.fr.debian.org/debian/ \
+ http://ftp.uk.debian.org/debian/ \
+ http://ftp.hr.debian.org/debian/ \
+ http://ftp.ie.debian.org/debian/ \
+ http://ftp.is.debian.org/debian/ \
+ http://ftp.it.debian.org/debian/ \
+ http://ftp.jp.debian.org/debian/ \
+ http://ftp.nl.debian.org/debian/ \
+ http://ftp.no.debian.org/debian/ \
+ http://ftp.nz.debian.org/debian/ \
+ http://ftp.pl.debian.org/debian/ \
+ http://ftp.ru.debian.org/debian/ \
+ http://ftp.se.debian.org/debian/ \
+ http://ftp.si.debian.org/debian/ \
+ http://ftp.sk.debian.org/debian/ \
+ http://ftp.tr.debian.org/debian/ \
+ http://ftp.us.debian.org/debian/
+
+MASTER_SITE_OPENOFFICE+= \
+ http://mirrors.isc.org/pub/openoffice/ \
+ http://ftp.stardiv.de/pub/OpenOffice.org/ \
+ http://openoffice.mirrors.ilisys.com.au/ \
+ ftp://ftp.pucpr.br/openoffice/ \
+ http://openoffice.behrsolutions.com/ \
+ http://www.ibiblio.org/pub/mirrors/openoffice/ \
+ ftp://ftp.ussg.iu.edu/pub/openoffice/ \
+ http://openoffice.mirrors.pair.com/ftp/ \
+ http://gd.tuwien.ac.at/office/openoffice/ \
+ http://ftp.belnet.be/pub/mirror/ftp.openoffice.org/ \
+ ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/openoffice.org/ \
+ http://ftp.sh.cvut.cz/MIRRORS/OpenOffice/ \
+ http://mirrors.sunsite.dk/openoffice/ \
+ ftp://ftp.funet.fi/pub/mirrors/openoffice.org/ \
+ ftp://openoffice.cict.fr/openoffice/ \
+ http://ftp.club-internet.fr/pub/OpenOffice/ \
+ ftp://sunsite.informatik.rwth-aachen.de/pub/mirror/OpenOffice/ \
+ ftp://ftp.tu-chemnitz.de/pub/openoffice/ \
+ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.openoffice.org/ \
+ ftp://ftp.join.uni-muenster.de/pub/software/OpenOffice/ \
+ http://ftp.leo.org/download/pub/comp/general/office/openoffice/ \
+ ftp://openoffice.tu-bs.de/OpenOffice.org/ \
+ http://ftp.ntua.gr/pub/OpenOffice/ \
+ http://ftp.fsf.hu/OpenOffice.org/ \
+ http://ftp.rhnet.is/pub/OpenOffice/ \
+ http://na.mirror.garr.it/mirrors/openoffice/ \
+ http://vlaai.snt.utwente.nl/pub/software/openoffice/ \
+ http://niihau.student.utwente.nl/openoffice/ \
+ http://borft.student.utwente.nl/openoffice/ \
+ http://ftp.iasi.roedu.net/mirrors/openoffice.org/ \
+ ftp://ftp.arnes.si/packages/OpenOffice.org/ \
+ ftp://ftp.saix.net/pub/OpenOffice.org/ \
+ http://ftp.rediris.es/ftp/mirror/openoffice.org/ \
+ http://ftp.sunet.se/pub/Office/OpenOffice.org/ \
+ ftp://mirror.switch.ch/mirror/OpenOffice/ \
+ http://mirror.pacific.net.au/openoffice/ \
+ http://public.planetmirror.com.au/pub/openoffice/ \
+ http://komo.vlsm.org/openoffice/ \
+ ftp://ftp.kddlabs.co.jp/office/openoffice/ \
+ ftp://ftp.t.ring.gr.jp/pub/misc/openoffice/ \
+ http://mymirror.asiaosc.org/openoffice/ \
+ ftp://ftp.kr.freebsd.org/pub/openoffice/ \
+ http://www.fs.tum.de/~mrauch/OpenOffice/download/
+
+MASTER_SITE_CYGWIN+= \
+ http://mirrors.kernel.org/sources.redhat.com/cygwin/ \
+ http://mirrors.rcn.net/pub/sourceware/cygwin/ \
+ http://mirrors.xmission.com/cygwin/ \
+ ftp://ftp.t.ring.gr.jp/pub/pc/gnu-win32/ \
+ ftp://ftp.funet.fi/pub/mirrors/cygwin.com/pub/cygwin/
+
+MASTER_SITE_IFARCHIVE+= \
+ http://ifarchive.flavorplex.com/if-archive/ \
+ http://ifarchive.heanet.ie/if-archive/ \
+ http://ifarchive.giga.or.at/if-archive/
+
+### PGSQL list was last updated on 20050801.
+MASTER_SITE_PGSQL+= \
+ ftp://ftp.au.postgresql.org/pub/postgresql/ \
+ ftp://ftp2.au.postgresql.org/pub/postgresql/ \
+ ftp://ftp.at.postgresql.org/db/www.postgresql.org/pub/ \
+ ftp://ftp.be.postgresql.org/postgresql/ \
+ ftp://ftp.ba.postgresql.org/pub/postgresql/ \
+ ftp://ftp.br.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp3.bg.postgresql.org/postgresql/ \
+ ftp://ftp3.ca.postgresql.org/pub/ \
+ ftp://ftp4.ca.postgresql.org/pub/postgresql/ \
+ ftp://ftp.cl.postgresql.org/ftp/pub/postgresql/ \
+ ftp://ftp.cn.postgresql.org/ftp.postgresql.org/ \
+ ftp://ftp.co.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp2.cr.postgresql.org/pub/Unix/postgres/ \
+ ftp://ftp.hr.postgresql.org/postgresql/ \
+ ftp://ftp.cz.postgresql.org/pgsql/ \
+ ftp://ftp2.cz.postgresql.org/pub/postgresql/ \
+ ftp://ftp.dk.postgresql.org/postgresql/ \
+ ftp://ftp.ee.postgresql.org/mirrors/postgresql/ \
+ ftp://ftp.fr.postgresql.org/ \
+ ftp://ftp2.fr.postgresql.org/postgresql/ \
+ ftp://ftp3.fr.postgresql.org/pub/postgresql/ \
+ ftp://ftp.de.postgresql.org/mirror/postgresql/ \
+ ftp://ftp2.de.postgresql.org/pub/postgresql/ \
+ ftp://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/ \
+ ftp://ftp7.de.postgresql.org/pub/ftp.postgresql.org/ \
+ ftp://ftp8.de.postgresql.org/pub/misc/pgsql/ \
+ ftp://ftp.gr.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp2.gr.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp.hk.postgresql.org/postgresql/ \
+ ftp://ftp3.hu.postgresql.org/pub/postgresql/ \
+ ftp://ftp7.id.postgresql.org/pub/postgresql/ \
+ ftp://ftp8.id.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp.ie.postgresql.org/mirrors/ftp.postgresql.org/pub/ \
+ ftp://ftp2.ie.postgresql.org/mirrors/ftp.postgresql.org/ \
+ ftp://ftp.il.postgresql.org/ftp.postgresql.org/ \
+ ftp://ftp2.it.postgresql.org/mirrors/postgres/ \
+ ftp://ftp6.it.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp7.it.postgresql.org/pub/unix/postgres/ \
+ ftp://ftp.jp.postgresql.org/ \
+ ftp://ftp2.jp.postgresql.org/pub/postgresql/ \
+ ftp://ftp.kr.postgresql.org/postgresql/ \
+ ftp://ftp.lv.postgresql.org/pub/software/postgresql/ \
+ ftp://ftp.eu.postgresql.org/pub/unix/db/postgresql/ \
+ ftp://ftp.nl.postgresql.org:21/pub/mirror/postgresql/ \
+ ftp://ftp2.nl.postgresql.org/mirror/postgresql/ \
+ ftp://ftp4.nl.postgresql.org/postgresql.zeelandnet.nl/ \
+ ftp://ftp.nz.postgresql.org/postgresql/ \
+ ftp://ftp.no.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp6.pl.postgresql.org/pub/postgresql/ \
+ ftp://ftp7.pl.postgresql.org/pub/mirror/ftp.postgresql.org/ \
+ ftp://ftp8.pl.postgresql.org/pub/postgresql/ \
+ ftp://ftp.pt.postgresql.org/postgresql/ \
+ ftp://ftp.pr.postgresql.org/pub/Mirrors/postgresql/ \
+ ftp://ftp6.ro.postgresql.org/pub/mirrors/ftp.postgresql.org/ \
+ ftp://ftp.ru.postgresql.org/pub/mirrors/pgsql/ \
+ ftp://ftp2.ru.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp3.ru.postgresql.org/pub/mirror/postgresql/pub/ \
+ ftp://ftp7.ru.postgresql.org/pub/mirror/postgresql/ \
+ ftp://ftp2.sk.postgresql.org/pub/postgresql/ \
+ ftp://ftp5.es.postgresql.org/mirror/postgresql/ \
+ ftp://ftp.se.postgresql.org/pub/databases/relational/postgresql/ \
+ ftp://ftp2.ch.postgresql.org/pub/postgresql/ \
+ ftp://ftp.tw.postgresql.org/pub/postgresql/ \
+ ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/ \
+ ftp://ftp5.tw.postgresql.org/pub/Unix/Database/PostgreSQL/ \
+ ftp://ftp6.tr.postgresql.org/postgresql/ \
+ ftp://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/ \
+ ftp://ftp4.uk.postgresql.org/sites/ftp.postgresql.org/ \
+ ftp://ftp8.uk.postgresql.org/sites/ftp.postgresql.org/ \
+ ftp://ftp.us.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp3.us.postgresql.org/pub/postgresql/ \
+ ftp://ftp5.us.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp8.us.postgresql.org/postgresql/ \
+ ftp://ftp9.us.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp10.us.postgresql.org/pub/postgresql/ \
+ ftp://ftp22.us.postgresql.org/mirrors/ftp.postgresql.org/ \
+ ftp://ftp24.us.postgresql.org/postgresql/
+
+MASTER_SITE_FREEBSD+= \
+ ftp://ftp.FreeBSD.org/pub/FreeBSD/distfiles/ \
+ ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/distfiles/
+
+MASTER_SITE_FREEBSD_LOCAL+= \
+ ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/ \
+ ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/
+
+# The primary backup site.
+MASTER_SITE_BACKUP?= \
+ http://ftp.fi.NetBSD.org/pub/NetBSD/packages/distfiles/ \
+ ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/ \
+ http://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/ \
+ ftp://ftp.FreeBSD.org/pub/FreeBSD/distfiles/