# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=gperf
pkgver=3.1
pkgrel=2
pkgdesc="Perfect hash function generator"
arch=('x86_64' 'i686')
url="https://www.gnu.org/software/gperf/"
license=('GPL3')
groups=('base-devel')
depends=('gcc-libs' 'info')
makedepends=('gcc' 'texinfo')
install=gperf.install
source=("https://ftp.gnu.org/pub/gnu/gperf/${pkgname}-${pkgver}.tar.gz"{,.sig})
sha256sums=('588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2'
            'SKIP')
options=('!makeflags')
validpgpkeys=('93C08C88471097CD'
'EDEB87A500CC0A211677FBFD93C08C88471097CD')

prepare() {
  cd "${srcdir}"/${pkgname}-${pkgver}
}

build() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  ./configure \
    --build=${CHOST} \
    --prefix=/usr \
    --docdir=/usr/share/gperf/doc/
  make
}

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

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