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

pkgname=gengetopt
pkgver=2.23
pkgrel=2
pkgdesc="A tool to write command line option parsing code for C programs"
arch=('i686' 'x86_64' 'arm' 'armv6h')
url="https://www.gnu.org/software/gengetopt/gengetopt.html"
license=("GPL")
options=('!docs' '!makeflags')
makedepends=('bison' 'flex' 'gcc' 'help2man' 'autotools')
source=(https://ftp.gnu.org/gnu/gengetopt/${pkgname}-${pkgver}.tar.xz{,.sig})
sha256sums=('b941aec9011864978dd7fdeb052b1943535824169d2aa2b0e7eae9ab807584ac'
            'SKIP')
validpgpkeys=('CD7AB2B200F374043F92E5D42485C3A5CF0FF62F')

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

  autoreconf -fiv
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  ./configure \
    --prefix=/usr \
    --build=${CHOST} \
    --disable-dependency-tracking

  make
}

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