summaryrefslogtreecommitdiff
path: root/pacman-mirrorlist/PKGBUILD
blob: 240b4b73c05735088bb569465adca7d20647864c (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
37
# $Id$
# Contributor: Dan McGee <dan@archlinux.org>
# Maintainer: Erich Eckner <arch at eckner dot net>

pkgname=pacman-mirrorlist
pkgver=20160516
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")
sha512sums=('5056893b62900ee2d0dec99be5af5e572392a5fa743dea4b8e736d3d68f3cb704bfb83a5c1db404c0df7777fe776759d0ef3136348fb486ddc2133dbfba05128')

build() {
  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
}

package() {
  mkdir -p $pkgdir/etc/pacman.d
  install -m644 mirrorlist $pkgdir/etc/pacman.d/
}