# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=pari
pkgver=2.11.2
pkgrel=1
pkgdesc='Computer algebra system designed for fast computations in number theory'
url='https://pari.math.u-bordeaux.fr/'
license=('GPL')
arch=('x86_64')
depends=('gmp' 'readline' 'libx11')
makedepends=('perl' 'texlive-core')
optdepends=('perl: gphelp, tex2mail')
validpgpkeys=('42028EA404A2E9D80AC453148F0E7C2B4522E387')
source=("https://pari.math.u-bordeaux.fr/pub/pari/unix/${pkgname}-${pkgver}.tar.gz"{,.asc})
sha256sums=('4a6532b3c77350363fa618ead5cd794a172d7b7e5757a28f7788e658b5469339'
            'SKIP')

conflicts=('pari-sage')
replaces=("pari-sage<=1:${pkgver}")

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./Configure \
		--prefix=/usr \
		--with-readline \
		--mt=pthread \
		--with-gmp \

	make all
}

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

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