# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=py-psycopg2 _pkgname=psycopg2 pkgver=2.6.2 pkgrel=1 pkgdesc="A Python-PostgreSQL Database Adapter" url="http://initd.org/psycopg/" arch="noarch" license="LGPL2+" depends="" 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 || return 1 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)" arch="all" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" } md5sums="4a392949ba31a378a18ed3e775a4693f psycopg2-2.6.2.tar.gz" sha256sums="70490e12ed9c5c818ecd85d185d363335cc8a8cbf7212e3c185431c79ff8c05c psycopg2-2.6.2.tar.gz" sha512sums="614314b5ab7ab5fa7c5e9c4f861579f90bd73521a9964dcb5a0938f77a9d6dfbea689cef35ad399cda698a45bb736c315912cb5dca85a52132f011d79f4863ac psycopg2-2.6.2.tar.gz"