# $Id: Portfile 64458 2010-03-06 17:54:57Z ryandesign@macports.org $

PortSystem                      1.0
PortGroup                       php5extension 1.0
PortGroup                       archcheck 1.0

php5extension.setup             postgresql 5.3.2 bundled
php5extension.ini               postgresql.ini
php5extension.extensions        pgsql pdo_pgsql
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     46f500816125202c48a458d0133254a4 \
                                sha1    79ea4ee3da3a7542d1e348ac963a5b38bcbb4b6b \
                                rmd160  60a8aac0d51511ecaf8dcad9d31bdf072c0c99cf

use_parallel_build              yes

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

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

variant postgresql84 conflicts postgresql82 postgresql83 description {Use PostgreSQL 8.4 libraries} {
    depends_lib-append          port:postgresql84
    archcheck.files-append      lib/postgresql84/libpq.dylib
    configure.args-append       --with-pgsql=${prefix}/lib/postgresql84/bin \
                                --with-pdo-pgsql=${prefix}/lib/postgresql84/bin
}

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