# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>

pkgname=npth
pkgver=1.6
pkgrel=3
pkgdesc='The new GNU portable threads library'
arch=('x86_64')
url="https://www.gnupg.org/software/npth/index.html"
license=('LGPL2.1')
depends=('glibc' 'sh')
provides=('libnpth.so')
source=("https://gnupg.org/ftp/gcrypt/${pkgname}/${pkgname}-${pkgver}.tar.bz2"{,.sig})
sha512sums=('2ed1012e14a9d10665420b9a23628be7e206fd9348111ec751349b93557ee69f1176bcf7e6b195b35b1c44a5e0e81ee33b713f03d79a33d1ecd9037035afeda2'
            'SKIP')
b2sums=('665fdb2f4cbe59750b6b4b7c2701ee80a23a122df10c9f8be47c4af5f3bf5968f709637ab3f4878bb68609752fbb6ce1364e109fdfeba64e4db258733a33f3fc'
        'SKIP')
validpgpkeys=(
  'D8692123C4065DEA5E0F3AB5249B39D24F25E3B6'  # Werner Koch (dist sig)
  '46CC730865BB5C78EBABADCF04376F3EE0856959'  # David Shaw (GnuPG Release Signing Key)
  '031EC2536E580D8EA286A9F22071B08A33BD3F06'  # NIIBE Yutaka (GnuPG Release Key) <gniibe@fsij.org>
  'D238EA65D64C67ED4C3073F28A861B1C7EFD60D9'  # Werner Koch (Release Signing Key)
)

prepare() {
  cd "${pkgname}-${pkgver}"
  autoreconf -fiv
}

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

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

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -vDm 644 {README,NEWS,ChangeLog} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}
