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

pkgname=help2man
pkgver=1.47.1
pkgrel=1
pkgdesc="Conversion tool to create man files"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/help2man/"
license=('GPL')
groups=('base-devel')
depends=('perl-Locale-Gettext' 'libintl')
install=help2man.install
source=(http://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig}
        1.40.4-cygwin-nls.patch)
sha256sums=('c59b26f60cb06e45b00e729dea721e7a17220e2c17d800eb428271a750382b06'
            'SKIP'
            '6cf5541d6233b6c0ce0248ecb6376682646ee56f795b19906f0acc63d83de482')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p2 -i ${srcdir}/1.40.4-cygwin-nls.patch
  autoreconf -ivf
}

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

  ./configure \
      --build=${CHOST} \
      --prefix=/usr \
      --mandir=/usr/share/man \
      --infodir=/usr/share/info \
      --libdir=/usr/lib

  make
}

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