Import sysutils/signon-ui version 0.17
[dports.git] / Mk / bsd.sites.mk
1 # bsd.sites.mk - Popular master sites.
2 #
3 # Sites_MAINTAINER=             ports@FreeBSD.org
4 #
5 # This file does not have any designated maintainer, so feel free to
6 # commit to it yourself.  However, it is generally a good idea to
7 # notify the principal maintainer in case you have a change to one of
8 # the software environments (KDE, GNOME, etc.).
9 #
10 # Also, this file is included from bsd.port.mk for all invocations, so
11 # committing a syntax error to this file is a cardinal sin, and will
12 # be punished accordingly.  DO NOT COMMIT SOMETHING YOU HAVEN'T TESTED.
13 # You have been warned. :)
14 #
15 # Note: because it is included for all invocations, please keep the size
16 # of this file manageable.  If a distfile is unfetchable from the first
17 # few dozen locations, it is unlikely to be fetchable from any past that,
18 # and those fetch failures will simply waste time and bandwidth.  Please
19 # pick a globally representative subset.
20 #
21 # Note: all entries should terminate with a slash.
22 #
23 # $FreeBSD$
24 #
25
26 # Where to put distfiles that don't have any other master site
27 .if !defined(IGNORE_MASTER_SITE_LOCAL)
28 MASTER_SITE_LOCAL+= \
29         http://distcache.FreeBSD.org/local-distfiles/%SUBDIR%/ \
30         http://distcache.us-east.FreeBSD.org/local-distfiles/%SUBDIR%/ \
31         http://distcache.eu.FreeBSD.org/local-distfiles/%SUBDIR%/ \
32         http://distcache.us-west.FreeBSD.org/local-distfiles/%SUBDIR%/
33
34 MASTER_SITE_PORTS_JP+= \
35         ftp://ports.jp.FreeBSD.org/pub/FreeBSD-jp/ports-jp/LOCAL_PORTS/%SUBDIR%/ \
36         ftp://ftp4.jp.FreeBSD.org/pub/FreeBSD-jp/ports-jp/LOCAL_PORTS/%SUBDIR%/ \
37         ftp://ftp.ics.es.osaka-u.ac.jp/pub/mirrors/FreeBSD-jp/ports-jp/LOCAL_PORTS/%SUBDIR%/
38 .endif
39
40 ##
41 ##      KEEP THIS LIST SORTED
42 ##
43
44 .if !defined(IGNORE_MASTER_SITE_AFTERSTEP)
45 MASTER_SITE_AFTERSTEP+= \
46         ftp://ftp.afterstep.org/%SUBDIR%/ \
47         ftp://ftp.kddlabs.co.jp/X11/AfterStep/%SUBDIR%/
48 .endif
49
50 .if !defined(IGNORE_MASTER_SITE_APACHE)
51 MASTER_SITE_APACHE+= \
52         https://www.apache.org/dist/%SUBDIR%/ \
53         https://archive.apache.org/dist/%SUBDIR%/ \
54         http://ftp.twaren.net/Unix/Web/apache/%SUBDIR%/ \
55         http://apache.mirror.uber.com.au/%SUBDIR%/ \
56         http://apache.spd.co.il/%SUBDIR%/ \
57         https://ftp.mirrorservice.org/sites/ftp.apache.org/%SUBDIR%/ \
58         https://ftp-stud.hs-esslingen.de/pub/Mirrors/ftp.apache.org/dist/%SUBDIR%/ \
59         ftp://mir1.ovh.net/ftp.apache.org/dist/%SUBDIR%/ \
60         ftp://ftp.forthnet.gr/pub/www/apache/%SUBDIR%/ \
61         ftp://xenia.sote.hu/pub/mirrors/www.apache.org/%SUBDIR%/ \
62         ftp://ftp.heanet.ie/mirrors/www.apache.org/dist/%SUBDIR%/ \
63         https://mirrors.ircam.fr/pub/apache/%SUBDIR%/
64 .endif
65
66 .if !defined(IGNORE_MASTER_SITE_APACHE_COMMONS_BINARIES)
67 MASTER_SITE_APACHE_COMMONS_BINARIES+= \
68         ${MASTER_SITE_APACHE:S,%SUBDIR%,commons/&/binaries,}
69 .endif
70
71 .if !defined(IGNORE_MASTER_SITE_APACHE_COMMONS_SOURCE)
72 MASTER_SITE_APACHE_COMMONS_SOURCE+= \
73         ${MASTER_SITE_APACHE:S,%SUBDIR%,commons/&/source,}
74 .endif
75
76 .if !defined(IGNORE_MASTER_SITE_APACHE_HTTPD)
77 MASTER_SITE_APACHE_HTTPD+= \
78         ${MASTER_SITE_APACHE:S,%SUBDIR%,httpd/&,}
79 .endif
80
81 .if !defined(IGNORE_MASTER_SITE_APACHE_JAKARTA)
82 MASTER_SITE_APACHE_JAKARTA+= \
83         ${MASTER_SITE_APACHE:S,%SUBDIR%,jakarta/&,}
84 .endif
85
86 .if !defined(IGNORE_MASTER_SITE_APACHE_TOMCAT)
87 MASTER_SITE_APACHE_TOMCAT+= \
88         ${MASTER_SITE_APACHE:S,%SUBDIR%,tomcat/&,}
89 .endif
90
91 .if !defined(IGNORE_MASTER_SITE_APACHE_XML)
92 MASTER_SITE_APACHE_XML+= \
93         ${MASTER_SITE_APACHE:S,%SUBDIR%,xml/&,}
94 .endif
95
96 .if !defined(IGNORE_MASTER_SITE_BERLIOS)
97 MASTER_SITE_BERLIOS+= \
98         ${MASTER_SITE_SOURCEFORGE}
99 .endif
100
101 .if !defined(IGNORE_MASTER_SITE_CHEESESHOP)
102 MASTER_SITE_CHEESESHOP+= \
103         https://files.pythonhosted.org/packages/%SUBDIR%/ \
104         https://pypi.python.org/packages/%SUBDIR%/
105 .endif
106
107 .if !defined(IGNORE_MASTER_SITE_COMP_SOURCES)
108 MASTER_SITE_COMP_SOURCES+= \
109         http://ftp.isc.org/pub/usenet/comp.sources.%SUBDIR%/ \
110         http://ftp.funet.fi/pub/archive/comp.sources.%SUBDIR%/ \
111         http://ftp.fi.netbsd.org/pub/misc/archive/comp.sources.%SUBDIR%/
112 .endif
113
114 .if !defined(IGNORE_MASTER_SITE_CRAN)
115 MASTER_SITE_CRAN+= \
116         https://cloud.r-project.org/%SUBDIR%/ \
117         https://stat.ethz.ch/CRAN/%SUBDIR%/ \
118         http://cran.utstat.utoronto.ca/%SUBDIR%/ \
119         https://cran.cnr.berkeley.edu/%SUBDIR%/ \
120         https://cran.csiro.au/%SUBDIR%/ \
121         https://mirrors.tuna.tsinghua.edu.cn/CRAN/%SUBDIR%/ \
122         http://camoruco.ing.uc.edu.ve/cran/%SUBDIR%/ \
123         https://mirror.las.iastate.edu/CRAN/%SUBDIR%/ \
124         https://cran.ma.imperial.ac.uk/%SUBDIR%/ \
125         https://cran.gis-lab.info/%SUBDIR%/ \
126         https://cran.ism.ac.jp/%SUBDIR%/
127 .endif
128
129 .if !defined(IGNORE_MASTER_SITE_CRAN_ARCHIVE)
130 MASTER_SITE_CRAN_ARCHIVE+= ${MASTER_SITE_CRAN:S,$,Archive/${PORTNAME}/,}
131 .endif
132
133 .if !defined(IGNORE_MASTER_SITE_DEBIAN)
134 MASTER_SITE_DEBIAN+= \
135         http://cdn.debian.net/debian/%SUBDIR%/ \
136         http://www.gtlib.gatech.edu/pub/debian/%SUBDIR%/ \
137         ftp://ftp.us.debian.org/debian/%SUBDIR%/ \
138         ${MASTER_SITE_DEBIAN_NON_US:S,/debian-non-US/,/debian/,}
139 .endif
140
141 .if !defined(IGNORE_MASTER_SITE_DEBIAN_NON_US)
142 MASTER_SITE_DEBIAN_NON_US+= \
143         http://ftp.au.debian.org/debian-non-US/%SUBDIR%/ \
144         ftp://ftp.bg.debian.org/debian-non-US/%SUBDIR%/ \
145         ftp://ftp.br.debian.org/debian-non-US/%SUBDIR%/ \
146         http://ftp.cl.debian.org/debian-non-US/%SUBDIR%/ \
147         ftp://ftp.cz.debian.org/debian-non-US/%SUBDIR%/ \
148         ftp://ftp.de.debian.org/debian-non-US/%SUBDIR%/ \
149         ftp://ftp.ee.debian.org/debian-non-US/%SUBDIR%/ \
150         ftp://ftp.es.debian.org/debian-non-US/%SUBDIR%/ \
151         ftp://ftp.fi.debian.org/debian-non-US/%SUBDIR%/ \
152         ftp://ftp.fr.debian.org/debian-non-US/%SUBDIR%/ \
153         http://ftp.hk.debian.org/debian-non-US/%SUBDIR%/ \
154         http://ftp.hr.debian.org/debian-non-US/%SUBDIR%/ \
155         ftp://ftp.hu.debian.org/debian-non-US/%SUBDIR%/ \
156         http://ftp.ie.debian.org/debian-non-US/%SUBDIR%/ \
157         ftp://ftp.is.debian.org/debian-non-US/%SUBDIR%/ \
158         http://ftp.it.debian.org/debian-non-US/%SUBDIR%/ \
159         http://ftp.jp.debian.org/debian-non-US/%SUBDIR%/ \
160         ftp://ftp.nl.debian.org/debian-non-US/%SUBDIR%/ \
161         ftp://ftp.no.debian.org/debian-non-US/%SUBDIR%/ \
162         ftp://ftp.pl.debian.org/debian-non-US/%SUBDIR%/ \
163         ftp://ftp.ru.debian.org/debian-non-US/%SUBDIR%/ \
164         ftp://ftp.se.debian.org/debian-non-US/%SUBDIR%/ \
165         ftp://ftp.si.debian.org/debian-non-US/%SUBDIR%/ \
166         ftp://ftp.sk.debian.org/debian-non-US/%SUBDIR%/ \
167         ftp://ftp.uk.debian.org/debian-non-US/%SUBDIR%/ \
168         http://ftp.wa.au.debian.org/debian-non-US/%SUBDIR%/ \
169         ftp://ftp2.de.debian.org/debian-non-US/%SUBDIR%/ \
170         ftp://ftp.snt.utwente.nl/pub/linux/debian-non-US/%SUBDIR%/ \
171         ftp://ftp.acc.umu.se/debian-non-US/%SUBDIR%/ \
172         ftp://mirror.symnds.com/debian-non-US/%SUBDIR%/
173 .endif
174
175 .if !defined(IGNORE_MASTER_SITE_DEBIAN_POOL)
176 MASTER_SITE_DEBIAN_POOL+= \
177         ${MASTER_SITE_DEBIAN:C|(/%SUBDIR%/)|/pool/main/${PORTNAME:C/^(.).*$/\1/}/${PORTNAME}/|}
178 .endif
179
180 .if !defined(IGNORE_MASTER_SITE_EASYSW)
181 MASTER_SITE_EASYSW+= \
182         http://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/%SUBDIR%/ \
183         ftp://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/%SUBDIR%/
184 .endif
185
186 .if !defined(IGNORE_MASTER_SITE_ECLIPSE)
187 MASTER_SITE_ECLIPSE+= \
188         ftp://sunsite.informatik.rwth-aachen.de/pub/mirror/eclipse.org/%SUBDIR%/ \
189         ftp://sunsite.informatik.rwth-aachen.de/pub/mirror/eclipse/%SUBDIR%/ \
190         https://ftp-stud.hs-esslingen.de/pub/Mirrors/eclipse/%SUBDIR%/ \
191         https://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/%SUBDIR%/ \
192         http://eclipse.stu.edu.tw/%SUBDIR%/
193 .endif
194
195 .if !defined(IGNORE_MASTER_SITE_EXIM)
196 MASTER_SITE_EXIM+= \
197         ftp://ftp.exim.org/pub/exim/%SUBDIR%/ \
198         ftp://mirror.easyname.at/exim-ftp/%SUBDIR%/ \
199         http://dl.ambiweb.de/mirrors/ftp.exim.org/exim/%SUBDIR%/ \
200         ftp://exim.noris.de/exim/%SUBDIR%/ \
201         ftp://ftp.bytemine.net/exim/exim/%SUBDIR%/ \
202         ftp://ftp.heanet.ie/pub/exim/%SUBDIR%/ \
203         https://ftp.heanet.ie/pub/exim/%SUBDIR%/ \
204         http://washitake.com/mail/exim/mirror/exim/%SUBDIR%/ \
205         ftp://ftp.kaist.ac.kr/exim/%SUBDIR%/ \
206         http://ftp.kaist.ac.kr/exim/%SUBDIR%/ \
207         ftp://sunsite.uio.no/pub/mail/exim/exim/%SUBDIR%/ \
208         ftp://sunsite.icm.edu.pl/pub/unix/mail/exim/exim/%SUBDIR%/ \
209         https://sunsite.icm.edu.pl/pub/unix/mail/exim/exim/%SUBDIR%/ \
210         ftp://mirrors.dominios.pt/pub/ftp.exim.org/exim/%SUBDIR%/ \
211         ftp://mirror.switch.ch/mirror/exim/exim/%SUBDIR%/ \
212         http://mirror.switch.ch/ftp/mirror/exim/exim/%SUBDIR%/ \
213         ftp://ftp.mirrorservice.org/sites/ftp.exim.org/pub/%SUBDIR%/ \
214         http://exim.telcom.net.ua/ftp/%SUBDIR/ \
215         ftp://idcnetwork.org/pub/exim/exim/%SUBDIR%/
216 .endif
217
218 .if !defined(IGNORE_MASTER_SITE_CENTOS_LINUX)
219 MASTER_SITE_CENTOS_LINUX+= \
220         http://mirror.centos.org/%SUBDIR%/:DEFAULT,amd64,i386 \
221         http://vault.centos.org/%SUBDIR%/:DEFAULT,amd64,i386,SOURCE
222 .endif
223
224 .if !defined(IGNORE_MASTER_SITE_EPEL)
225 MASTER_SITE_EPEL+= \
226         https://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/%SUBDIR%/:DEFAULT,amd64 \
227         https://dl.fedoraproject.org/pub/epel/6/i386/Packages/%SUBDIR%/:DEFAULT,i386 \
228         https://dl.fedoraproject.org/pub/epel/6/SRPMS/Packages/%SUBDIR%/:SOURCE \
229         http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/%SUBDIR%/:DEFAULT,amd64 \
230         http://dl.fedoraproject.org/pub/epel/6/i386/Packages/%SUBDIR%/:DEFAULT,i386 \
231         http://dl.fedoraproject.org/pub/epel/6/SRPMS/Packages/%SUBDIR%/:SOURCE
232 .endif
233
234 .if !defined(IGNORE_MASTER_SITE_EPEL7)
235 MASTER_SITE_EPEL7+= \
236         https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/%SUBDIR%/:DEFAULT,amd64 \
237         https://dl.fedoraproject.org/pub/epel/7/SRPMS/Packages/%SUBDIR%/:SOURCE \
238         http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/%SUBDIR%/:DEFAULT,amd64 \
239         http://dl.fedoraproject.org/pub/epel/7/SRPMS/Packages/%SUBDIR%/:SOURCE
240 .endif
241
242 .if !defined(IGNORE_MASTER_SITE_FEDORA_LINUX)
243 MASTER_SITE_FEDORA_LINUX+= \
244         https://archives.fedoraproject.org/pub/archive/fedora/linux/%SUBDIR%/:DEFAULT,SOURCE \
245         https://archives.fedoraproject.org/pub/archive/fedora/linux/%SUBDIR%/:DEFAULT,SOURCE \
246         ftp://ftp.pbone.net/vol4/archive.fedoraproject.org/fedora/linux/%SUBDIR%/:DEFAULT,SOURCE \
247         ftp://ftp.gmd.de/archives.fedoraproject.org/fedora/linux/%SUBDIR%/:DEFAULT,SOURCE \
248         ftp://mirror.fraunhofer.de/archives.fedoraproject.org/fedora/linux/%SUBDIR%/:DEFAULT,SOURCE \
249         ftp://ftp-mirror.bi.fraunhofer.de/archives.fedoraproject.org/fedora/linux/%SUBDIR%/:DEFAULT,SOURCE
250 .endif
251
252 .if !defined(IGNORE_MASTER_SITE_FARSIGHT)
253 MASTER_SITE_FARSIGHT+= \
254         https://dl.farsightsecurity.com/dist/%SUBDIR%/
255 .endif
256
257 .if !defined(IGNORE_MASTER_SITE_FESTIVAL)
258 MASTER_SITE_FESTIVAL+= \
259         http://www.festvox.org/packed/festival/%SUBDIR%/ \
260         http://www.cstr.ed.ac.uk/downloads/festival/%SUBDIR%/
261 .endif
262
263 .if !defined(IGNORE_MASTER_SITE_FESTIVAL_OGI)
264 MASTER_SITE_FESTIVAL_OGI+= \
265         ftp://ftp.tuwien.ac.at/opsys/linux/blinux/festival/mirror.ogi-synth_home/ \
266         http://www.cslu.ogi.edu/tts/download/data/
267 .endif
268
269 #
270 # FreeBSD mirror sites
271 #
272 # For the full list, see the Handbook:
273 #
274 #    http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html
275 #
276 .if !defined(IGNORE_MASTER_SITE_FREEBSD_ORG)
277 MASTER_SITE_FREEBSD_ORG+= \
278         https://download.FreeBSD.org/pub/FreeBSD/%SUBDIR%/ \
279         ftp://ftp.FreeBSD.org/pub/FreeBSD/%SUBDIR%/ \
280         ftp://ftp.se.FreeBSD.org/pub/FreeBSD/%SUBDIR%/ \
281         ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/%SUBDIR%/ \
282         ftp://ftp.uk.FreeBSD.org/pub/FreeBSD/%SUBDIR%/ \
283         ftp://ftp.ru.FreeBSD.org/pub/FreeBSD/%SUBDIR%/
284 .endif
285
286 .if !defined(IGNORE_MASTER_SITE_FRUGALWARE)
287 MASTER_SITE_FRUGALWARE+= \
288         ftp://ftp7.frugalware.org/pub/frugalware/frugalware-stable/source/%SUBDIR%/ \
289         ftp://ftp2.frugalware.org/mirror/ftp.frugalware.org/pub/frugalware/frugalware-stable/source/%SUBDIR%/ \
290         ftp://ftp6.frugalware.org/mirrors/linux/frugalware/frugalware-stable/source/%SUBDIR%/ \
291         ftp://ftp4.frugalware.org/pub/linux/distributions/frugalware/frugalware-stable/source/%SUBDIR%/ \
292         ftp://ftp12.frugalware.org/mirrors/ftp.frugalware.org/pub/frugalware/frugalware-stable/source/%SUBDIR%/ \
293         ftp://ftp10.frugalware.org/pub/linux/frugalware/frugalware-stable/source/%SUBDIR%/
294 #       ftp://ftp5.frugalware.org/packages/frugalware/pub/frugalware/frugalware-stable/source/%SUBDIR%/
295 #       ftp://ftp3.frugalware.org/mirrors/frugalware/pub/frugalware/frugalware-stable/source/%SUBDIR%/
296 #       ftp://ftp9.frugalware.org/pub/frugalware/frugalware-stable/source/%SUBDIR%/
297 .endif
298
299 .if !defined(IGNORE_MASTER_SITE_GCC)
300 MASTER_SITE_GCC+= \
301         https://mirrors.kernel.org/sourceware/gcc/%SUBDIR%/ \
302         http://gcc.parentingamerica.com/%SUBDIR%/ \
303         http://gcc.skazkaforyou.com/%SUBDIR%/ \
304         http://gcc.cybermirror.org/%SUBDIR%/ \
305         http://gcc-uk.internet.bs/%SUBDIR%/ \
306         http://www.netgull.com/gcc/%SUBDIR%/ \
307         http://robotlab.itk.ppke.hu/gcc/%SUBDIR%/ \
308         http://gcc.fyxm.net/%SUBDIR%/ \
309         https://ftp-stud.hs-esslingen.de/pub/Mirrors/sourceware.org/gcc/%SUBDIR%/ \
310         ftp://ftp.funet.fi/pub/mirrors/sourceware.org/pub/gcc/%SUBDIR%/ \
311         ftp://gcc.gnu.org/pub/gcc/%SUBDIR%/ \
312         ftp://ftp.lip6.fr/pub/gcc/%SUBDIR%/ \
313         ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/%SUBDIR%/ \
314         ftp://ftp.uvsq.fr/pub/gcc/%SUBDIR%/ \
315         ftp://ftp.gwdg.de/pub/misc/gcc/%SUBDIR%/ \
316         ftp://ftp.mpi-sb.mpg.de/pub/gnu/mirror/gcc.gnu.org/pub/gcc/%SUBDIR%/ \
317         ftp://ftp.nluug.nl/mirror/languages/gcc/%SUBDIR%/ \
318         ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/%SUBDIR%/ \
319         ftp://ftp.ntua.gr/pub/gnu/gcc/%SUBDIR%/
320 .endif
321
322 .if !defined(IGNORE_MASTER_SITE_GENTOO)
323 MASTER_SITE_GENTOO+= \
324         http://gentoo.mirrors.pair.com/%SUBDIR%/ \
325         http://mirrors.tds.net/pub/gentoo/%SUBDIR%/ \
326         ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/%SUBDIR%/ \
327         http://ftp.snt.utwente.nl/pub/os/linux/gentoo/%SUBDIR%/ \
328         http://trumpetti.atm.tut.fi/gentoo/%SUBDIR%/ \
329         https://ftp.uni-erlangen.de/pub/mirrors/gentoo/%SUBDIR%/ \
330         http://gentoo.inode.at/%SUBDIR%/ \
331         http://gentoo.gg3.net/%SUBDIR%/ \
332         http://mirrors.163.com/gentoo/%SUBDIR%/ \
333         ftp://ftp.gtlib.gatech.edu/pub/gentoo/%SUBDIR%/ \
334         ftp://ftp.ussg.iu.edu/pub/linux/gentoo/%SUBDIR%/ \
335         ftp://mirrors.tds.net/pub/gentoo/%SUBDIR%/ \
336         ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/%SUBDIR%/ \
337         ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo/%SUBDIR%/ \
338         ftp://trumpetti.atm.tut.fi/gentoo/%SUBDIR%/ \
339         ftp://ftp.tu-clausthal.de/pub/linux/gentoo/%SUBDIR%/ \
340         ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo/%SUBDIR%/ \
341         ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/%SUBDIR%/ \
342         ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo/%SUBDIR%/ \
343         ftp://gentoo.inode.at/source/%SUBDIR%/
344 .endif
345
346 .if !defined(IGNORE_MASTER_SITE_GITHUB)
347 #
348 # In order to use GitHub your port must define USE_GITHUB and the following
349 # variables:
350 #
351 # GH_ACCOUNT    - account name of the GitHub user hosting the project
352 #                 default: ${PORTNAME}
353 #
354 # GH_PROJECT    - name of the project on GitHub
355 #                 default: ${PORTNAME}
356 #
357 # GH_TAGNAME    - name of the tag to download (2.0.1, hash, ...)
358 #                 Using the name of a branch here is incorrect. It is
359 #                 possible to do GH_TAGNAME= GIT_HASH to do a snapshot.
360 #                 default: ${DISTVERSION}
361 #
362 # GH_SUBDIR     - directory relative to WRKSRC where to move this distfile's
363 #                 content after extracting.
364 #
365 # GH_TUPLE      - above shortened to account:project:tagname[:group][/subdir]
366 #
367 .if defined(USE_GITHUB)
368 .  if defined(GH_TAGNAME) && ${GH_TAGNAME} == master
369 IGNORE?=        Using master as GH_TAGNAME is invalid. \
370                 Must use a tag or commit hash so the upstream does \
371                 not "reroll" as soon as the branch is updated
372 .  endif
373 .  if defined(GH_TUPLE)
374 .    for _tuple in ${GH_TUPLE}
375 _t_tmp=${_tuple}
376 .      if ${_t_tmp:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\4@:S/://:C/[a-zA-Z0-9_]//g}
377 check-makevars::
378         @${ECHO_MSG} "The ${_tuple} GH_TUPLE line has"
379         @${ECHO_MSG} "a tag containing something else than [a-zA-Z0-9_]"
380         @${FALSE}
381 .      endif
382 .    endfor
383 GH_ACCOUNT+=    ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\1\4@}
384 GH_PROJECT+=    ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\2\4@}
385 GH_TAGNAME+=    ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\3\4@}
386 GH_SUBDIR+=     ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\6\4@:M/*:S/^\///}
387 .  endif
388 # We are cheating and using backend URLS for GitHub here. See ports/194898
389 # comment #15 for explanation as to why and how to deal with it if it breaks.
390 MASTER_SITE_GITHUB+=            https://codeload.github.com/%SUBDIR%
391 MASTER_SITE_GITHUB_CLOUD+=      https://cloud.github.com/downloads/%SUBDIR%
392
393 .  if !defined(MASTER_SITES) || !${MASTER_SITES:MGH} && !${MASTER_SITES:MGHC} && !${USE_GITHUB:Mnodefault}
394 MASTER_SITES+=  GH
395 .  endif
396 GH_ACCOUNT_DEFAULT=     ${PORTNAME}
397 GH_ACCOUNT?=    ${GH_ACCOUNT_DEFAULT}
398 GH_PROJECT_DEFAULT=     ${PORTNAME}
399 GH_PROJECT?=    ${GH_PROJECT_DEFAULT}
400 # Use full PREFIX/SUFFIX and converted DISTVERSION
401 GH_TAGNAME_DEFAULT=     ${DISTVERSIONFULL}
402 GH_TAGNAME?=    ${GH_TAGNAME_DEFAULT}
403 # Iterate over GH_ACCOUNT, GH_PROJECT, GH_TAGNAME and GH_SUBDIR to extract groups
404 _GITHUB_GROUPS= DEFAULT
405 .  for _gh_v in GH_ACCOUNT GH_PROJECT GH_TAGNAME GH_SUBDIR
406 .    for _v_ex in ${${_gh_v}}
407 _GH_GROUPS=     ${_v_ex:S/^${_v_ex:C@:[^/:]+$@@}//:S/^://}
408 .      if !empty(_GH_GROUPS)
409 .        for _group in ${_GH_GROUPS:S/,/ /g}
410 .          if ${_group} == all || ${_group} == ALL || ${_group} == default
411 check-makevars::
412                 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
413                 @${ECHO_MSG} "used in group definitions. Please fix your ${_gh_v}"
414                 @${FALSE}
415 .          endif
416 .          if !${_GITHUB_GROUPS:M${_group}}
417 _GITHUB_GROUPS+=        ${_group}
418 .          endif
419 ${_gh_v}_${_group}=     ${_v_ex:C@^(.*):[^/:]+$@\1@}
420 .        endfor
421 .      else
422 ${_gh_v}_DEFAULT=       ${_v_ex:C@^(.*):[^/:]+$@\1@}
423 .      endif
424 .    endfor
425 .  endfor
426 # Put the default values back into the variables so that the *default* behavior
427 # is not changed.
428 GH_ACCOUNT:=    ${GH_ACCOUNT_DEFAULT}
429 GH_PROJECT:=    ${GH_PROJECT_DEFAULT}
430 GH_TAGNAME:=    ${GH_TAGNAME_DEFAULT}
431 GH_SUBDIR:=     ${GH_SUBDIR_DEFAULT}
432 .  if defined(GH_TAGNAME)
433 GH_TAGNAME_SANITIZED=   ${GH_TAGNAME:S,/,-,g}
434 # GitHub silently converts tags starting with v to not have v in the filename
435 # and extraction directory.  It also replaces + with -.
436 GH_TAGNAME_EXTRACT=     ${GH_TAGNAME_SANITIZED:C/^[vV]([0-9])/\1/:S/+/-/g}
437 .  endif
438 .  if defined(_GITHUB_MUST_SET_DISTNAME)
439 # GH_TAGNAME defaults to DISTVERSIONFULL; Avoid adding DISTVERSIONFULL in twice
440 .    if ${GH_TAGNAME} != ${DISTVERSIONFULL}
441 DISTNAME=       ${GH_ACCOUNT}-${GH_PROJECT}-${DISTVERSIONFULL}-${GH_TAGNAME_SANITIZED}
442 .    else
443 DISTNAME=       ${GH_ACCOUNT}-${GH_PROJECT}-${GH_TAGNAME_SANITIZED}
444 .    endif
445 .  endif
446 # This new scheme rerolls distfiles. Also ensure they are renamed to avoid
447 # conflicts. Use _GITHUB_REV in case github changes their zipping or structure
448 # which has happened before.
449 _GITHUB_REV=    0
450 .  if ${MASTER_SITES:MGH}
451 DISTNAME:=      ${DISTNAME}_GH${_GITHUB_REV}
452 .  endif
453 _GITHUB_EXTRACT_SUFX=   .tar.gz
454 # Put the DEFAULT distfile first
455 _GITHUB_CLONE_DIR?=     ${WRKDIR}/git-clone
456 _PORTS_DIRECTORIES+=    ${_GITHUB_CLONE_DIR}
457 .  if !${USE_GITHUB:Mnodefault} && defined(_GITHUB_MUST_SET_DISTNAME)
458 DISTFILES+=     ${DISTNAME}${_GITHUB_EXTRACT_SUFX}
459 git-clone: git-clone-DEFAULT
460 git-clone-DEFAULT: ${_GITHUB_CLONE_DIR}
461         @git clone https://github.com/${GH_ACCOUNT_DEFAULT}/${GH_PROJECT_DEFAULT}.git ${_GITHUB_CLONE_DIR}/${GH_PROJECT_DEFAULT}
462         @${ECHO_MSG} "Cloned the default github repository into ${_GITHUB_CLONE_DIR}/${GH_PROJECT_DEFAULT}" | ${FMT_80}
463 .  endif
464 .  if !empty(GH_SUBDIR)
465 _SITES_extract:=        690:post-extract-gh-DEFAULT
466 post-extract-gh-DEFAULT:
467         @${RMDIR} ${WRKSRC}/${GH_SUBDIR_DEFAULT} 2>/dev/null || :
468         @${MKDIR} ${WRKSRC}/${GH_SUBDIR_DEFAULT:H} 2>/dev/null || :
469         @${LN} -s ${GH_SUBDIR_DEFAULT:C/[^\/]//g:C/\//..\//g:S/^$/./} ${WRKSRC}/${GH_SUBDIR_DEFAULT}
470 .  endif
471 # If there are non default groups
472 .  if !empty(_GITHUB_GROUPS:NDEFAULT)
473 # Then for each of the remaining groups, add DISTFILES and MASTER_SITES
474 # entries with the correct group and create {WRKSRC,DISTNAME,DISTFILES}_group
475 # helper variables.
476 .    for _group in ${_GITHUB_GROUPS:NDEFAULT}
477 GH_ACCOUNT_${_group}?=  ${GH_ACCOUNT_DEFAULT}
478 GH_PROJECT_${_group}?=  ${GH_PROJECT_DEFAULT}
479 GH_TAGNAME_${_group}?=  ${GH_TAGNAME_DEFAULT}
480 GH_TAGNAME_${_group}_SANITIZED= ${GH_TAGNAME_${_group}:S,/,-,}
481 GH_TAGNAME_${_group}_EXTRACT=   ${GH_TAGNAME_${_group}_SANITIZED:C/^[vV]([0-9])/\1/}
482 _GH_TUPLE_OUT:= ${_GH_TUPLE_OUT} ${GH_ACCOUNT_${_group}}:${GH_PROJECT_${_group}}:${GH_TAGNAME_${_group}}:${_group}/${GH_SUBDIR_${_group}}
483 DISTNAME_${_group}:=    ${GH_ACCOUNT_${_group}}-${GH_PROJECT_${_group}}-${GH_TAGNAME_${_group}_SANITIZED}
484 DISTFILE_${_group}:=    ${DISTNAME_${_group}}_GH${_GITHUB_REV}${_GITHUB_EXTRACT_SUFX}
485 DISTFILES:=     ${DISTFILES} ${DISTFILE_${_group}}:${_group}
486 MASTER_SITES:=  ${MASTER_SITES} ${MASTER_SITE_GITHUB:S@%SUBDIR%@${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}/tar.gz/${GH_TAGNAME_${_group}}?dummy=/:${_group}@}
487 WRKSRC_${_group}:=      ${WRKDIR}/${GH_PROJECT_${_group}}-${GH_TAGNAME_${_group}_EXTRACT}
488 .      if !empty(GH_SUBDIR_${_group})
489 # In order to sort the subdir extraction so that foo/bar is moved in before
490 # foo/bar/baz, we count the number of / in the path and use it to order the
491 # targets.  This handles up to 9 levels.  The max as of r463123 is 4.
492 _SITES_extract:=        ${_SITES_extract} 69${GH_SUBDIR_${_group}:C=[^/]+= =g:[#]}:post-extract-gh-${_group}
493 post-extract-gh-${_group}:
494         @${RMDIR} ${WRKSRC}/${GH_SUBDIR_${_group}} 2>/dev/null || :
495         @${MKDIR} ${WRKSRC}/${GH_SUBDIR_${_group}:H} 2>/dev/null || :
496         @${MV} ${WRKSRC_${_group}} ${WRKSRC}/${GH_SUBDIR_${_group}}
497         @${LN} -s ${WRKSRC:T}/${GH_SUBDIR_${_group}} ${WRKSRC_${_group}}
498 .      endif
499 git-clone: git-clone-${_group}
500 git-clone-${_group}: ${_GITHUB_CLONE_DIR}
501         @git clone https://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}.git ${_GITHUB_CLONE_DIR}/${GH_PROJECT_${_group}}
502         @${ECHO_MSG} "Cloned the ${_group} github repository into ${_GITHUB_CLONE_DIR}/${GH_PROJECT_${_group}}" | ${FMT_80}
503 .    endfor
504 .  endif
505 convert-to-gh-tuple:
506         @${ECHO_MSG} ${GH_ACCOUNT}:${GH_PROJECT}:${GH_TAGNAME} ${_GH_TUPLE_OUT:S/\/$//}
507 .endif # defined(USE_GITHUB)
508 .endif # !defined(IGNORE_MASTER_SITE_GITHUB)
509
510 .if !defined(IGNORE_MASTER_SITE_GITLAB)
511 #
512 # In order to use GitLab your port must define USE_GITLAB and the following
513 # variables:
514 #
515 # GL_SITE       - site URL hosting GitLab and the project
516 #                 default: https://gitlab.com
517 #
518 # GL_ACCOUNT    - account name of the GitLab user hosting the project
519 #                 default: ${PORTNAME}
520 #
521 # GL_PROJECT    - name of the project on GitLab
522 #                 default: ${PORTNAME}
523 #
524 # GL_COMMIT     - the commit hash of the repository, must be the full hash and
525 #                 is a required variable for GitLab.
526 #
527 # GL_SUBDIR     - directory relative to WRKSRC where to move this distfile's
528 #                 content after extracting.
529 #
530 # GL_TUPLE      - above shortened to [site[:port][/webroot]:]account:project:commit:group[/subdir]
531 #
532 .if defined(USE_GITLAB)
533 .  if defined(GL_TUPLE)
534 .    for _tuple in ${GL_TUPLE}
535 .      if ${_tuple:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\7@:S/^://:C/[a-f0-9]{40}//g}
536 check-makevars::
537         @${ECHO_MSG} "The ${_tuple}"
538         @${ECHO_MSG} "GL_TUPLE is improperly formatted or, the commit"
539         @${ECHO_MSG} "section contains something other than [a-f0-9]"
540         @${FALSE}
541 .      endif
542 .    endfor
543 GL_SITE+=       ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\1\8@}
544 GL_ACCOUNT+=    ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\5\8@}
545 GL_PROJECT+=    ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\6\8@}
546 GL_COMMIT+=     ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\7\8@}
547 GL_SUBDIR+=     ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\9\8@:M/*:S/^\///}
548 .  endif
549
550 .  if empty(USE_GITLAB:Mnodefault)
551 MASTER_SITES+=  ${GL_SITE}/${GL_ACCOUNT}/${GL_PROJECT}/repository/${GL_COMMIT}/archive.tar.gz?dummy=/
552 .  endif
553 GL_SITE_DEFAULT=        https://gitlab.com
554 GL_SITE?=       ${GL_SITE_DEFAULT}
555 GL_ACCOUNT_DEFAULT=     ${PORTNAME}
556 GL_ACCOUNT?=    ${GL_ACCOUNT_DEFAULT}
557 GL_PROJECT_DEFAULT=     ${PORTNAME}
558 GL_PROJECT?=    ${GL_PROJECT_DEFAULT}
559 _GITLAB_GROUPS= DEFAULT
560 .  for _gl_v in GL_SITE GL_ACCOUNT GL_PROJECT GL_COMMIT GL_SUBDIR
561 .    for _v_ex in ${${_gl_v}}
562 _GL_GROUPS=     ${_v_ex:S/^${_v_ex:C@:[^/:]+$@@}//:S/^://}
563 .      if !empty(_GL_GROUPS)
564 .        for _group in ${_GL_GROUPS:S/,/ /g}
565 .          if ${_group} == all || ${_group} == ALL || ${_group} == default
566 check-makevars::
567                 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
568                 @${ECHO_MSG} "used in group definitions. Please fix your ${_gl_v}"
569                 @${FALSE}
570 .          endif
571 .          if !${_GITLAB_GROUPS:M${_group}}
572 _GITLAB_GROUPS+=        ${_group}
573 .          endif
574 ${_gl_v}_${_group}=     ${_v_ex:C@^(.*):[^/:]+$@\1@}
575 .        endfor
576 .      else
577 ${_gl_v}_DEFAULT=       ${_v_ex:C@^(.*):[^/:]+$@\1@}
578 .      endif
579 .    endfor
580 .  endfor
581 GL_SITE:=       ${GL_SITE_DEFAULT}
582 GL_ACCOUNT:=    ${GL_ACCOUNT_DEFAULT}
583 GL_PROJECT:=    ${GL_PROJECT_DEFAULT}
584 GL_COMMIT:=     ${GL_COMMIT_DEFAULT}
585 GL_SUBDIR:=     ${GL_SUBDIR_DEFAULT}
586
587
588 _GITLAB_REV=    0
589 DISTNAME:=      ${GL_ACCOUNT}-${GL_PROJECT}-${GL_COMMIT}_GL${_GITLAB_REV}
590
591 _GITLAB_EXTRACT_SUFX=   .tar.gz
592
593 _GITLAB_CLONE_DIR?=     ${WRKDIR}/git-clone
594 _PORTS_DIRECTORIES+=    ${_GITLAB_CLONE_DIR}
595 .  if !${USE_GITLAB:Mnodefault}
596 DISTFILES+=     ${DISTNAME}${_GITLAB_EXTRACT_SUFX}
597 git-clone: git-clone-DEFAULT
598 git-clone-DEFAULT: ${_GITLAB_CLONE_DIR}
599         @git clone ${GL_SITE_DEFAULT}/${GL_ACCOUNT_DEFAULT}/${GL_PROJECT_DEFAULT}.git ${_GITLAB_CLONE_DIR}/${GL_PROJECT_DEFAULT}
600         @${ECHO_MSG} "Cloned the default GitLab repository into ${_GITLAB_CLONE_DIR}/${GL_PROJECT_DEFAULT}" | ${FMT_80}
601 .  endif
602 .  if !empty(GL_SUBDIR)
603 _SITES_extract:=        69${GL_SUBDIR_${_group}:C=[^/]+= =g:[#]}:post-extract-gl-DEFAULT
604 post-extract-gl-DEFAULT:
605         @${RMDIR} ${WRKSRC}/${GL_SUBDIR_DEFAULT} 2>/dev/null || :
606         @${MKDIR} ${WRKSRC}/${GL_SUBDIR_DEFAULT:H} 2>/dev/null || :
607         @${LN} -s ${GL_SUBDIR_DEFAULT:C/[^\/]//g:C/\//..\//g:S/^$/./} ${WRKSRC}/${GL_SUBDIR_DEFAULT}
608 .  endif
609 .  if !empty(_GITLAB_GROUPS:NDEFAULT)
610 .    for _group in ${_GITLAB_GROUPS:NDEFAULT}
611 # We set GL_SITE earlier, we need to verify its not empty
612 .      if empty(GL_SITE_${_group})
613 GL_SITE_${_group}=      ${GL_SITE_DEFAULT}
614 .      endif
615 GL_ACCOUNT_${_group}?=  ${GL_ACCOUNT_DEFAULT}
616 GL_PROJECT_${_group}?=  ${GL_PROJECT_DEFAULT}
617
618 _GL_TUPLE_OUT:= ${_GL_TUPLE_OUT} ${GL_SITE_${_group}}:${GL_ACCOUNT_${_group}}:${GL_PROJECT_${_group}}:${GL_COMMIT_${_group}}:${_group}/${GL_SUBDIR_${_group}}
619 DISTNAME_${_group}:=    ${GL_ACCOUNT}-${GL_PROJECT_${_group}}-${GL_COMMIT_${_group}}_GL${_GITLAB_REV}
620 DISTFILE_${_group}:=    ${DISTNAME_${_group}}${_GITLAB_EXTRACT_SUFX}
621 DISTFILES:=     ${DISTFILES} ${DISTFILE_${_group}}:${_group}
622 MASTER_SITES:=  ${MASTER_SITES} ${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}/repository/${GL_COMMIT_${_group}}/archive.tar.gz?dummy=/:${_group}
623 WRKSRC_${_group}:=      ${WRKDIR}/${GL_PROJECT_${_group}}-${GL_COMMIT_${_group}}-${GL_COMMIT_${_group}}
624 .      if !empty(GL_SUBDIR_${_group})
625 _SITES_extract:=        ${_SITES_extract} 690:post-extract-gl-${_group}
626 post-extract-gl-${_group}:
627         @${RMDIR} ${WRKSRC}/${GL_SUBDIR_${_group}} 2>/dev/null || :
628         @${MKDIR} ${WRKSRC}/${GL_SUBDIR_${_group}:H} 2>/dev/null || :
629         @${MV} ${WRKSRC_${_group}} ${WRKSRC}/${GL_SUBDIR_${_group}}
630         @${LN} -s ${WRKSRC:T}/${GL_SUBDIR_${_group}} ${WRKSRC_${_group}}
631 .      endif
632 git-clone: git-clone-${_group}
633 git-clone-${_group}: ${_GITLAB_CLONE_DIR}
634         @git clone ${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}.git ${_GITLAB_CLONE_DIR}/${GL_PROJECT_${_group}}
635         @${ECHO_MSG} "Cloned the ${_group} GitLab repository into ${_GITLAB_CLONE_DIR}/${GL_PROJECT_${_group}}" | ${FMT_80}
636 .    endfor
637 .  endif
638 .endif # defined(USE_GITLAB)
639 .endif # !defined(IGNORE_MASTER_SITE_GITLAB)
640
641 .if !defined(IGNORE_MASTER_SITE_GNOME)
642 MASTER_SITE_GNOME+= \
643         https://download.gnome.org/%SUBDIR%/ \
644         http://download.gnome.org/%SUBDIR%/ \
645         http://ftp.belnet.be/mirror/ftp.gnome.org/%SUBDIR%/ \
646         ftp://ftp.belnet.be/mirror/ftp.gnome.org/%SUBDIR%/ \
647         https://ftp.acc.umu.se/pub/GNOME/%SUBDIR%/ \
648         ftp://ftp.cse.buffalo.edu/pub/Gnome/%SUBDIR%/ \
649         https://fr2.rpmfind.net/linux/gnome.org/%SUBDIR%/ \
650         http://www.gtlib.gatech.edu/pub/gnome/%SUBDIR%/ \
651         ftp://ftp.kddlabs.co.jp/pub/GNOME/%SUBDIR%/ \
652         ftp://ftp.mirrorservice.org/sites/ftp.gnome.org/pub/GNOME/%SUBDIR%/ \
653         ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/%SUBDIR%/ \
654         https://ftp.gnome.org/pub/GNOME/%SUBDIR%/
655 .endif
656
657 .if !defined(IGNORE_MASTER_SITE_GIMP)
658 MASTER_SITE_GIMP+= \
659         http://gimp.mirrors.hoobly.com/pub/%SUBDIR%/ \
660         http://gimper.net/downloads/pub/%SUBDIR%/ \
661         http://mirror.hessmo.com/gimp/pub/%SUBDIR%/ \
662         http://de-mirror.gimper.net/pub/%SUBDIR%/ \
663         http://gimp.afri.cc/pub/%SUBDIR%/ \
664         https://download.gimp.org/pub/%SUBDIR%/
665 .endif
666
667 .if !defined(IGNORE_MASTER_SITE_GNU)
668 MASTER_SITE_GNU+= \
669         https://ftpmirror.gnu.org/%SUBDIR%/ \
670         https://ftp.gnu.org/gnu/%SUBDIR%/ \
671         ftp://ftp.gnu.org/gnu/%SUBDIR%/ \
672         http://www.gtlib.gatech.edu/pub/gnu/gnu/%SUBDIR%/ \
673         https://mirrors.kernel.org/gnu/%SUBDIR%/ \
674         ftp://ftp.kddlabs.co.jp/GNU/gnu/%SUBDIR%/ \
675         ftp://ftp.mirrorservice.org/sites/ftp.gnu.org/gnu/%SUBDIR%/ \
676         ftp://ftp.informatik.hu-berlin.de/pub/gnu/gnu/%SUBDIR%/ \
677         ftp://ftp.informatik.rwth-aachen.de/pub/mirror/ftp.gnu.org/pub/gnu/%SUBDIR%/ \
678         http://ftp.funet.fi/pub/gnu/prep/%SUBDIR%/
679 .endif
680
681 .if !defined(IGNORE_MASTER_SITE_GNUPG)
682 MASTER_SITE_GNUPG+= \
683         https://gnupg.org/ftp/gcrypt/%SUBDIR%/ \
684         https://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/%SUBDIR%/ \
685         ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/%SUBDIR%/ \
686         ftp://mirror.switch.ch/mirror/gnupg/%SUBDIR%/ \
687         http://gd.tuwien.ac.at/privacy/gnupg/%SUBDIR%/ \
688         https://mirrors.dotsrc.org/gcrypt/%SUBDIR%/ \
689         ftp://ftp.freenet.de/pub/ftp.gnupg.org/gcrypt/%SUBDIR%/ \
690         ftp://ftp.crysys.hu/pub/gnupg/%SUBDIR%/ \
691         https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/%SUBDIR%/ \
692         https://artfiles.org/gnupg.org/%SUBDIR%/ \
693         ftp://ftp.gnupg.org/gcrypt/%SUBDIR%/ \
694         http://mirror.tje.me.uk/pub/mirrors/ftp.gnupg.org/%SUBDIR%/
695 .endif
696
697 .if !defined(IGNORE_MASTER_SITE_GNUSTEP)
698 MASTER_SITE_GNUSTEP+= \
699         ftp://ftp.gnustep.org/pub/gnustep/%SUBDIR%/ \
700         http://ftp.gnustep.org/pub/gnustep/%SUBDIR%/
701 .endif
702
703 .if !defined(IGNORE_MASTER_SITE_GNU_ALPHA)
704 MASTER_SITE_GNU_ALPHA+= \
705         https://alpha.gnu.org/gnu/%SUBDIR%/ \
706         ftp://spinellicreations.com/alpha/gnu/%SUBDIR%/ \
707         http://www.nic.funet.fi/pub/gnu/alpha/gnu/%SUBDIR%/ \
708         http://mirror.thecodefactory.org/gnualpha/%SUBDIR%/ \
709         https://www.mirrorservice.org/sites/alpha.gnu.org/gnu/%SUBDIR%/ \
710         http://gnu.c3sl.ufpr.br/alpha/%SUBDIR%/ \
711         https://mirror.cedia.org.ec/gnualpha/%SUBDIR%/ \
712         http://gnu-alpha.mirrors.hostinginnederland.nl/%SUBDIR%/ \
713         https://gnualpha.uib.no/%SUBDIR%/ \
714         https://mirrors.fe.up.pt/pub/gnu-alpha/%SUBDIR%/ \
715         http://mirror.lihnidos.org/GNU/alpha/gnu/%SUBDIR%/ \
716         https://alpha-gnu-org.ip-connect.vn.ua/%SUBDIR%/
717 .endif
718
719 .if !defined(IGNORE_MASTER_SITE_GOOGLE_CODE)
720 PROJECTHOST?=   ${PORTNAME}
721 MASTER_SITE_GOOGLE_CODE+= \
722         http://${PROJECTHOST}.googlecode.com/files/
723 .endif
724
725 .if !defined(IGNORE_MASTER_SITE_HORDE)
726 MASTER_SITE_HORDE+= \
727         https://ftp.horde.org/pub/%SUBDIR%/ \
728         ftp://ftp.horde.org/pub/%SUBDIR%/ \
729         ftp://ftp.at.horde.org/infosys/webapps/horde/%SUBDIR%/ \
730         ftp://ftp.se.horde.org/mirror/horde/pub/%SUBDIR%/ \
731         ftp://ftp.tw.horde.org/pub/%SUBDIR%/ \
732         ftp://ftp.us.horde.org/pub/software/horde//%SUBDIR%/
733 .endif
734
735 .if !defined(IGNORE_MASTER_SITE_IDSOFTWARE)
736 MASTER_SITE_IDSOFTWARE+= \
737         ftp://ftp.gwdg.de/pub/misc2/ftp.idsoftware.com/idstuff/%SUBDIR%/ \
738         http://ftp4.de.freesbie.org/pub/misc/ftp.idsoftware.com/idstuff/%SUBDIR%/ \
739         ftp://ftp.fu-berlin.de/pc/games/idgames/idstuff/%SUBDIR%/ \
740         ftp://ftp.gamers.org/pub/idgames/idstuff/%SUBDIR%/ \
741         http://ftp.iinet.net.au/games/idstuff/%SUBDIR%/ \
742         ftp://ftp.mirror.nl/disk2/idsoftware/idstuff/%SUBDIR%/ \
743         ftp://freebsd.nsu.ru/mirrors/ftp.idsoftware.com/idstuff/%SUBDIR%/ \
744         ftp://ftp.ntua.gr/pub/vendors/idgames/idstuff/%SUBDIR%/ \
745         ftp://ftp.omen.net.au/games/idstuff/%SUBDIR%/ \
746         ftp://ftp.idsoftware.com/idstuff/%SUBDIR%/
747 .endif
748
749 .if !defined(IGNORE_MASTER_SITE_ISC)
750 MASTER_SITE_ISC+= \
751         https://ftp.isc.org/isc/%SUBDIR%/ \
752         ftp://ftp.isc.org/isc/%SUBDIR%/ \
753         ftp://ftp.ciril.fr/pub/isc/%SUBDIR%/ \
754         ftp://ftp.freenet.de/pub/ftp.isc.org/isc/%SUBDIR%/ \
755         ftp://ftp.iij.ad.jp/pub/network/isc/%SUBDIR%/ \
756         ftp://ftp.u-aizu.ac.jp/pub/net/isc/%SUBDIR%/ \
757         ftp://ftp.task.gda.pl/mirror/ftp.isc.org/isc/%SUBDIR%/ \
758         ftp://ftp.mirrorservice.org/sites/ftp.isc.org/isc/%SUBDIR%/ \
759         ftp://ftp.nominum.com/pub/isc/%SUBDIR%/ \
760         ftp://ftp.ripe.net/mirrors/sites/ftp.isc.org/isc/%SUBDIR%/ \
761         ftp://ftp.ntua.gr/pub/net/isc/isc/%SUBDIR%/ \
762         ftp://ftp.funet.fi/pub/mirrors/ftp.isc.org/isc/%SUBDIR%/
763 .endif
764
765 # List:         http://download.kde.org/extra/mirrors.html
766 # Updated:      2012-10-26
767 .if !defined(IGNORE_MASTER_SITE_KDE)
768 MASTER_SITE_KDE+= \
769         https://download.kde.org/%SUBDIR%/ \
770         ftp://ftp.gtlib.gatech.edu/pub/kde/%SUBDIR%/ \
771         ftp://ftp.informatik.hu-berlin.de/pub/Mirrors/ftp.kde.org/%SUBDIR%/ \
772         http://ftp.gtlib.gatech.edu/pub/kde/%SUBDIR%/ \
773         http://kde.mirrors.tds.net/pub/kde/%SUBDIR%/ \
774         ftp://ftp.rz.uni-wuerzburg.de/pub/unix/kde/%SUBDIR%/ \
775         https://mirrors.dotsrc.org/kde/%SUBDIR%/ \
776         ftp://mirrors.dotsrc.org/kde/%SUBDIR%/ \
777         ftp://ftp.fi.muni.cz/pub/kde/%SUBDIR%/ \
778         http://ftp.fi.muni.cz/pub/kde/%SUBDIR%/ \
779         ftp://sunsite.icm.edu.pl/pub/unix/kde/%SUBDIR%/ \
780         https://sunsite.icm.edu.pl/pub/unix/kde/%SUBDIR%/ \
781         ftp://ftp.lip6.fr/pub/X11/kde/%SUBDIR%/ \
782         http://www-ftp.lip6.fr/pub/X11/kde/%SUBDIR%/ \
783         https://ftp-stud.hs-esslingen.de/Mirrors/ftp.kde.org/pub/kde/%SUBDIR%/ \
784         ftp://ftp.cronyx.ru/pub/mirror/kde/%SUBDIR%/ \
785         http://ftp.twaren.net/Unix/X/KDE/%SUBDIR%/ \
786         ftp://ftp.fu-berlin.de/pub/unix/X11/gui/kde/%SUBDIR%/ \
787         ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/kde/%SUBDIR%/ \
788         ftp://ftp.ntua.gr/pub/X11/kde/%SUBDIR%/ \
789         http://ftp.ntua.gr/pub/X11/kde/%SUBDIR%/ \
790         ftp://ftp.heanet.ie/mirrors/ftp.kde.org/%SUBDIR%/ \
791         https://ftp.heanet.ie/mirrors/ftp.kde.org/%SUBDIR%/ \
792         ftp://ftp.kddlabs.co.jp/pub/X11/kde/%SUBDIR%/ \
793         http://ftp.kddlabs.co.jp/pub/X11/kde/%SUBDIR%/ \
794         ftp://ftp.ussg.iu.edu/pub/kde/%SUBDIR%/ \
795         http://ftp.ussg.iu.edu/kde/%SUBDIR%/ \
796         ftp://ftp.sayclub.com/pub/X/KDE/%SUBDIR%/ \
797         http://ftp.sayclub.com/pub/X/KDE/%SUBDIR%/ \
798         http://mirror.cc.columbia.edu/pub/software/kde/%SUBDIR%/ \
799         ftp://ftp.mirrorservice.org/sites/ftp.kde.org/pub/kde/%SUBDIR%/ \
800         https://www.mirrorservice.org/sites/ftp.kde.org/pub/kde/%SUBDIR%/ \
801         https://ftp.icm.edu.pl/pub/unix/kde/%SUBDIR%/ \
802         http://ftp.fi.muni.cz/pub/kde/%SUBDIR%/ \
803         ftp://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/%SUBDIR%/ \
804         http://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/%SUBDIR%/
805 .endif
806
807 .if !defined(IGNORE_MASTER_SITE_LIBREOFFICE_DEV)
808 MASTER_SITE_LIBREOFFICE_DEV+= \
809         https://dev-www.libreoffice.org/src/%SUBDIR%/
810 .endif
811
812 .if !defined(IGNORE_MASTER_SITE_MATE)
813 MASTER_SITE_MATE+= \
814         https://pub.mate-desktop.org/releases/%SUBDIR%/
815 .endif
816
817 .if !defined(IGNORE_MASTER_SITE_MOZDEV)
818 MASTER_SITE_MOZDEV+= \
819         http://ftp.scarlet.be/pub/mozdev/%SUBDIR%/ \
820         http://ftp.rz.tu-bs.de/pub/mirror/downloads.mozdev.org/%SUBDIR%/ \
821         http://ftp.ntua.gr/pub/www/mozdev/%SUBDIR%/ \
822         https://ftp.heanet.ie/pub/mozdev/%SUBDIR%/ \
823         http://mozdev.oregonstate.edu/%SUBDIR%/ \
824         http://ftp.ntua.gr/pub/www/mozdev/%SUBDIR%/ \
825         http://www.devlib.org/mozdev/%SUBDIR%/ \
826         ftp://ftp.heanet.ie/pub/mozdev/%SUBDIR%/ \
827         http://mirrors.ibiblio.org/mozdev.org/%SUBDIR%/ \
828         https://ftp.osuosl.org/pub/mozdev/%SUBDIR%/
829 .endif
830
831 .if !defined(IGNORE_MASTER_SITE_MOZILLA)
832 MASTER_SITE_MOZILLA+= \
833         https://download.cdn.mozilla.net/pub/%SUBDIR%/ \
834         https://archive.mozilla.org/pub/%SUBDIR%/
835 .endif
836
837 .if !defined(IGNORE_MASTER_SITE_MOZILLA_ADDONS)
838 MASTER_SITE_MOZILLA_ADDONS+= \
839         https://addons.cdn.mozilla.net/user-media/%SUBDIR%/ \
840         http://kyoto-mz-dl.sinet.ad.jp/pub/mozilla.org/%SUBDIR%/
841 .endif
842
843 .if !defined(IGNORE_MASTER_SITE_MPLAYERHQ)
844 MASTER_SITE_MPLAYERHQ+= \
845         http://www.mplayerhq.hu/MPlayer/%SUBDIR%/ \
846         https://www1.mplayerhq.hu/MPlayer/%SUBDIR%/ \
847         http://www2.mplayerhq.hu/MPlayer/%SUBDIR%/ \
848         http://www3.mplayerhq.hu/MPlayer/%SUBDIR%/ \
849         http://www4.mplayerhq.hu/MPlayer/%SUBDIR%/ \
850         http://www5.mplayerhq.hu/MPlayer/%SUBDIR%/ \
851         ftp://ftp.mplayerhq.hu/MPlayer/%SUBDIR%/ \
852         ftp://ftp1.mplayerhq.hu/MPlayer/%SUBDIR%/ \
853         ftp://ftp4.mplayerhq.hu/MPlayer/%SUBDIR%/ \
854         ftp://ftp5.mplayerhq.hu/MPlayer/%SUBDIR%/
855 .endif
856
857 .if !defined(IGNORE_MASTER_SITE_MYSQL)
858 MASTER_SITE_MYSQL+= \
859         ftp://ftp.fi.muni.cz/pub/mysql/Downloads/%SUBDIR%/ \
860         ftp://ftp.gwdg.de/pub/misc/mysql/Downloads/%SUBDIR%/ \
861         http://mirrors.ntua.gr/MySQL/Downloads/%SUBDIR%/ \
862         ftp://ftp.ntua.gr/pub/databases/mysql/Downloads/%SUBDIR%/ \
863         ftp://mirror.switch.ch/mirror/mysql/Downloads/%SUBDIR%/ \
864         http://mysql.mirrors.pair.com/Downloads/%SUBDIR%/ \
865         http://download.softagency.net/MySQL/Downloads/%SUBDIR%/
866 .endif
867
868 .if !defined(IGNORE_MASTER_SITE_NETBSD)
869 MASTER_SITE_NETBSD+= \
870         https://ftp.netbsd.org/pub/NetBSD/packages/distfiles/%SUBDIR%/ \
871         ftp://ftp.iastate.edu/pub/netbsd/packages/distfiles/%SUBDIR%/ \
872         ftp://ftp.plig.net/pub/NetBSD/packages/distfiles/%SUBDIR%/ \
873         ftp://ftp.proxad.net/mirrors/ftp.netbsd.org/packages/distfiles/%SUBDIR%/ \
874         ftp://ftp.unina.it/pub/Unix/NetBSD/packages/distfiles/%SUBDIR%/ \
875         ftp://ftp.uninett.no/bsd/unix/NetBSD/packages/distfiles/%SUBDIR%/ \
876         ftp://sunsite.uio.no/bsd/unix/NetBSD/packages/distfiles/%SUBDIR%/ \
877         ftp://ftp.demon.co.uk/pub/mirrors/NetBSD/packages/distfiles/%SUBDIR%/ \
878         ftp://ftp.funet.fi/pub/NetBSD/packages/distfiles/%SUBDIR%/
879 .endif
880
881 .if !defined(IGNORE_MASTER_SITE_NETLIB)
882 MASTER_SITE_NETLIB+= \
883         http://www.netlib.org/%SUBDIR%/ \
884         https://ftp.mirrorservice.org/sites/ftp.netlib.org/%SUBDIR%/ \
885         https://www.mirrorservice.org/sites/ftp.netlib.org/%SUBDIR%/ \
886         ftp://ftp.irisa.fr/pub/netlib/%SUBDIR%/ \
887         http://netlib.sandia.gov/%SUBDIR%/
888 .endif
889
890 .if !defined(IGNORE_MASTER_SITE_NVIDIA)
891 MASTER_SITE_NVIDIA+= \
892         https://jp.download.nvidia.com/%SUBDIR%/ \
893         http://us.download.nvidia.com/%SUBDIR%/ \
894         https://tw.download.nvidia.com/%SUBDIR%/ \
895         http://download.nvidia.com/%SUBDIR%/ \
896         https://download1.nvidia.com/%SUBDIR%/ \
897         ftp://download.nvidia.com/%SUBDIR%/ \
898         ftp://download1.nvidia.com/%SUBDIR%/
899 .endif
900
901 .if !defined(IGNORE_MASTER_SITE_OPENBSD)
902 MASTER_SITE_OPENBSD+= \
903         https://fastly.cdn.openbsd.org/pub/OpenBSD/%SUBDIR%/ \
904         https://cloudflare.cdn.openbsd.org/pub/OpenBSD/%SUBDIR%/ \
905         https://ftp.OpenBSD.org/pub/OpenBSD/%SUBDIR%/ \
906         https://ftp.eu.openbsd.org/pub/OpenBSD/%SUBDIR%/ \
907         https://ftp3.usa.openbsd.org/pub/OpenBSD/%SUBDIR%/ \
908         https://mirror.leaseweb.com/pub/OpenBSD/%SUBDIR%/ \
909         https://openbsd.hk/pub/OpenBSD/%SUBDIR%/ \
910         https://mirror.aarnet.edu.au/pub/OpenBSD/%SUBDIR%/
911 .endif
912
913 .if !defined(IGNORE_MASTER_SITE_OSDN)
914 .for mirror in aarnet acc c3sl cznic gigenet iij jaist nchc onet osdn pumath rwthaachen ymu
915 MASTER_SITE_OSDN+= \
916         http://${mirror}.dl.osdn.jp/%SUBDIR%/
917 .endfor
918 .endif
919
920 .if !defined(IGNORE_MASTER_SITE_OSSP)
921 MASTER_SITE_OSSP+= \
922         ftp://ftp.ossp.org/pkg/%SUBDIR%/ \
923         ftp://ftp.ntua.gr/pub/utils/ossp/%SUBDIR%/
924 .endif
925
926 .if !defined(IGNORE_MASTER_SITE_PACKETSTORM)
927 MASTER_SITE_PACKETSTORM+= \
928         https://dl.packetstormsecurity.net/%SUBDIR%/ \
929         https://packetstorm.foofus.com/%SUBDIR%/
930 .endif
931
932 .if !defined(IGNORE_MASTER_SITE_PERL_CPAN)
933
934 _PERL_CPAN_SORT?= modules/by-module
935
936 # Please add URI to MASTER_SITE_PERL_CPAN_BY instead of this one.
937 MASTER_SITE_PERL_CPAN?=
938
939 MASTER_SITE_PERL_CPAN_BY+= \
940         https://cpan.metacpan.org/%CPANSORT%/%SUBDIR%/ \
941         https://cpan.metacpan.org/modules/by-module/%SUBDIRPLUS%/ \
942         https://www.cpan.org/%CPANSORT%/%SUBDIR%/ \
943         ftp://ftp.cpan.org/pub/CPAN/%CPANSORT%/%SUBDIR%/ \
944         http://www.cpan.dk/%CPANSORT%/%SUBDIR%/ \
945         ftp://ftp.kddlabs.co.jp/lang/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
946         https://ftp.jaist.ac.jp/pub/CPAN/%CPANSORT%/%SUBDIR%/ \
947         ftp://ftp.mirrorservice.org/sites/cpan.perl.org/CPAN/%CPANSORT%/%SUBDIR%/ \
948         ftp://ftp.auckland.ac.nz/pub/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
949         http://backpan.perl.org/%CPANSORT%/%SUBDIR%/ \
950         ftp://ftp.funet.fi/pub/languages/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
951         http://ftp.twaren.net/Unix/Lang/CPAN/%CPANSORT%/%SUBDIR%/ \
952         ftp://ftp.cpan.org/pub/CPAN/modules/by-module/%SUBDIRPLUS%/
953
954 _PERL_CPAN_FLAG=${MASTER_SITE_SUBDIR:C/(CPAN):.*$/\1/}
955 _PERL_CPAN_ID=  ${MASTER_SITE_SUBDIR:C/^CPAN:(.)(.)(.*)$/\1\/\1\2\/\1\2\3/}
956
957 .if !empty(_PERL_CPAN_ID) && ${_PERL_CPAN_FLAG:tl} == "cpan"
958     _PERL_CPAN_SORT=authors/id/${_PERL_CPAN_ID}
959     MASTER_SITE_PERL_CPAN=${MASTER_SITE_PERL_CPAN_BY:S/%CPANSORT%/${_PERL_CPAN_SORT}/:S/%SUBDIR%\///:S/%SUBDIRPLUS%\//${PORTNAME:C/-.*//}\//}
960 .else
961     MASTER_SITE_PERL_CPAN=${MASTER_SITE_PERL_CPAN_BY:S/%CPANSORT%/${_PERL_CPAN_SORT}/:S/%SUBDIRPLUS%\///}
962 .endif
963
964 .endif
965
966 #
967 # PostgreSQL master site
968 #
969 .if !defined(IGNORE_MASTER_SITE_PGSQL)
970 MASTER_SITE_PGSQL+= \
971         https://ftp.postgresql.org/pub/%SUBDIR%/
972 .endif
973
974 .if !defined(IGNORE_MASTER_SITE_PHP)
975 MASTER_SITE_PHP+= \
976         http://de.php.net/%SUBDIR%/ \
977         http://es.php.net/%SUBDIR%/ \
978         http://fr.php.net/%SUBDIR%/ \
979         http://it.php.net/%SUBDIR%/ \
980         http://jp.php.net/%SUBDIR%/ \
981         http://se.php.net/%SUBDIR%/ \
982         http://uk3.php.net/%SUBDIR%/ \
983         http://us2.php.net/%SUBDIR%/ \
984         http://br.php.net/%SUBDIR%/ \
985         http://cn.php.net/%SUBDIR%/
986 .endif
987
988 .if !defined(IGNORE_MASTER_SITE_PYTHON)
989 MASTER_SITE_PYTHON+= \
990         https://www.python.org/%SUBDIR%/
991 .endif
992
993 .if !defined(IGNORE_MASTER_SITE_QMAIL)
994 MASTER_SITE_QMAIL+= \
995         http://qmail.glasswings.com.au/%SUBDIR%/ \
996         http://qmail.psshee.com/%SUBDIR%/ \
997         https://mirrors.sunsite.dk/qmailwww/%SUBDIR%/ \
998         http://www.agria.hu/qmail/%SUBDIR%/ \
999         http://qmail.netvisao.pt/%SUBDIR%/ \
1000         http://qmail.ipg.sk/%SUBDIR%/ \
1001         http://qmail.omnis.ch/%SUBDIR%/ \
1002         http://www.qmail.org/%SUBDIR%/
1003 .endif
1004
1005 .if !defined(IGNORE_MASTER_SITE_QT)
1006 MASTER_SITE_QT+= \
1007         https://download.qt.io/%SUBDIR%/ \
1008         http://master.qt.io/%SUBDIR%/ \
1009         https://www.mirrorservice.org/sites/download.qt-project.org/%SUBDIR%/ \
1010         http://www.nic.funet.fi/pub/mirrors/download.qt-project.org/%SUBDIR%/ \
1011         http://qtmirror.ics.com/pub/qtproject/%SUBDIR%/ \
1012         https://ftp.jaist.ac.jp/pub/qtproject/%SUBDIR%/
1013 .endif
1014
1015 .if !defined(IGNORE_MASTER_SITE_REDHAT_LINUX)
1016 MASTER_SITE_REDHAT_LINUX+= \
1017         http://mirrors.usc.edu/pub/linux/distributions/redhat/redhat/linux/%SUBDIR%/ \
1018         http://www.gtlib.gatech.edu/pub/redhat/linux/%SUBDIR%/ \
1019         ftp://mirror.cs.wisc.edu/pub/mirrors/linux/redhat/%SUBDIR%/ \
1020         ftp://ftp.nluug.nl/site/ftp.redhat.com/redhat/linux/%SUBDIR%/ \
1021         ftp://ftp.icm.edu.pl/pub/linux/redhat/linux/%SUBDIR%/ \
1022         ftp://ftp.riken.go.jp/pub/Linux/redhat/linux/%SUBDIR%/ \
1023         ftp://ftp.kddlabs.co.jp/pub/Linux/packages/RedHat/redhat/linux/%SUBDIR%/
1024 .endif
1025
1026 .if !defined(IGNORE_MASTER_SITE_RUBY)
1027 MASTER_SITE_RUBY+= \
1028         https://cache.ruby-lang.org/pub/ruby/%SUBDIR%/ \
1029         https://ftp.ruby-lang.org/pub/ruby/%SUBDIR%/ \
1030         ftp://ftp.ruby-lang.org/pub/ruby/%SUBDIR%/ \
1031         ftp://ftp.fu-berlin.de/unix/languages/ruby/%SUBDIR%/ \
1032         ftp://ftp.kr.FreeBSD.org/pub/ruby/%SUBDIR%/ \
1033         ftp://ftp.iDaemons.org/pub/mirror/ftp.ruby-lang.org/ruby/%SUBDIR%/
1034 .endif
1035
1036 # See http://rubygems.org/pages/about
1037 .if !defined(IGNORE_MASTER_SITE_RUBYGEMS)
1038 MASTER_SITE_RUBYGEMS+= \
1039         https://rubygems.global.ssl.fastly.net/gems/%SUBDIR%/
1040 .endif
1041
1042 .if !defined(IGNORE_MASTER_SITE_SAMBA)
1043 MASTER_SITE_SAMBA+= \
1044         https://ftp.samba.org/pub/%SUBDIR%/
1045 .endif
1046
1047 # List: http://download.savannah.gnu.org/mirmon/
1048 .if !defined(IGNORE_MASTER_SITE_SAVANNAH)
1049 MASTER_SITE_SAVANNAH+= \
1050         https://download.savannah.gnu.org/releases/%SUBDIR%/ \
1051         https://download-mirror.savannah.gnu.org/releases/%SUBDIR%/ \
1052         http://nongnu.askapache.com/%SUBDIR%/ \
1053         http://mirror.lihnidos.org/GNU/savannah/%SUBDIR%/ \
1054         http://ftp.twaren.net/Unix/NonGNU/%SUBDIR%/ \
1055         ftp://ftp.twaren.net/Unix/NonGNU/%SUBDIR%/ \
1056         http://gnu.mirrors.pair.com/savannah/savannah/%SUBDIR%/
1057 .endif
1058
1059 # List:         https://sourceforge.net/p/forge/documentation/Mirrors/
1060 # Updated:      2017-03-13
1061 .if !defined(IGNORE_MASTER_SITE_SOURCEFORGE)
1062 .for p in https http
1063 MASTER_SITE_SOURCEFORGE+= ${p}://downloads.sourceforge.net/project/%SUBDIR%/
1064 .for m in cytranet excellmedia freefr jaist kent nchc \
1065         netcologne netix superb-dca2 superb-sea2 ufpr vorboss
1066 MASTER_SITE_SOURCEFORGE+= ${p}://${m}.dl.sourceforge.net/project/%SUBDIR%/
1067 .endfor
1068 .endfor
1069 .endif
1070
1071 .if !defined(IGNORE_MASTER_SITE_SOURCEWARE)
1072 MASTER_SITE_SOURCEWARE+= \
1073         https://mirrors.kernel.org/sourceware/%SUBDIR%/ \
1074         http://gd.tuwien.ac.at/gnu/sourceware/%SUBDIR%/ \
1075         ftp://ftp.funet.fi/pub/mirrors/sourceware.org/pub/%SUBDIR%/
1076 .endif
1077
1078 .if !defined(IGNORE_MASTER_SITE_SUDO)
1079 MASTER_SITE_SUDO+= \
1080         https://www.sudo.ws/sudo/dist/ \
1081         http://ftp.arcane-networks.fr/pub/mirrors/sudo/ \
1082         http://sudo.p8ra.de/sudo/dist/ \
1083         http://sudo.cybermirror.org/ \
1084         http://sudo-ftp.basemirror.de/ \
1085         http://core.ring.gr.jp/archives/misc/sudo/ \
1086         http://www.ring.gr.jp/archives/misc/sudo/ \
1087         http://ftp.twaren.net/Unix/Security/Sudo/ \
1088         ftp://ftp.sudo.ws/pub/sudo/ \
1089         ftp://plier.ucar.edu/pub/sudo/ \
1090         ftp://obsd.isc.org/pub/sudo/ \
1091         ftp://ftp.uwsg.indiana.edu/pub/security/sudo/ \
1092         ftp://ftp.tuwien.ac.at/utils/admin-tools/sudo/ \
1093         ftp://sunsite.ualberta.ca/pub/Mirror/sudo/ \
1094         ftp://zoot.tele.dk/pub/sudo/ \
1095         ftp://ftp.in2p3.fr/pub/sudo/ \
1096         ftp://ftp.arcane-networks.fr/pub/mirrors/sudo/ \
1097         ftp://ftp.usbm.de/pub/sudo/ \
1098         ftp://ftp.cs.tu-berlin.de/pub/misc/sudo/ \
1099         ftp://ftp.informatik.uni-hamburg.de/pub/os/unix/utils/sudo/ \
1100         ftp://ftp.st.ryukoku.ac.jp/pub/security/tool/sudo/ \
1101         ftp://ftp.cin.nihon-u.ac.jp/pub/misc/sudo/ \
1102         ftp://core.ring.gr.jp/pub/misc/sudo/ \
1103         ftp://ftp.ring.gr.jp/pub/misc/sudo/ \
1104         ftp://sunsite.icm.edu.pl/packages/sudo/ \
1105         ftp://mirror.cdmon.com/pub/sudo/ \
1106         ftp://ftp.twaren.net/Unix/Security/Sudo/
1107 .endif
1108
1109 .if !defined(IGNORE_MASTER_SITE_SUNSITE)
1110 MASTER_SITE_SUNSITE+= \
1111         https://www.ibiblio.org/pub/Linux/%SUBDIR%/ \
1112         http://www.gtlib.gatech.edu/pub/Linux/%SUBDIR%/ \
1113         ftp://ftp.icm.edu.pl/pub/Linux/sunsite/%SUBDIR%/ \
1114         ftp://ftp.sun.ac.za/pub/mirrors/sunsite.unc.edu/pub/Linux/%SUBDIR%/
1115 .endif
1116
1117 .if !defined(IGNORE_MASTER_SITE_TCLTK)
1118 MASTER_SITE_TCLTK+= \
1119         ftp://ftp.tcl.tk/pub/tcl/%SUBDIR%/ \
1120         ftp://ftp.kddlabs.co.jp/lang/tcl/ftp.scriptics.com/%SUBDIR%/ \
1121         ftp://ftp.mirrorservice.org/sites/ftp.tcl.tk/pub/tcl/%SUBDIR%/ \
1122         ftp://ftp.funet.fi/pub/languages/tcl/tcl/%SUBDIR%/
1123 .endif
1124
1125 .if !defined(IGNORE_MASTER_SITE_TEX_CTAN)
1126 MASTER_SITE_TEX_CTAN+= \
1127         http://ctan.unsw.edu.au/%SUBDIR%/ \
1128         ftp://ftp.kddlabs.co.jp/CTAN/%SUBDIR%/ \
1129         ftp://ctan.tug.org/tex-archive/%SUBDIR%/ \
1130         ftp://ftp.dante.de/tex-archive/%SUBDIR%/ \
1131         ftp://mirror.macomnet.net/pub/CTAN/%SUBDIR%/ \
1132         ftp://ftp.funet.fi/pub/TeX/CTAN/%SUBDIR%/
1133 .endif
1134
1135 # Derived from: https://www.torproject.org/getinvolved/mirrors.html.en
1136 .if !defined(IGNORE_MASTER_SITE_TOR)
1137 MASTER_SITE_TOR+= \
1138                 https://www.torproject.org/dist/%SUBDIR%/ \
1139                 https://archive.torproject.org/tor-package-archive/%SUBDIR%/ \
1140                 ftp://ftp.bit.nl/mirror/tor/%SUBDIR%/ \
1141                 https://cyberside.net.ee/tor/%SUBDIR%/ \
1142                 https://ftp.bit.nl/mirror/tor/%SUBDIR%/ \
1143                 http://mirror.hessmo.com/tor/dist/%SUBDIR%/ \
1144                 http://mirror.host4site.co.il/torproject.org/dist/%SUBDIR%/ \
1145                 http://mirror.open-networx.org/torproject.org/dist/%SUBDIR%/ \
1146                 http://mirror.tor.hu/dist/%SUBDIR%/ \
1147                 https://mirror.torland.me/torproject.org/dist/%SUBDIR%/ \
1148                 http://mirrors.chaos-darmstadt.de/tor-mirror/dist/%SUBDIR%/ \
1149                 http://theonionrouter.com/dist/%SUBDIR%/ \
1150                 http://tor.amorphis.eu/dist/%SUBDIR%/ \
1151                 http://tor.askapache.com/dist/%SUBDIR%/ \
1152                 http://tor.beme-it.de/dist/%SUBDIR%/ \
1153                 http://tor.borgmann.tv/dist/%SUBDIR%/ \
1154                 https://tor.ccc.de/dist/%SUBDIR%/ \
1155                 http://tor.cyberarmy.at/dist/%SUBDIR%/ \
1156                 http://tor.dont-know-me.at/dist/%SUBDIR%/ \
1157                 http://tor.factor.cc/dist/%SUBDIR%/ \
1158                 http://tor.homosu.net/dist/%SUBDIR%/ \
1159                 http://tor.idnr.ws/dist/%SUBDIR%/ \
1160                 https://tor.myrl.net/dist/%SUBDIR%/ \
1161                 http://tor.kamagurka.org/dist/%SUBDIR%/ \
1162                 http://tor.spline.de/dist/%SUBDIR%/ \
1163                 http://tor.vesta.nu/dist/%SUBDIR%/ \
1164                 http://torproj.xpdm.us/dist/%SUBDIR%/ \
1165                 https://torproject.antagonism.org/dist/%SUBDIR%/ \
1166                 https://torproject.crypto.is/dist/%SUBDIR%/ \
1167                 https://torproject.is/dist/%SUBDIR%/ \
1168                 http://torproject.nwlinux.us/dist/%SUBDIR%/ \
1169                 https://torproject.ph3x.at/dist/%SUBDIR%/ \
1170                 https://www.coevoet.nl/tor/dist/%SUBDIR%/ \
1171                 http://www.oignon.net/dist/%SUBDIR%/ \
1172                 https://www.torproject.nl/dist/%SUBDIR%/ \
1173                 http://www.torproject.org.nyud.net/dist/%SUBDIR%/ \
1174                 http://www.torproject.us/dist/%SUBDIR%/ \
1175                 https://www.torservers.net/mirrors/torproject.org/dist/%SUBDIR%/
1176 .endif
1177
1178 .if !defined(IGNORE_MASTER_SITE_TUCOWS)
1179 MASTER_SITE_TUCOWS+= \
1180         http://iinets.linux.tucows.com/files/%SUBDIR%/
1181 .endif
1182
1183 .if !defined(IGNORE_MASTER_SITE_WINDOWMAKER)
1184 MASTER_SITE_WINDOWMAKER+= \
1185         ftp://ftp.windowmaker.info/pub/%SUBDIR%/ \
1186         ftp://ftp.uvsq.fr/pub/X11/window-managers/windowmaker/%SUBDIR%/
1187 .endif
1188
1189 .if !defined(IGNORE_MASTER_SITE_XCONTRIB)
1190 MASTER_SITE_XCONTRIB+= \
1191         ftp://ftp.gwdg.de/pub/x11/x.org/contrib/%SUBDIR%/
1192 .endif
1193
1194 .if !defined(IGNORE_MASTER_SITE_XFCE)
1195 MASTER_SITE_XFCE+= \
1196         https://mirror.netcologne.de/xfce/%SUBDIR%/ \
1197         http://ftp.udc.es/xfce/%SUBDIR%/ \
1198         http://xfce.mirror.uber.com.au/%SUBDIR%/ \
1199         https://archive.be.xfce.org/%SUBDIR%/ \
1200         http://archive.be2.xfce.org/%SUBDIR%/ \
1201         https://archive.al-us.xfce.org/%SUBDIR%/ \
1202         http://mirrors.tummy.com/pub/archive.xfce.org/%SUBDIR%/ \
1203         http://mirror.perldude.de/archive.xfce.org/%SUBDIR%/
1204 .endif
1205
1206 .if !defined(IGNORE_MASTER_SITE_XORG)
1207 MASTER_SITE_XORG+= \
1208         https://xorg.freedesktop.org/releases/%SUBDIR%/ \
1209         http://xorg.mirrors.pair.com/%SUBDIR%/ \
1210         http://mirror.us.leaseweb.net/xorg/%SUBDIR%/ \
1211         https://mirror.csclub.uwaterloo.ca/x.org/%SUBDIR%/ \
1212         https://artfiles.org/x.org/pub/%SUBDIR%/ \
1213         https://ftp.gwdg.de/pub/x11/x.org/pub/%SUBDIR%/ \
1214         http://gd.tuwien.ac.at/X11/%SUBDIR%/ \
1215         https://mi.mirror.garr.it/mirrors/x.org/%SUBDIR%/ \
1216         http://mirror.switch.ch/ftp/mirror/X11/pub/%SUBDIR%/ \
1217         https://mirrors.ircam.fr/pub/x.org/%SUBDIR%/ \
1218         https://www.mirrorservice.org/sites/ftp.x.org/pub/%SUBDIR%/ \
1219         http://www.portal-to-web.de/pub/mirrors/x.org/%SUBDIR%/ \
1220         http://x.cybermirror.org/%SUBDIR%/ \
1221         https://x.europnews.de/pub/%SUBDIR%/ \
1222         http://xorg.mirror.solnet.ch/pub/%SUBDIR%/ \
1223         https://mirror.nl.leaseweb.net/xorg/%SUBDIR%/ \
1224         http://mirror.de.leaseweb.net/xorg/%SUBDIR%/ \
1225         http://mirrors.go-part.com/xorg/%SUBDIR%/ \
1226         https://ftp.yz.yamagata-u.ac.jp/pub/X11/x.org/%SUBDIR%/ \
1227         http://ftp.kaist.ac.kr/x.org/%SUBDIR%/
1228 .endif
1229
1230 .if !defined(IGNORE_MASTER_SITE_KERNEL_ORG)
1231 MASTER_SITE_KERNEL_ORG+= \
1232         https://www.kernel.org/pub/%SUBDIR%/ \
1233         ftp://ftp.ntu.edu.tw/%SUBDIR%/ \
1234         https://ftp.yandex.ru/pub/%SUBDIR%/ \
1235         https://ftp.heanet.ie/pub/%SUBDIR%/ \
1236         http://slackware.cs.utah.edu/pub/kernel.org/pub/%SUBDIR%/
1237 .endif
1238
1239 .if !defined(IGNORE_MASTER_SITE_ZI)
1240 MASTER_SITE_ZI+= \
1241         https://mirrors.rit.edu/zi/ \
1242         https://blackened.zi0r.com/mirrors/ \
1243         ${MASTER_SITE_LOCAL:S/%SUBDIR%/zi/}
1244 .endif
1245
1246 # Macro magic
1247
1248 MASTER_SITES_ABBREVS=   CPAN:PERL_CPAN \
1249                         GH:GITHUB \
1250                         GHC:GITHUB_CLOUD \
1251                         LODEV:LIBREOFFICE_DEV \
1252                         NL:NETLIB \
1253                         RG:RUBYGEMS \
1254                         SF:SOURCEFORGE
1255 MASTER_SITES_SUBDIRS=   APACHE_COMMONS_BINARIES:${PORTNAME:S,commons-,,} \
1256                         APACHE_COMMONS_SOURCE:${PORTNAME:S,commons-,,} \
1257                         APACHE_JAKARTA:${PORTNAME:S,-,/,}/source \
1258                         BERLIOS:${PORTNAME:tl}.berlios \
1259                         CHEESESHOP:source/${DISTNAME:C/(.).*/\1/}/${DISTNAME:S/-${DISTVERSIONFULL}$//} \
1260                         DEBIAN:pool/main/${PORTNAME:C/^((lib)?.).*$/\1/}/${PORTNAME} \
1261                         FARSIGHT:${PORTNAME} \
1262                         FESTIVAL:${PORTVERSION} \
1263                         GCC:releases/${DISTNAME} \
1264                         GENTOO:distfiles \
1265                         GIMP:${PORTNAME}/${PORTVERSION:R}/ \
1266                         GITHUB:${GH_ACCOUNT}/${GH_PROJECT}/tar.gz/${GH_TAGNAME}?dummy=/ \
1267                         GITHUB_CLOUD:${GH_ACCOUNT}/${GH_PROJECT}/ \
1268                         GNOME:sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/} \
1269                         GNU:${PORTNAME} \
1270                         GNUPG:${PORTNAME} \
1271                         GNU_ALPHA:${PORTNAME} \
1272                         HORDE:${PORTNAME} \
1273                         LIBREOFFICE_DEV:${PORTNAME} \
1274                         MATE:${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/} \
1275                         MOZDEV:${PORTNAME:tl} \
1276                         NETLIB:${PORTNAME} \
1277                         PERL_CPAN:${PORTNAME:C/-.*//} \
1278                         QT:archive/qt/${PORTVERSION:R} \
1279                         SAMBA:${PORTNAME} \
1280                         SAVANNAH:${PORTNAME:tl} \
1281                         SOURCEFORGE:${PORTNAME:tl}/${PORTNAME:tl}/${PORTVERSION} \
1282                         XFCE:xfce/${XFCE_MASTER_SITE_VER}/src
1283
1284 .if defined(MASTER_SITES) && ${MASTER_SITES:N*\:/*}
1285
1286 .for _site__ in ${MASTER_SITES}
1287 _site_=${_site__}
1288 .       if ${_site_:M*\:/*}
1289 MASTER_SITES_EXP+=      ${_site_}
1290 MASTER_SITES_EXP:=      ${MASTER_SITES_EXP}
1291 .       else
1292 _site_urlpath_= ${_site_:C@^(.*):[^/:]+$@\1@}
1293 .               if ${_site_urlpath_:M*/*}
1294 _site_url_=             ${_site_urlpath_:C@^([^/]+)/.*$@\1@}
1295 _site_subdir_=  ${_site_urlpath_:S/^${_site_urlpath_:C@^([^/]+)/.*$@\1@}//:S!^/!!:S!/$!!}
1296 .               else
1297 _site_url_=             ${_site_urlpath_}
1298 .undef _site_subdir_
1299 .               endif
1300 _site_group_=   ${_site_:S/^${_site_:C@^(.*):[^/:]+$@\1@}//:S/^://}
1301 .               for _abbrev_ in ${MASTER_SITES_ABBREVS}
1302 .                       if ${_site_url_} == ${_abbrev_:C/:.*//}
1303 _site_url_=     ${_abbrev_:C/.*://}
1304 .                       endif
1305 .               endfor
1306 .               if !defined(MASTER_SITE_SUBDIR)
1307 .                       for _subdir_ in ${MASTER_SITES_SUBDIRS}
1308 .                               if ${_site_url_} == ${_subdir_:C/:.*//}
1309 _site_subdir_?= ${_subdir_:C/.*://}
1310 .                               endif
1311 .                       endfor
1312 .               endif
1313 .               ifdef MASTER_SITE_${_site_url_}
1314 .                       ifdef _site_subdir_
1315 MASTER_SITES_EXP+=      ${MASTER_SITE_${_site_url_}:S^%SUBDIR%^${_site_subdir_}^:S/$/:${_site_group_}/:S/:$//}
1316 .                       else
1317 MASTER_SITES_EXP+=      ${MASTER_SITE_${_site_url_}:S/$/:${_site_group_}/:S/:$//}
1318 .                       endif
1319 MASTER_SITES_EXP:=      ${MASTER_SITES_EXP}
1320 .               endif
1321 .       endif
1322 .endfor
1323 MASTER_SITES=   ${MASTER_SITES_EXP}
1324
1325 .endif
1326
1327 .if defined(PATCH_SITES) && ${PATCH_SITES:N*\:/*}
1328
1329 .for _site__ in ${PATCH_SITES}
1330 _site_=${_site__}
1331 .       if ${_site_:M*\:/*}
1332 PATCH_SITES_EXP+=       ${_site_}
1333 PATCH_SITES_EXP:=       ${PATCH_SITES_EXP}
1334 .       else
1335 _site_urlpath_= ${_site_:C@^(.*):[^/:]+$@\1@}
1336 .               if ${_site_urlpath_:M*/*}
1337 _site_url_=             ${_site_urlpath_:C@^([^/]+)/.*$@\1@}
1338 _site_subdir_=  ${_site_urlpath_:S/^${_site_urlpath_:C@^([^/]+)/.*$@\1@}//:S!^/!!:S!/$!!}
1339 .               else
1340 _site_url_=             ${_site_urlpath_}
1341 .undef _site_subdir_
1342 .               endif
1343 _site_group_=   ${_site_:S/^${_site_:C@^(.*):[^/:]+$@\1@}//:S/^://}
1344 .               for _abbrev_ in ${MASTER_SITES_ABBREVS}
1345 .                       if ${_site_url_} == ${_abbrev_:C/:.*//}
1346 _site_url_=     ${_abbrev_:C/.*://}
1347 .                       endif
1348 .               endfor
1349 .               if !defined(MASTER_SITE_SUBDIR)
1350 .                       for _subdir_ in ${MASTER_SITES_SUBDIRS}
1351 .                               if ${_site_url_} == ${_subdir_:C/:.*//}
1352 _site_subdir_?= ${_subdir_:C/.*://}
1353 .                               endif
1354 .                       endfor
1355 .               endif
1356 .               ifdef MASTER_SITE_${_site_url_}
1357 .                       ifdef _site_subdir_
1358 PATCH_SITES_EXP+=       ${MASTER_SITE_${_site_url_}:S^%SUBDIR%^${_site_subdir_}^:S/$/:${_site_group_}/:S/:$//}
1359 .                       else
1360 PATCH_SITES_EXP+=       ${MASTER_SITE_${_site_url_}:S/$/:${_site_group_}/:S/:$//}
1361 .                       endif
1362 PATCH_SITES_EXP:=       ${PATCH_SITES_EXP}
1363 .               endif
1364 .       endif
1365 .endfor
1366 PATCH_SITES=    ${PATCH_SITES_EXP}
1367
1368 .endif