# $Id: Portfile 55041 2009-08-06 09:41:03Z ryandesign@macports.org $

PortSystem                      1.0
PortGroup                       php5extension 1.0

php5extension.setup             postgresql 5.3.0 bundled
php5extension.use_phpize        no
categories-append               databases
platforms                       darwin
maintainers                     ryandesign

description                     a PHP interface to PostgreSQL, including \
                                the pgsql and pdo_pgsql extensions

long_description                ${description}

checksums                       md5     846760cd655c98dfd86d6d97c3d964b0 \
                                sha1    934700941d216c453376e3bf24347041cf12c6dc \
                                rmd160  9a71b74052b0ca515f2ddf95c051b47a73d33f44

configure.args-append           --enable-pdo

use_parallel_build              yes

variant postgresql82 conflicts postgresql83 postgresql84 description {Use PostgreSQL 8.2 libraries} {
    depends_lib-append          port:postgresql82
    configure.args-append       --with-pgsql=shared,${prefix}/lib/postgresql82/bin \
                                --with-pdo-pgsql=shared,${prefix}/lib/postgresql82/bin
}

variant postgresql83 conflicts postgresql82 postgresql84 description {Use PostgreSQL 8.3 libraries} {
    depends_lib-append          port:postgresql83
    configure.args-append       --with-pgsql=shared,${prefix}/lib/postgresql83/bin \
                                --with-pdo-pgsql=shared,${prefix}/lib/postgresql83/bin
}

variant postgresql84 conflicts postgresql82 postgresql83 description {Use PostgreSQL 8.4 libraries (default)} {
    depends_lib-append          port:postgresql84
    configure.args-append       --with-pgsql=shared,${prefix}/lib/postgresql84/bin \
                                --with-pdo-pgsql=shared,${prefix}/lib/postgresql84/bin
}

if {![variant_isset postgresql82] && ![variant_isset postgresql83]} {
    default_variants +postgresql84
}
