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

pkgname=intltool
pkgver=0.51.0
pkgrel=2
pkgdesc="The internationalization tool collection"
license=('GPL3')
arch=('i686' 'x86_64')
url="https://edge.launchpad.net/intltool"
groups=('base-devel')
makedepends=('perl')
depends=('perl-XML-Parser')
source=(https://edge.launchpad.net/intltool/trunk/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz{,.asc}
        perl-5.22-compatibility.patch)
sha256sums=('67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd'
            'SKIP'
            '9c6527072aada6e3cb9aceb6e07cfdf51d58839a2beb650168da0601a85ebda3')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/perl-5.22-compatibility.patch
}

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

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

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  install -D -m644 doc/I18N-HOWTO "${pkgdir}/usr/share/doc/${pkgname}/I18N-HOWTO"
}
