################################################################################
#
# mirrors - default list for mirror:// URI resolution
#
# Part of cygport - Cygwin packaging application
# Copyright (C) 2006-2020 Cygport authors
# Provided by the Cygwin project <https://cygwin.com/>
#
# cygport is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cygport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cygport.  If not, see <https://www.gnu.org/licenses/>.
#
################################################################################

#****** Downloading/Mirrors
#  INTRODUCTION
#  Many large software projects and hosting sites provide multiple download
#  mirrors for their projects, allowing users to choose a site closer to them
#  and to help distribute the bandwidth demands around the world.
#
#  Within cygport, the mirror:// notation can be used in SRC_URI and PATCH_URI
#  to allow package maintainers both the ability to choose their favourite
#  mirrors and use an abbreviated URI for common sites.
#
#  The default mirrors are usually the central download site or a redirector.
#  Users can select their favourite mirrors by redefining the mirror_*
#  variables listed below (as a string containing one or more mirror sites)
#  in their cygport.conf.
#  HINT
#  Custom per-package "mirrors" can also be defined in a .cygport file.  This
#  can be useful if SRC_URI or PATCH_URI contain a large number of long URIs.
#  NOTE
#  Mirror providers change frequently.  If you define your own default mirror,
#  you may experience errors or delays downloading if your mirror goes offline.
#****

#****d* Mirrors/mirror_apache
#  DESCRIPTION
#  Apache Software Foundation project hosting
#  SYNOPSIS
#  SRC_URI="mirror://apache/projectname/${P}.tar.bz2"
#  DEFAULT MIRROR
#  https://downloads.apache.org
#  MIRROR LIST
#  https://www.apache.org/mirrors/index.html
#****
# grep -h '^  <TD ALIGN="RIGHT"><A HREF=' index.html \
# | sed -e 's#<TD ALIGN="RIGHT"><A HREF="\(.*\)/">.*#\1#g' \
# | cut -d '"' -f 1 | sed -e 's#^  #\t#g' -e 's#/$##g'
mirror_apache+=" https://downloads.apache.org"


#****d* Mirrors/mirror_cpan
#  DESCRIPTION
#  Comprehensive Perl Archive Network
#  SYNOPSIS
#  SRC_URI="mirror://cpan/authors/id/A/AU/AUTHOR/${ORIG_PN}-${PV}.tar.gz"
#  DEFAULT MIRROR
#  https://cpan.metacpan.org
#  MIRROR LIST
#  https://www.cpan.org/SITES.html
#  SEE ALSO
#  perl.cygclass
#****
# cat SITES.html | egrep '^ *<A HREF=.*(CPAN|cpan).*(ht|f)tp:' | \
#   sed -e 's! *<A HREF="!\t!g' -e 's!">.*!!g' -e 's!/$!!g'
mirror_cpan+=" https://cpan.metacpan.org"


#****d* Mirrors/mirror_cran
#  DESCRIPTION
#  Comprehensive R Archive Network
#  SYNOPSIS
#  SRC_URI="mirror://cran/src/contrib/${ORIG_PN}_${PV/_/-}.tar.gz"
#  DEFAULT MIRROR
#  https://cran.r-project.org/
#  MIRROR LIST
#  https://cran.r-project.org/mirrors.html
#  SEE ALSO
#  R.cygclass
#****
# grep -P '^http.*\n</a>' mirrors.html \
#   | sed -e '/<\/a>/d' -e 's#^#\t#g' -e 's#/$##g'
mirror_cran+=" https://cran.r-project.org"


#****d* Mirrors/mirror_ctan
#  DESCRIPTION
#  Comprehensive TeX Archive Network
#  SYNOPSIS
#  SRC_URI="mirror://ctan/macros/latex/contrib/${ORIG_PN}.zip"
#  DEFAULT MIRROR
#  http://mirror.ctan.org/
#  MIRROR LIST
#  http://mirror.ctan.org/tex-archive/CTAN.sites
#  SEE ALSO
#  texlive.cygclass
#****
# grep -E 'URL: (f|ht)tp:' CTAN.sites | sed -e 's| *URL: |\t|g' -e 's|/$||g'
mirror_ctan+=" http://mirror.ctan.org/"


#****d* Mirrors/mirror_debian
#  DESCRIPTION
#  Debian package pool
#  SYNOPSIS
#  SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.orig.tar.gz"
#  DEFAULT MIRROR
#  https://deb.debian.org/debian
#  MIRROR LIST
#  https://www.debian.org/mirror/list
#****
# grep '^  <td><a href' list  | sed -e 's#.*"\(.*\)/".*#\t\1#g'
mirror_debian+=" http://deb.debian.org/debian"


#****d* Mirrors/mirror_gcc
#  DESCRIPTION
#  GCC releases and snapshots
#  SYNOPSIS
#  SRC_URI="mirror://gcc/releases/gcc-${PV}/gcc-core-${PV}.tar.bz2"
#  DEFAULT MIRROR
#  https://gcc.gnu.org/pub/gcc/
#  MIRROR LIST
#  https://gcc.gnu.org/mirrors.html
#  SEE ALSO
#  mirror_gnu
#****
# grep '^<li>' mirrors.html | sed -e 's|.*<a href="\([^"]*\).*|\1|g' -e 's|/$||g'
mirror_gcc+="
	https://gcc.gnu.org/pub/gcc
	ftp://gcc.gnu.org/pub/gcc
	"


#****d* Mirrors/mirror_gentoo
#  DESCRIPTION
#  Gentoo Linux distfiles
#  SYNOPSIS
#  SRC_URI="mirror://gentoo/${P}.tar.bz2"
#  DEFAULT MIRROR
#  https://gentoo.osuosl.org/distfiles
#  MIRROR LIST
#  https://www.gentoo.org/downloads/mirrors/
#  SEE ALSO
#  mirror_portage
#****
# egrep '^<a href="(ht|f)tp:.*</a><br>$' mirrors.xml | \
#	sed -e 's#<a href="\(.*\)".*</a>.*#\t\1#' -e 's#/$##' -e 's#$#/distfiles#'
mirror_gentoo+=" https://gentoo.osuosl.org/distfiles"


#****d* Mirrors/mirror_gnome
#  DESCRIPTION
#  GNOME FTP
#  SYNOPSIS
#  SRC_URI="mirror://gnome/sources/${PN}/${PV}/${P}.tar.bz2"
#  DEFAULT MIRROR
#  https://download.gnome.org/
#  MIRROR LIST
#  http://ftp.gnome.org/pub/GNOME/MIRRORS
#  SEE ALSO
#  gnome.org.cygclass
#****
# cat MIRRORS | grep 'tp:' | sed -e 's!/$!!g'
mirror_gnome+="
	https://download.gnome.org
"   # mirror_gnome


#****d* Mirrors/mirror_gnu
#  DESCRIPTION
#  GNU projects FTP hosting
#  SYNOPSIS
#  SRC_URI="mirror://gnu/projectname/${P}.tar.gz"
#  DEFAULT MIRROR
#  https://ftpmirror.gnu.org/
#  MIRROR LIST
#  https://www.gnu.org/prep/ftp.html
#****
# cat ftp.html | grep '<li><a' | \
#   sed -e 's!.*<li><a href="!\t!g' -e 's!">.*!!g' -e 's!/$!!g'
mirror_gnu+="
	https://ftpmirror.gnu.org
	https://ftp.gnu.org/gnu
"   # mirror_gnu


#****id* Mirrors/mirror_gnustep
#  DESCRIPTION
#  GNUstep packages
#  SYNOPSIS
#  SRC_URI="mirror://gnustep/usr-apps/${ORIG_PN}-${PV}.tar.gz"
#  DEFAULT MIRROR
#  http://ftp.gnustep.org/pub/gnustep
#  MIRROR LIST
#  http://www.gnustep.org/resources/sources.html
#****
mirror_gnustep+="
	http://ftp.gnustep.org/pub/gnustep
	ftp://ftp.gnustep.org/pub/gnustep
"	# mirror_gnustep


#****d* Mirrors/mirror_kde
#  DESCRIPTION
#  KDE FTP
#  SYNOPSIS
#  SRC_URI="mirror://kde/stable/${PV}/src/${P}.tar.bz2"
#  DEFAULT MIRROR
#  https://download.kde.org/
#  MIRROR LIST
#  https://download.kde.org/?mirrorstats
#  SEE ALSO
#  kde.org.cygclass
#****
# cat mirrors | grep '<td><a' | \
#   sed -e 's!.*<td><a href="!\t!g' -e 's!">.*!!g' -e 's!/$!!g'
mirror_kde+=" https://download.kde.org"


#****d* Mirrors/mirror_mplayer
#  DESCRIPTION
#  MPlayer releases and skins
#  SYNOPSIS
#  SRC_URI="mirror://mplayer/releases/${P}.tar.bz2"
#  DEFAULT MIRROR
#  https://www1.mplayerhq.hu/MPlayer
#  MIRROR LIST
#  http://www.mplayerhq.hu/dload.html
#  NOTE
#  MPlayer releases are often outdated; using a SVN checkout is recommended.
#****
mirror_mplayer+=" http://www1.mplayerhq.hu/MPlayer"


#****d* Mirrors/mirror_mysql
#  DESCRIPTION
#  MySQL server and connector downloads
#  SYNOPSIS
#  SRC_URI="mirror://mysql/Downloads/MySQL-5.1/${P}.tar.gz"
#  DEFAULT MIRROR
#  https://mirrors.dotsrc.org/mysql
#  MIRROR LIST
#  https://dotsrc.org/mirrors/
#****
#  grep '^  <td><a' mirrors.html | sed -e 's|.*href="\(.*\)">.*|\t\1|g' -e 's|/$||g'
#  List primary mirrors first
mirror_mysql+="
	https://mirrors.dotsrc.org/mysql
	ftp://mirrors.dotsrc.org/mysql
	https://ftp.gwdg.de/pub/misc/mysql
	ftp://ftp.gwdg.de/pub/misc/mysql
	https://www.mirrorservice.org/sites/ftp.mysql.com
	ftp://ftp.mirrorservice.org/sites/ftp.mysql.com
"	# mirror_mysql


#****d* Mirrors/mirror_portage
#  DESCRIPTION
#  Gentoo Linux Portage tree (via GitWeb)
#  SYNOPSIS
#  PATCH_URI="mirror://portage/cat-egory/packagename/files/${P}-whatever.patch"
#  DEFAULT MIRROR
#  https://gitweb.gentoo.org/repo/gentoo.git/plain
#  MIRROR LIST
#  None
#  SEE ALSO
#  mirror_gentoo
#****
mirror_portage+=" https://gitweb.gentoo.org/repo/gentoo.git/plain"


#****d* Mirrors/mirror_savannah
#  DESCRIPTION
#  Savannah GNU project hosting
#  SYNOPSIS
#  SRC_URI="mirror://savannah/projectname/${P}.tar.gz"
#  DEFAULT MIRROR
#  https://download.savannah.nongnu.org/releases
#  MIRROR LIST
#  http://download.savannah.gnu.org/mirmon/savannah/
#****
#  sed -e 's|.* \(.*\)/|\t\1|g' 00_MIRRORS.txt
mirror_savannah+=" https://download.savannah.nongnu.org/releases"


#****d* Mirrors/mirror_sourceforge
#  DESCRIPTION
#  SourceForge project hosting
#  SYNOPSIS
#  SRC_URI="mirror://sourceforge/projectname/${P}.tar.bz2"
#  DEFAULT MIRROR
#  http://downloads.sourceforge.net
#  MIRROR LIST
#  https://sourceforge.net/apps/trac/sourceforge/wiki/Mirrors
#****
mirror_sourceforge+=" http://downloads.sourceforge.net"


#****d* Mirrors/mirror_sourceware
#  DESCRIPTION
#  Sourceware.org (aka sources.redhat.com) hosting
#  SYNOPSIS
#  SRC_URI="mirror://sourceware/projectname/${P}.tar.bz2"
#  DEFAULT MIRROR
#  https://ftp.sourceware.org/pub
#  MIRROR LIST
#  https://sourceware.org/mirrors.html
#****
mirror_sourceware+="
	https://ftp.sourceware.org/pub
	ftp://ftp.sourceware.org/pub
"


#****d* Mirrors/mirror_qt
#  DESCRIPTION
#  Qt, QtCreator, and PySide downloads
#  SYNOPSIS
#  SRC_URI="mirror://qt/offical_releases/qt/${VERSION%.*}/${VERSION}/qt-everywhere-opensource-src-${VERSION}.tar.gz"
#  DEFAULT MIRROR
#  http://download.qt-project.org/
#  MIRROR LIST
#  http://download.qt-project.org/static/mirrorlist/
#****
mirror_qt+=" http://download.qt-project.org"

# curl https://tug.org/texlive/mirmon/ \
#   | sed -n -e 's|^  <TD ALIGN=RIGHT><A HREF="\([^"]*\)/".*|\1|p'
mirror_tlpretest+="
	http://ftp.math.utah.edu/pub/texlive/tlpretest
	ftp://ftp.math.utah.edu/pub/texlive/tlpretest
	http://ftp.cstug.cz/pub/tex/local/tlpretest
	ftp://ftp.cstug.cz/pub/tex/local/tlpretest
	http://ctan.ijs.si/mirror/tlpretest
"

#****id* Mirrors/mirror_trolltech
#  NOTE
#  This mirror is deprecated and remains only for backwards compatibility.
#  New code should use mirror_qt.
#****
mirror_trolltech+=" ${mirror_qt}"


#****d* Mirrors/mirror_vim
#  DESCRIPTION
#  Vim downloads
#  SYNOPSIS
#  SRC_URI="mirror://vim/unix/${P}.tar.bz2 mirror://vim/extra/${P}-extra.tar.gz"
#  DEFAULT MIRROR
#  http://ftp.vim.org/pub/vim
#  MIRROR LIST
#  http://vim.sourceforge.net/mirrors.php
#****
# cat mirrors.php | egrep '^  <a href="(ht|f)tp:' | \
#	sed -e 's#  <a.*>\(.*\)</a>.*#\t\1#' -e 's#/$##'
mirror_vim+=" http://ftp.vim.org/pub/vim"


#****d* Mirrors/mirror_xfce
#  DESCRIPTION
#  Xfce sources
#  SYNOPSIS
#  SRC_URI="mirror://xfce/src/xfce/${PN}/${PV[1]}.${PV[2]}/${P}.tar.bz2"
#  DEFAULT MIRROR
#  https://archive.xfce.org
#  MIRROR LIST
#  https://www.xfce.org/download/
#  SEE ALSO
#  xfce4.cygclass
#****
mirror_xfce+=" https://archive.xfce.org"
