# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com
# Contributor: Timothy Redaelli <timothy.redaelli+aur@gmail.com>

pkgname=jitterentropy
_pkgname=$pkgname-library
pkgver=3.3.0
pkgrel=1
pkgdesc='Hardware RNG based on CPU timing jitter'
arch=('x86_64')
url='https://www.chronox.de/jent.html'
license=('BSD' 'GPL2')
depends=('glibc')
source=(https://www.chronox.de/jent/$_pkgname-$pkgver.tar.xz{,.asc})
sha256sums=('b0743fdc6044e95732cbd374e2e2b4cdd4eab2989d3784e8669147c0be83a9b9'
            'SKIP')
validpgpkeys=(3BCC43D4D2C87D1784B69EE4421EE936326AC15B)

prepare() {
  cd "$_pkgname-$pkgver"

  # Disable man page compression on install
  sed -e '/\tgzip .*\/man\// d' -i Makefile
  # Let the package manager handle stripping
  sed -e '/\tinstall.*-s / s/-s //g' -i Makefile
}

build() {
  cd "$_pkgname-$pkgver"
  LDFLAGS=-lpthread make jitterentropy
}

package() {
  cd "$_pkgname-$pkgver"
  install -dm755 "$pkgdir/usr/include"
  make PREFIX=/usr DESTDIR="$pkgdir/" install
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 LICENSE.bsd "$pkgdir/usr/share/licenses/$pkgname/LICENSE.bsd"
}

# vim:set ts=2 sw=2 et:
