# $Id: Portfile 88422 2012-01-02 01:18:04Z ryandesign@macports.org $

PortSystem 1.0
PortGroup python27 1.0

name			py27-pygresql
version			4.0
categories		python databases
platforms		darwin
maintainers		jwa openmaintainer
description		Python module that interfaces to a PostgreSQL database
long_description	PyGreSQL is an open-source Python module that \
    interfaces to a PostgreSQL database. It embeds the PostgreSQL query \
    library to allow easy use of the powerful PostgreSQL features from a \
    Python script.

homepage		http://www.pygresql.org/
master_sites		ftp://ftp.pygresql.org/pub/distrib/ freebsd
distname		PyGreSQL-${version}
extract.suffix		.tgz
checksums           md5     1aca50e59ff4cc56abe9452a9a49c5ff \
                    sha1    faeb31b6c8d62bf56cad00ff8fbeb7426623422b \
                    rmd160  633364ddaa01166db201754e005067d211591864

depends_lib-append	port:postgresql90

patch {
    reinplace "s|\"pg_config|\"${prefix}/lib/postgresql90/bin/pg_config|g" \
	${worksrcpath}/setup.py
}

post-destroot	{
    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
    foreach doc [glob ${worksrcpath}/docs/*] {
	xinstall -m 644 ${doc} ${destroot}${prefix}/share/doc/${name}
    }
    foreach doc [glob ${worksrcpath}/tutorial/*] {
	xinstall -m 644 ${doc} ${destroot}${prefix}/share/doc/${name}
    }
}

livecheck.type	regex
livecheck.url	${homepage}announce.html
livecheck.regex	PyGreSQL version (4\.\[0-9\.\]+)
