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

pkgname=oath-toolkit
pkgver=%version%
pkgrel=%release%
pkgdesc='OATH one-time password toolkit'
arch=('x86_64')
url='https://www.nongnu.org/oath-toolkit/'
license=('GPL-3.0-or-later')
depends=('glibc' 'pam' 'xmlsec')
provides=('liboath.so' 'libpskc.so')
validpgpkeys=('B1D2BD1375BECB784CF4F8C4D73CF638C53C06BE') # Simon Josefsson <simon@josefsson.org>
source=("https://download.savannah.nongnu.org/releases/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig})
sha256sums=('fc512a4a5b46f4c43ab0586c3189fece4d54f7e649397d6fa1e23428431e2cb4'
            'SKIP')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

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

  # Install basic docs too
  install -D -m 0644 pam_oath/README "$pkgdir/usr/share/doc/$pkgname/PAM_README"
  install -D -m 0644 README "$pkgdir/usr/share/doc/$pkgname/README"
}
