# $Id: PKGBUILD 144935 2015-10-24 18:31:29Z arojas $
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>

pkgname=pari-sage
_pkgver=2.8-1813-g6157df4
pkgver=${_pkgver//-/.}
pkgrel=1
pkgdesc='Computer algebra system designed for fast computations in number theory. Development snapshot required by SageMath'
url='http://pari.math.u-bordeaux.fr/'
license=(GPL)
arch=(i686 x86_64)
depends=(gmp libx11)
makedepends=(perl texlive-core)
optdepends=('perl: gphelp, tex2mail')
conflicts=(pari)
provides=(pari)
# source=("http://www.sagemath.org/packages/upstream/pari/pari-$_pkgver.tar.gz"
source=("http://mirrors.mit.edu/sage/spkg/upstream/pari/pari-$_pkgver.tar.gz"
 'public_memory_functions.patch')
md5sums=('c753faaa4780de5ad8d461f0ffd70ecf'
         '9172b9faee975cd3fe0f97126ea61af8')

prepare() {
  cd pari-${_pkgver}

# make some private functions public
  patch -p1 -i "$srcdir"/public_memory_functions.patch
}

build() {
	cd pari-${_pkgver}
	./Configure \
		--prefix=/usr \
		--with-readline \
		--mt=pthread \
		--with-gmp \

	make all
}

package() {
	cd pari-${_pkgver}
	make DESTDIR="$pkgdir" install
	ln -sf gp.1.gz "$pkgdir"/usr/share/man/man1/pari.1
}
