# $Id: PKGBUILD 208210 2014-03-19 02:32:28Z eric $
# Maintainer:

pkgbase=python-pysqlite
pkgname=python2-pysqlite
pkgver=2.6.3
pkgrel=4
pkgdesc="A Python DB-API 2.0 interface for the SQLite embedded relational database engine"
license=('custom')
arch=('i686' 'x86_64')
url="https://pypi.python.org/pypi/pysqlite"
depends=('python2' 'sqlite')
conflicts=('python-pysqlite<=2.6.3-2')
replaces=('python-pysqlite<=2.6.3-2')
source=(https://pypi.python.org/packages/source/p/pysqlite/pysqlite-${pkgver}.tar.gz
        setup.cfg)
md5sums=('7ff1cedee74646b50117acff87aa1cfa'
         '86dd356c65afd14a22f2f8f64a26441e')

prepare() {
  cp "${srcdir}/setup.cfg" pysqlite-${pkgver}
}

build() {
  cd pysqlite-${pkgver}
  python2 setup.py build
}

check() {
  cd pysqlite-${pkgver}/build/lib.*/
  python2 -c "from pysqlite2 import test; test.test()"
}

package_python2-pysqlite() {
  cd pysqlite-${pkgver}
  python2 setup.py install --root="${pkgdir}"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  rm -r "${pkgdir}/usr/pysqlite2-doc"
}
