# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=ratpoints
pkgver=2.1.3
pkgrel=1
pkgdesc="A program that uses an optimized quadratic sieve algorithm in order to find rational points on hyperelliptic curves"
arch=('i686' 'x86_64')
url="http://www.mathe2.uni-bayreuth.de/stoll/programs/index.html"
license=('GPL2')
depends=('gmp')
options=('staticlibs')
source=("http://www.mathe2.uni-bayreuth.de/stoll/programs/$pkgname-$pkgver.tar.gz" 'fPIC.patch')
md5sums=('597fee3856ef2f80fffc0a440e926208'
         '60cc67b9308b2e66e65fd6814d341ed6')

prepare() {
  cd $pkgname-$pkgver

  patch -p0 -i $srcdir/fPIC.patch
}

build() {
  cd $pkgname-$pkgver

  make
}

package() {
  cd $pkgname-$pkgver

  mkdir -p "$pkgdir"/usr/{bin,include,lib}
  make install INSTALL_DIR="$pkgdir"/usr
}

