# Maintainer (arch32): Brian Bidulock <bidulock@openss7.org>
# Contributor: Erich Eckner <deep42thought@archlinux32.org>
# Maintainer: Parabola Hackers <dev@lists.parabola.nu>


# parabola changes and rationale:
# technical:
#   - make available to other arches (eg: PCMCIA support)
#   - as a bonus, the parabola signature obviates the 'archlinux32-keyring-transition' package

# NOTE: upstream self-hosts signing keys - upon renewals, fetch manually and put under keys/
#     from https://bugs.archlinux32.org/index.php?do=details&task_id=365 (2024):
#     > verified on parabola and arch32, upgrading from archlinux32-keyring 202409 and 202401 -
#     > probably every user of arch32 and parabola i686 will need to do this manual intervention
#     >
#     > the recommended solution:
#     >
#     > 1) download the updated signing key from the web
#     >   $ K=33CA3597B0D161AAE4173F65C17F1214114574A4
#     >   $ wget https://archlinux32.org/keys.php?k=${K}
#     >   $ mv keys.php?k=${K} keys/pgp/${K}.asc
#     > 2) import that key into your build user's GPG keyring (not pacman's keyring) to
#     >   $ gpg --import keys/pgp/${K}.asc
#     > 3) get the package signature manually
#     >   $ pacman -Syw archlinux32-keyring
#     >   when pacman asks: "Do you want to delete it?", press 'n'
#     > 4) verify the signature
#     >   $ gpg --verify /var/cache/pacman/pkg/archlinux32-keyring-*-any.pkg.tar.zst.sig
#     > 5) if the signature check-out, install the package with signature checking disabled
#     >   edit /etc/pacman.conf:
#     >     #SigLevel = Required DatabaseOptional
#     >     SigLevel = TrustAll
#     >   $ pacman -U /var/cache/pacman/pkg/archlinux32-keyring-*-any.pkg.tar.zst
#     > 6) re-enable signature checking before installing other packages
#     >   edit /etc/pacman.conf:
#     >     SigLevel = Required DatabaseOptional
#     >   $ pacman -Su


pkgname=archlinux32-keyring
pkgver=20251214
pkgrel=1.0
pkgrel+=.parabola1
pkgdesc='Arch Linux 32 PGP keyring'
arch=('any')
url='https://archlinux32.org'
license=('GPL')
install=$pkgname.install
conflicts=(archlinux32-keyring-transition)
replaces=(archlinux32-keyring-transition)
source=("https://sources.archlinux32.org/sources/${pkgname}-v${pkgver}.tar.gz"{,.sig})
sha512sums=('93a604e59e58fbb1eca23449677f687c54eff25361a7cc1a738d6d3fa0564aa6218df080505ba4616e9b331376205f04108be4da9187a6b690bb09e63a0abddf'
            'SKIP')
validpgpkeys=('33CA3597B0D161AAE4173F65C17F1214114574A4')


package() {
    cd ${pkgname}-v${pkgver}
    make PREFIX=/usr DESTDIR="${pkgdir}" install
}
