# SPDX-License-Identifier: CC0-1.0
# Maintainer: Parabola Hackers <dev@lists.parabola.nu>


# NOTE: This PKGBUILD does not need to be edited manually.
#       The package is normally built automatically by the auto-builder.
#       To generate a new package, simply push changes to blacklist.git.
#       If ${pkgname}-blacklist.txt is modified, the auto-builder will
#       replace $pkgver, $_srcver, and the checksum (updpkgsums),
#       build and publish the package, and commit the changes to abslibre.


pkgname=your-freedom
pkgver=20240328
_srcver=4b9246e1ef6bf0a2ab0b1f4709f70927161485a1
pkgrel=1
pkgdesc="This meta-package conflicts with every known non-free Arch package"
arch=(any)
url=https://wiki.parabola.nu/Blacklist
license=(custom:CCPL:zero)
# license=('CCPL:zero') # TODO: NYI

makedepends=(librelib)
install=${pkgname}.install
_srcname=${pkgname}-blacklist-${_srcver}.txt
source=(${_srcname}::https://git.parabola.nu/blacklist.git/plain/blacklist.txt?id=${_srcver})

sha256sums=('cbae71bcddc8959a12b75b2a0ea50a214b1f7b7537f0f439492ccea0918a40b2')


package()
{
  # collect blacklisted package names as pacman conflicts,
  # also to be excluded by the repo importer, and rejected by libremakepkg
  conflicts=( $( libreblacklist normalize < ${_srcname}     | \
                 cut -d: -f1,2 | sed -n 's/:$//p' | sort -u ) )

  install -Dm644 ${_srcname} "${pkgdir}"/usr/share/doc/${pkgname}/blacklist.txt
}
