# Maintainer: Parabola automatic package builder <autobuilder@parabola.nu>


# NOTE: this PKGBUILD does not need to be edited manually
#       the package is normally built automatically by autobuilder
#       to generate a new keyring, push a new commit to hackers.git
#         eg: $ git commit --allow-empty --message=rebuild
#             $ git push parabola master
#       autobuilder will modify this PKGBUILD, build and publish the package,
#         and commit the modified PKGBUILD to abslibre


pkgname=parabola-keyring
pkgver=20210723
_gitver=7b3eac20134e14161a810add6f6647f2a06c8ee0
pkgrel=1
pkgdesc='Parabola GNU/Linux-libre PGP keyring'
arch=('any')
url='https://git.parabola.nu/hackers.git/'
license=('GPL')
makedepends=(parabola-hackers git)
install=$pkgname.install
source=("hackers-${_gitver}::git://git.parabola.nu/hackers.git#commit=${_gitver}")
sha512sums=('SKIP')


prepare() {
  cd "$srcdir"
  mv {,.}hackers-$_gitver
  mkdir .cachedir
  export PARABOLA_HACKERS_YAMLDIR="$PWD/.hackers-$_gitver/users"
  /usr/lib/parabola-hackers/pacman-make-keyring \
    V="$pkgver"                                 \
    keyserver='hkp://pgp.cyberbits.eu:11371'    \
    cachedir="$PWD/.cachedir"
}

package() {
  cd "$srcdir"
  bsdtar xf "$pkgname-$pkgver.tar.gz"
  cd "$srcdir/$pkgname-$pkgver"
  make PREFIX=/usr DESTDIR="${pkgdir}" install
}
