makedepends=(json-c libusb yubico-c yubico-c-client)

description="Yubico YubiKey Personalization library and tool"
url="http://www.yubico.com/"

packager="Great-OS Team"
maintainer="Great-OS Team"

name=yubikey-personalization
version=1.20.0
release=4

source=(https://developers.yubico.com/${name}/Releases/ykpers-$version.tar.gz
  09ea16d9e2030e4da6ad00c1e5147e962aa7ff84.patch
  0001-fix-boolean-value-with-json-c-0.14.patch)

build () {

  cd ykpers-$version

  patch -Np1 -i ../09ea16d9e2030e4da6ad00c1e5147e962aa7ff84.patch # From Debian
  patch -Np1 -i ../0001-fix-boolean-value-with-json-c-0.14.patch

  ./configure --prefix=/usr \
              --with-udevrulesdir=/usr/lib/udev/rules.d/

  make
}

package() {

  cd ykpers-$version

  make DESTDIR=$PKG install

  install -D -m0644 README "${PKG}/usr/share/doc/$name-$version/README"
}
