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

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

prepare() {
  cd $pkgname-$pkgver

  patch -p0 -i ../ratpoints-fPIC.patch
}

build() {
  cd $pkgname-$pkgver

  make
}

package() {
  cd $pkgname-$pkgver

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

