# $Id$
# Maintainer: Pierre Schmitz <pierre@archlinux.de>

pkgname=gd
pkgver=2.2.3
pkgrel=3
pkgdesc="Library for the dynamic creation of images by programmers"
arch=('i686' 'x86_64')
url="http://www.libgd.org/"
license=('custom')
depends=('fontconfig' 'libxpm' 'libwebp')
optdepends=('perl: bdftogd script')
source=("https://github.com/libgd/libgd/releases/download/gd-${pkgver}/libgd-${pkgver}.tar.xz")
md5sums=('14e4134c129b4c166c3a0549a32ef340')

build() {
  cd libgd-${pkgver}
  ./configure \
    --prefix=/usr \
    --disable-rpath
  make
}

check() {
  cd libgd-${pkgver}
  [[ ${CARCH} == 'i686' ]] || make check
}

package() {
  cd libgd-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}