# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=py-psycopg2 _pkgname=psycopg2 pkgver=2.7.3.1 pkgrel=0 pkgdesc="A Python-PostgreSQL Database Adapter" url="http://initd.org/psycopg/" arch="all" license="LGPL2+" makedepends="postgresql-dev python2-dev python3-dev py-egenix-mx-base-dev" subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" build() { cd "$builddir" python2 setup.py build python3 setup.py build } package() { mkdir -p "$pkgdir" } _py2() { replaces="$pkgname" depends="py-egenix-mx-base" _py python2 } _py3() { _py python3 } _py() { local python="$1" pkgdesc="$pkgdesc (for $python)" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" } sha512sums="206d4cf62a091927daf4b734e0b3597399fc588cb738366711674fc06c39d68a682981bc4756c356d37c41caba49b5df2b915beace8670c190d7d41e374f1eb5 psycopg2-2.7.3.1.tar.gz"