# $Id: PKGBUILD 106477 2014-03-04 08:43:01Z andrea $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Leonidas <marek@xivilization.net>

pkgname=yap
pkgver=6.2.2
pkgrel=4
pkgdesc='A high-performance Prolog compiler'
url='http://www.dcc.fc.up.pt/~vsc/Yap/'
license=('PerlArtistic')
arch=('i686' 'x86_64')
depends=('gmp' 'unixodbc' 'libmariadbclient')
makedepends=('texi2html' 'texinfo' 'jdk7-openjdk' 'texlive-plainextra')
optdepends=('java-runtime-headless: Java Interface Library JPL')
source=("http://www.dcc.fc.up.pt/~vsc/Yap/${pkgname}-${pkgver}.tar.gz")
md5sums=('95eaa54978e4811ff6e504e7dca9e835')

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --with-java="${JAVA_HOME}" \
    --enable-threads \
    --enable-dynamic-loading \
    --enable-max-performance \
    --enable-max-memory
  make

  make html
  make pdf
}

package() {
  cd ${pkgname}-${pkgver}

  make DESTDIR="${pkgdir}" install
  make DESTDIR="${pkgdir}" install_docs
}
