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

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

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

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