# Maintainer: Markus M. May <triplem@tu.archserver.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Eric Belanger <eric@archlinux.org>

pkgname=imagemagick
pkgver=6.6.9.5
_pkgver="${pkgver%.*}-${pkgver##*.}"
pkgrel=1
pkgdesc="An image viewing/manipulation program"
arch=('i686' 'x86_64')
url="http://www.imagemagick.org/"
license=('custom')
depends=('libtool' 'lcms' 'libxt' 'gcc-libs' 'bzip2' 'freetype2' 'fontconfig'
         'libxext')
makedepends=('ghostscript' 'openexr' 'libxml2' 'jasper')
optdepends=('ghostscript: for Ghostscript support' 
            'openexr: for OpenEXR support' 
            'libxml2: for XML support'
            'jasper: for JPEG-2000 support')
options=('!makeflags' '!docs' 'force')
source=("ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-${_pkgver}.tar.xz")
md5sums=('ff045983797348164c58158f0c3471e8')

build() {
        cd ${srcdir}/ImageMagick-${_pkgver}

        ./configure --prefix=/usr --with-modules --disable-static \
            --enable-openmp --without-x --without-wmf --with-openexr --with-xml \
            --with-gslib --with-gs-font-dir="/usr/share/fonts/Type1" \
            --with-perl --with-perl-options="INSTALLDIRS=vendor" \
            --without-gvc --without-djvu --without-autotrace --with-jp2 \
            --without-jbig --without-fpx --without-dps --without-rsvg
        make
}

package() {
        cd ${srcdir}/ImageMagick-${_pkgver}

        make DESTDIR=${pkgdir} install

        install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
        install -Dm644 NOTICE ${pkgdir}/usr/share/licenses/${pkgname}/NOTICE

        #Cleaning
        find ${pkgdir} -name '*.bs' -exec rm {} \;
        rm -f ${pkgdir}/usr/lib/*.la
}

# vim:set ts=2 sw=2 et:
