# Maintainer: Jan Alexander Steffens (heftig) # Contributor: Ionut Biru pkgbase=p11-kit pkgname=( p11-kit libp11-kit p11-kit-docs ) pkgver=0.25.4 pkgrel=1 pkgdesc="Loads and enumerates PKCS#11 modules" url="https://p11-glue.freedesktop.org" arch=(x86_64) license=(BSD-3-Clause) depends=( coreutils glibc libtasn1 systemd-libs ) makedepends=( bash-completion gtk-doc libffi meson systemd ) checkdepends=( gnutls ) source=( https://github.com/p11-glue/p11-kit/releases/download/$pkgver/p11-kit-$pkgver.tar.xz{,.sig} 0001-iter-Fix-recursive-attribute-loading.patch ) b2sums=('51bfaf02de0cf251542d86dfcabcfd15817b90b11e7c6d2f534d99598a7e7e08109ec665835a5fee63da77fc183baccdeb8a7d526fbdacaf90d6fb9bf593e7d6' 'SKIP' '0395e962c245fc8d16190fe4bc88f7d8a3e6f892ba59cf982d7b172ca0c2dda40fa4db9348760d181d3e136d6b8b12476bffb17554bc44e67f618061f1d2c1c5') validpgpkeys=( C0F67099B808FB063E2C81117BFB1108D92765AF # Stef Walter 462225C3B46F34879FC8496CD605848ED7E69871 # Daiki Ueno 5D46CB0F763405A7053556F47A75A648B3F9220C # Zoltan Fridrich ) prepare() { cd p11-kit-$pkgver # https://github.com/p11-glue/p11-kit/issues/641 patch -Np1 -i ../0001-iter-Fix-recursive-attribute-loading.patch } build() { local meson_options=( -D gtk_doc=true -D man=true -D trust_paths=/etc/ca-certificates/trust-source:/usr/share/ca-certificates/trust-source ) arch-meson p11-kit-$pkgver build "${meson_options[@]}" meson compile -C build } check() { meson test -C build --print-errorlogs } _pick() { local p="$1" f d; shift for f; do d="$srcdir/$p/${f#$pkgdir/}" mkdir -p "$(dirname "$d")" mv "$f" "$d" rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")" done } package_p11-kit() { depends+=( "libp11-kit=$pkgver-$pkgrel" libp11-kit.so libsystemd.so ) install=p11-kit.install meson install -C build --destdir "$pkgdir" ln -srf "$pkgdir/usr/bin/update-ca-trust" "$pkgdir/usr/lib/p11-kit/trust-extract-compat" _pick lib "$pkgdir"/usr/include _pick lib "$pkgdir"/usr/lib/{p11-kit-proxy.so,libp11-kit.*} _pick lib "$pkgdir"/usr/lib/{pkcs11,pkgconfig} _pick lib "$pkgdir"/usr/share/p11-kit _pick doc "$pkgdir"/usr/share/gtk-doc install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 p11-kit-$pkgver/COPYING } package_libp11-kit() { pkgdesc+=" (library)" depends=( glibc libffi libtasn1 ) provides=(libp11-kit.so) mv lib/* "$pkgdir" install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 p11-kit-$pkgver/COPYING } package_p11-kit-docs() { pkgdesc+=" (documentation)" depends=() mv doc/* "$pkgdir" install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 p11-kit-$pkgver/COPYING } # vim:set sw=2 sts=-1 et: