archrelease: copy trunk to extra-x86_64
[arch-packages.git] / wireless-regdb / trunk / PKGBUILD
blob3d79f92617a46090d003bceacb8b0dfecd91ef16
1 # Maintainer: Thomas Bächler <thomas@archlinux.org>
3 pkgname=wireless-regdb
4 pkgver=2021.08.28
5 pkgrel=1
6 pkgdesc="Central Regulatory Domain Database"
7 arch=('any')
8 url="https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb"
9 backup=(etc/conf.d/wireless-regdom)
10 license=('custom')
11 depends=('sh')
12 makedepends=('crda')
13 source=(https://www.kernel.org/pub/software/network/wireless-regdb/${pkgname}-${pkgver}.tar.{xz,sign}
14         crda.conf.d)
15 sha256sums=('cff370c410d1e6d316ae0a7fa8ac6278fdf1efca5d3d664aca7cfd2aafa54446'
16             'SKIP'
17             '192428fd959806705356107bffc97b8b379854e79bd013c4ee140e5202326e2b')
18 validpgpkeys=('2ABCA7498D83E1D32D51D3B5AB4800A62DB9F73A') #Seth Forshee <seth.forshee@canonical.com>
20 package() {
21   # Install and verify regulatory.bin file
22   install -D -m644 "${srcdir}"/${pkgname}-${pkgver}/regulatory.bin "${pkgdir}"/usr/lib/crda/regulatory.bin
23   # This creates a depend/makedepend loop:
24   # crda depends on wireless-regdb (but strictly doesn't makedepend on it)
25   # wireless-regdb makedepends on crda
26   if ! /usr/bin/regdbdump "${pkgdir}"/usr/lib/crda/regulatory.bin > /dev/null; then
27   return 1
28   fi
29   install -D -m644 "${srcdir}"/${pkgname}-${pkgver}/sforshee.key.pub.pem "${pkgdir}"/usr/lib/crda/pubkeys/sforshee.key.pub.pem
30   install -D -m644 "${srcdir}"/${pkgname}-${pkgver}/LICENSE "${pkgdir}"/usr/share/licenses/wireless-regdb/LICENSE
31   install -D -m644 "${srcdir}"/${pkgname}-${pkgver}/regulatory.bin.5 "${pkgdir}"/usr/share/man/man5/regulatory.bin.5
32  install -D -m644 "${srcdir}"/${pkgname}-${pkgver}/regulatory.db "${pkgdir}"/usr/lib/firmware/regulatory.db
33  install -D -m644 "${srcdir}"/${pkgname}-${pkgver}/regulatory.db.p7s "${pkgdir}"/usr/lib/firmware/regulatory.db.p7s
34  install -D -m644 "${srcdir}"/${pkgname}-${pkgver}/regulatory.db.5 "${pkgdir}"/usr/share/man/man5/regulatory.db.5
35   install -D -m644 "${srcdir}"/crda.conf.d "${pkgdir}"/etc/conf.d/wireless-regdom
36   for dom in $(grep ^country "${srcdir}"/${pkgname}-${pkgver}/db.txt | cut -d' ' -f2 | sed 's|:||g'); do
37     echo "#WIRELESS_REGDOM=\"${dom}\"" >> "${pkgdir}"/etc/conf.d/wireless-regdom.tmp
38   done
39   sort -u "${pkgdir}"/etc/conf.d/wireless-regdom.tmp >> "${pkgdir}"/etc/conf.d/wireless-regdom
40   rm "${pkgdir}"/etc/conf.d/wireless-regdom.tmp
42   install -D -m644 "${srcdir}"/${pkgname}-${pkgver}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"