#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=libfido2
pkgver=1.12.0
pkgrel=05
pkgdesc='Library functionality for FIDO 2.0, including communication with a device over USB'
url='https://developers.yubico.com/libfido2/'
arch=('x86_64')
depends=('openssl' 'libcbor' 'hidapi' 'libeudev' 'zlib')
makedepends=('cmake')
provides=('libfido2.so')
source=("https://developers.yubico.com/libfido2/Releases/libfido2-${pkgver}.tar.gz"{,.sig})

build() {
  cd ${pkgname}-${pkgver}
  # do not use bundled udev rules superseded by systemd
  cmake -B build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_C_FLAGS="${CFLAGS} ${CPPFLAGS}" \
    -Wno-dev \
    -S .
  make -C build VERBOSE=1
}

package() {
  cd ${pkgname}-${pkgver}
  make -C build DESTDIR="${pkgdir}" install
  install -Dm 644 NEWS README.adoc -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

#---- license gpg-key sha256sums ----

license=('BSD')

validpgpkeys=('EE90AE0D19774C8386628FAAB428949EF7914718'  # pedro martelletto <pedro@yubico.com>
	'1D7308B0055F5AEF36944A8F27A9C24D9588EA0F'  # Aveen Ismail <aveen.ismail@yubico.com>
	'7FBB6186957496D58C751AC20E777DD85755AA4A' # Konstantinos Georgantas <kostas@yubico.com>
	'78D997D53E9C0A2A205392ED14A19784723C9988') # Ludvig Michaelsson <ludvig.michaelsson@yubico.com>

sha256sums=(813d6d25116143d16d2e96791718a74825da16b774a8d093d96f06ae1730d9c5  # libfido2-1.12.0.tar.gz
	538f928627eccb909ae1727102b092f25686e78deba1ac561e97b21b84a564ce) # libfido2-1.12.0.tar.gz.sig

 
#  99167126f6d19ea8350fed19702fdbd0290976f62718aa706517c6a3c40cd126  libfido2-1.12.0-05-x86_64.pkg.tar.xz

