# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libfido2
pkgver=1.15.0
pkgrel=1
pkgdesc='Library functionality for FIDO 2.0, including communication with a device over USB'
url='https://developers.yubico.com/libfido2/'
arch=('x86_64')
license=('BSD-2-Clause')
depends=('glibc' 'openssl' 'libcbor' 'libcbor.so' 'hidapi' 'systemd-libs'  'libudev.so' 'zlib')
makedepends=('cmake' 'systemd')
provides=('libfido2.so')
source=("https://developers.yubico.com/libfido2/Releases/libfido2-${pkgver}.tar.gz"{,.sig})
sha512sums=('cca142e3b3b7e216289934785fcad6be3bcd344001445f04fcecf01d4f568523b949c7204eec2f32faf12605a98c7496b9f64bb34d6a312342fa997689e61635'
            'SKIP')
b2sums=('824dfd98a4d05ea3fe06b8c405ddd8513db3fce1e66799a974085d69276a0d12abaaceab0e48e225226ec43f20986a4ba7d6e753ef16fd0cb65c806aa3ae59e0'
        'SKIP')
  '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>
)

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=None \
    -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}"
}

# vim: ts=2 sw=2 et:
