summaryrefslogtreecommitdiff
path: root/libre/pacman-mirrorlist/PKGBUILD
blob: ce1e9921564c37b432673a43039b28d41b6d1e5e (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
38
39
40
41
42
43
44
45
# Maintainer (arch): Florian Pritz <bluewind@xinu.at>
# Contributor (arch): Dan McGee <dan@archlinux.org>
# Contributor: Isaac David <isacdaavid@at@isacdaavid@dot@info>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Esteban Carnevale <alfplayer@mailoo.org>


# Note: building and publishing this package is a bit delicate
#   1: modify 'mirrorlist.txt' on the repo server
#   2: `makepkg -g` (to get the new checksum)
#   3: put the new checksum in 'sha256sums'
#   4: if this PKGBUILD was modified for another reason, set 'pkgver' to YYYYMMDD
#   5: `sudo libremakepkg && librestage && librerelease` (to publish the new package)


pkgname=pacman-mirrorlist
pkgver=20210803
pkgrel=1.parabola1
pkgdesc="Parabola GNU/Linux-libre mirror list for use by pacman"
arch=('any')
url="https://www.parabola.nu/"
license=('GPL')

backup=(etc/pacman.d/mirrorlist)
source=(mirrorlist-${pkgver}.txt::https://repo.parabola.nu/mirrorlist.txt)

sha256sums=('5cd5b901c094459945c21e0ee9be473d1224162fd2ed31469cf452485cba89e0')

pkgver()
{
  LC_ALL=C date -u +%Y%m%d
}

prepare()
{
  local dt=$( LC_ALL=C date -u +%Y-%m-%d )

  sed -i "s|\(Last Updated: \).*|\1${dt}|" "${srcdir}"/mirrorlist-${pkgver}.txt
}

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