# $Id: Portfile,v 1.9 2004/07/30 18:39:36 mww Exp $

PortSystem 1.0

name		py-psycopg
version		1.1.15
categories	python databases
maintainers	mww@opendarwin.org
platforms	darwin freebsd
description	a python DBAPI-2.0 ompliant database adapter for postgresql
long_description	psycopg is a postgresql database adapter for python. \
			It's fully compliant to pythons DBAPI-2.0. psycopg is \
			designed for heavily multi-threaded applications \
			featuring connection pooling.

homepage	http://www.initd.org/software/initd/psycopg/
master_sites	http://initd.org/pub/software/psycopg/
distname	psycopg-${version}
checksums	md5 b7de1df2ba2d0172b5b5f18cc379c3f5

#depends on postgresql +devel variant!
depends_lib	lib:libpq:postgresql \
		lib:XXX:py-mx \
		lib:XXX:python23

configure.env	LDFLAGS="-L${prefix}/lib" \
		CPPFLAGS="-I${prefix}/lib/python2.3/site-packages/mx/DateTime/mxDateTime/"
configure.args	--with-postgres-includes=${prefix}/include/ \
		--with-python=${prefix}/bin/python2.3

post-configure {
	reinplace "s|PY_LIB_DIR = \$(prefix)|\
		PY_LIB_DIR = ${destroot}${prefix}|g" ${worksrcpath}/Makefile
	reinplace "s|PY_MOD_DIR = \$(exec_prefix)|\
		PY_MOD_DIR = ${destroot}${prefix}|g" ${worksrcpath}/Makefile
	reinplace "s|@echo 'Installing shared modules...'|\
		install -m 755 -d \$(PY_MOD_DIR)|g" ${worksrcpath}/Makefile
}

build.target

post-destroot	{
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples
	xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING RELEASE-1.0 CREDITS \
		SUCCESS ChangeLog VERSION NEWS README FAQ INSTALL TODO \
		doc/python-taylor.txt ${destroot}${prefix}/share/doc/${name}
	xinstall -m 644 -W ${worksrcpath}/doc/examples binary.py bool.py \
		commit.py copy_from.py copy_from2.py copy_to.py dictfetch.py \
		dt.py first.py integrity.py notify.py oid.py somehackers.jpg \
		threads.py usercast.py whereareyou.jpg work.py \
		${destroot}${prefix}/share/doc/${name}/examples
}
