# $Id: PKGBUILD 108480 2014-03-27 14:48:13Z fyan $
# Maintainer : Felix Yan <felixonmars@gmail.com>
# Contributor: speps <speps at aur dot archlinux dot org>
# Contributor: Arnau Sanchez <tokland {at} gmail {dot} com>

_name=pyquery
pkgbase=python-pyquery
pkgname=('python-pyquery' 'python2-pyquery')
pkgver=1.2.8
pkgrel=3
pkgdesc="A jquery-like library for python."
arch=('any')
url="https://github.com/gawel/pyquery/"
license=('custom:BSD')
makedepends=('python-setuptools' 'python2-setuptools' 'python-lxml' 'python2-lxml' 'python-cssselect' 'python2-cssselect')
source=("http://pypi.python.org/packages/source/p/$_name/$_name-$pkgver.zip"
        "https://bitbucket.org/olauzanne/pyquery/raw/b70710332032/LICENSE.txt")
 
build() {
  cp -r "$_name-$pkgver" "$_name-$pkgver-python2"

  cd $_name-$pkgver
  python3 setup.py build

  cd ../$_name-$pkgver-python2
  python2 setup.py build
}

package_python-pyquery() {
  depends=('python-lxml' 'python-cssselect')
  cd $_name-$pkgver
  python3 setup.py install -O1 --root="$pkgdir/"

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

package_python2-pyquery() {
  depends=('python2-lxml' 'python2-cssselect')
  cd $_name-$pkgver-python2
  python2 setup.py install -O1 --root="$pkgdir/"

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

sha512sums=('9d344a5c4b0dd565e31c803ceecb217c71f9a70badbc65f9fcfb4a2cccb725a1bf938ed0b1697dcfdf0ec967321dccc1916a884ffdb0af9828a65005f63c47d7'
            '4932f86cbe9ed4c2e658acf9c228fdb0b2430fd622d559555196c7db0f43ea435483c7ae9916c325b40130334f4706d30e5adea6bc1d097b3283a7fc64926685')
