# Contributor: Rémy Oudompheng <oudomphe@phare.normalesup.org>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=gmp-ecm
pkgver=6.4.4
pkgrel=2
pkgdesc='Elliptic Curve Method for Integer Factorization'
url='http://ecm.gforge.inria.fr/'
license=('GPL' 'LGPL')
depends=('gmp')
options=('!libtool')
arch=('i686' 'x86_64')
source=("http://gforge.inria.fr/frs/download.php/32159/ecm-${pkgver}.tar.gz")
sha1sums=('003d259772bd7748854f0fd8722299505c7d5259')

build() {
	cd "${srcdir}/ecm-${pkgver}"
	[[ $CARCH = *86* ]] && export CFLAGS+=' -msse'
	./configure --prefix=/usr --enable-shared --enable-openmp
	# make ecm-params
	make
}

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

package() {
	cd "${srcdir}/ecm-${pkgver}"
	make DESTDIR="${pkgdir}" install
}
