summaryrefslogtreecommitdiff
path: root/pacman-mirrorlist/PKGBUILD
blob: 82f8780a6b87f0dca018e8e8e04ce59739bfeefb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# $Id$
# Contributor: Dan McGee <dan@archlinux.org>
# Maintainer: Erich Eckner <arch at eckner dot net>

pkgname=pacman-mirrorlist
pkgver=20160420
pkgrel=1
pkgdesc="Arch Linux mirror list for use by pacman"
arch=('any')
url="https://www.archlinux.org/mirrorlist/"
license=('GPL')
backup=(etc/pacman.d/mirrorlist)
source=("${pkgname}-${pkgver}-${pkgrel}-any-original.tar.xz::https://arch.eckner.net/core/os/$(uname -m)/${pkgname}-${pkgver}-${pkgrel}-any.pkg.tar.xz")

package() {
  mkdir -p $pkgdir/etc/pacman.d
  tar -xJf ${pkgname}-${pkgver}-${pkgrel}-any-original.tar.xz
  cat etc/pacman.d/mirrorlist | \
    (
      while read s
      do
        echo "${s}"
        if [ -z "${s}" ]
        then
          echo 'Server = https://arch.eckner.net/$repo/os/$arch'
          echo ''
          break
        fi
      done
      cat
    ) \
    > mirrorlist
  install -m644 mirrorlist $pkgdir/etc/pacman.d/
}

sha512sums=('d4ca68094b92379930b4f4cb2ac68eec57e30aa74fab0316f76c874b1a403f8557dda47440faa87cb2d895d5d7abbe44fde536b055de2445fa5f7468e0c9d032')