pkgname=dejagnu
pkgver=1.6.3
pkgdesc='Framework for testing other programs'
homepage='https://www.gnu.org/software/dejagnu/'
license=(GPL)
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://ftp.gnu.org/gnu/dejagnu/${sources[0]}")
md5sums=("68c5208c58236eba447d7d6d1326b821")


src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
  mkdir -v build
  cd       build
}

src_build() {
  ../configure --prefix=/usr
  makeinfo --html --no-split -o doc/dejagnu.html ../doc/dejagnu.texi
  makeinfo --plaintext       -o doc/dejagnu.txt  ../doc/dejagnu.texi
}

src_check() {
  make check
}

src_install() {
  make DESTDIR="$pkgdir" install
  install -v -dm755  "${pkgdir}/usr/share/doc/dejagnu-${pkgver}"
  install -v -m644   doc/dejagnu.{html,txt} "${pkgdir}/usr/share/doc/dejagnu-${pkgver}"
}
