# $Id: PKGBUILD 349424 2018-07-01 18:55:17Z felixonmars $
# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Hugo Ideler <hugoideler@dse.nl>

pkgname=pystatgrab
pkgver=0.7
pkgrel=2
pkgdesc="Python bindings for libstatgrab"
arch=('x86_64')
url="http://www.i-scream.org/pystatgrab"
license=('GPL')
depends=('python' 'libstatgrab')
makedepends=('cython')
validpgpkeys=('4BD95F908A5040E8D26CD6816C226B37FDF38D55') # Tim Bishop <tim@bishnet.net>
source=(https://ftp.i-scream.org/pub/i-scream/$pkgname/$pkgname-$pkgver.tar.gz{,.asc})
sha256sums=('9e79919efdbeb45e28f26cb45d4f1a2861caa2937c5bf86be351c5c096b6550f'
            'SKIP')

prepare() {
  cd "${srcdir}"/$pkgname-$pkgver

  # Remove shipped copy of statgrab.c so it is regenerated with
  # newer Cython (>= 0.27.3) that is compatible with Python 3.7
  rm statgrab.c
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  python setup.py build
  python setup.py install --prefix="${pkgdir}"/usr
}
