# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=pcsclite
pkgver=%version%
pkgrel=%release%
pkgdesc="PC/SC Architecture smartcard middleware library"
arch=('x86_64')
url='https://pcsclite.apdu.fr/'
license=('BSD')
depends=('libsystemd.so' 'libudev.so' 'libpolkit-gobject-1.so')
makedepends=('systemd' 'polkit')
optdepends=(
  'python: API call trace logging with the pcsc-spy'
  'ccid: USB Chip/Smart Card Interface Devices driver'
)
provides=('libpcsclite.so' 'libpcscspy.so')
validpgpkeys=('F5E11B9FFE911146F41D953D78A1B4DFE8F9C57E') # Ludovic Rousseau <rousseau@debian.org>
source=("https://pcsclite.apdu.fr/files/pcsc-lite-${pkgver}.tar.bz2"{,.asc})
sha256sums=('f42ee9efa489e9ff5d328baefa26f9c515be65021856e78d99ad1f0ead9ec85d'
            'SKIP')

build() {
  cd "pcsc-lite-$pkgver"

  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc \
    --disable-static \
    --enable-filter \
    --enable-ipcdir=/run/pcscd \
    --enable-libudev \
    --enable-usbdropdir=/usr/lib/pcsc/drivers \
    --enable-polkit \
    --with-systemdsystemunitdir=/usr/lib/systemd/system

  make
}

package() {
  cd "pcsc-lite-$pkgver"
  make DESTDIR="$pkgdir" install

  install -D -m0644 "$srcdir/pcsc-lite-$pkgver/COPYING" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -d "$pkgdir/usr/lib/pcsc/drivers"
}

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