git » pcsclite.git » main » tree

[main] / PKGBUILD

# Maintainer: Alad Wenter <alad@archlinux.org>
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Daniel Plaza <daniel.plaza.espi@gmail.com>

pkgname=pcsclite
pkgver=2.2.1
pkgrel=1
pkgdesc="PC/SC Architecture smartcard middleware library"
arch=('x86_64' 'armv7h')
url='https://pcsclite.apdu.fr/'
# https://salsa.debian.org/rousseau/PCSC/-/blob/2.0.3/COPYING
license=(
  'BSD-3-Clause'        # Most of it
  'GPL-3.0-or-later'    # doc/example/pcsc_demo.c, src/spy/, UnitaryTests/
  'BSD-2-Clause'        # src/auth.c, src/auth.h
  '0BSD'                # src/simclist.c, src/simclist.h
)
depends=(
  systemd-libs
#  'libsystemd.so'
 # 'libudev.so'
  'libpolkit-gobject-1.so'
)
makedepends=(
  'git'
  'meson'
  'polkit'
  'systemd'
)
optdepends=(
  'python: API call trace logging with the pcsc-spy'
  'ccid: USB Chip/Smart Card Interface Devices driver'
)
provides=(
  'libpcsclite.so'
  'libpcsclite_real.so'
  'libpcscspy.so'
)
validpgpkeys=('F5E11B9FFE911146F41D953D78A1B4DFE8F9C57E') # Ludovic Rousseau <rousseau@debian.org>
source=(
  "git+https://github.com/LudovicRousseau/PCSC.git#tag=${pkgver}?signed"
)
sha256sums=('6ab731088ecbb9b69620393db12312b505e11b4d3d8aad33104b5e0628a5a34a')

build() {
  local meson_options=(
    -D libsystemd=true
    -D libudev=true
    -D polkit=true
    -D serial=true
    -D systemdunit=system
  )
  arch-meson PCSC build "${meson_options[@]}"
  meson compile -C build

  # namcap requires separate files for each "uncommon" license (ex: BSD* ones), so splitting the upstream COPYING file
  awk '/David Corcoran/{flag=1} /GNU GPL v3/ {flag=0} flag' PCSC/COPYING > LICENSE.BSD-3-Clause
  awk '/GNU GPL v3/    {flag=1} /auth.c/     {flag=0} flag' PCSC/COPYING > LICENSE.GPL-3.0-or-later
  awk '/auth.c/        {flag=1} /simclist.c/ {flag=0} flag' PCSC/COPYING > LICENSE.BSD-2-Clause
  awk '/simclist.c/    {flag=1} flag'                       PCSC/COPYING > LICENSE.0BSD
}

package() {
  meson install -C build --destdir "${pkgdir}"

  install -D -m0644 LICENSE.* -t "$pkgdir/usr/share/licenses/$pkgname"
  install -d "$pkgdir/usr/lib/pcsc/drivers"
}

# vim:set sw=2 sts=-1 et: