# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Rémy Oudompheng <oudomphe@clipper.ens.fr>

pkgname=zn_poly
pkgver=0.9.1
pkgrel=2
pkgdesc="Polynomial arithmetic over Z/nZ"
arch=(x86_64)
url="https://gitlab.com/sagemath/zn_poly/"
license=(GPL)
depends=(gmp)
makedepends=(python2)
source=("https://gitlab.com/sagemath/zn_poly/-/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('d11aea5646cd72ea44ce8dd0d996cf2ea498e882ed96304a74481c4eb6e01093')

build() {
  cd $pkgname-$pkgver
  python2 makemakefile.py --prefix=/usr --cflags="$CFLAGS -fPIC" --cxxflags="$CXXFLAGS" --ldflags="$LDFLAGS" > makefile
  make
  make libzn_poly.so
}

package() {
  cd $pkgname-$pkgver
  python2 makemakefile.py --prefix="$pkgdir"/usr > makefile
  make install
# Install shared library
  cp libzn_poly.so "$pkgdir"/usr/lib
}
