# $Id: PKGBUILD 116746 2014-08-02 15:31:24Z aginiewicz $
# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>
# Contributor: Oliver Sherouse <oliver DOT sherouse AT gmail DOT com>
# Contributor: Nick Ward <ward.nickjames@gmail.com>
# Contributor: Rich Lindsley <rich at dranek dot com>

pkgbase=python-patsy
pkgname=('python2-patsy' 'python-patsy')
pkgver=0.3.0
pkgrel=1
pkgdesc="A Python package for describing statistical models and for building design matrices"
arch=('any')
url="https://github.com/pydata/patsy"
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools' 'python2-numpy' 'python-numpy' 'unzip')
source=("https://pypi.python.org/packages/source/p/patsy/patsy-${pkgver}.zip")
md5sums=('7545518b413136ba8343dcebea07e5e2')

build() {
  cd "$srcdir"
  cp -a patsy-${pkgver} patsy-py2-${pkgver}

  msg "Building Python2"
  cd "$srcdir"/patsy-py2-${pkgver}
  python2 setup.py build

  msg "Building Python3"
  cd "$srcdir"/patsy-${pkgver}
  python setup.py build
}

package_python2-patsy() {
  depends=('python2-numpy')
  optdepends=('python2-nose: needed for integrated test suite'
              'python2-scipy: needed for spline-related functions')

  cd "$srcdir"/patsy-py2-${pkgver}

  python2 setup.py install --skip-build --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

package_python-patsy() {
  depends=('python-numpy')
  optdepends=('python-nose: needed for integrated test suite'
              'python-scipy: needed for spline-related functions')

  cd "$srcdir"/patsy-${pkgver}

  python setup.py install --skip-build --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

