# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 92843 2012-05-09 04:04:01Z ryandesign@macports.org $

PortSystem                      1.0
PortGroup                       php5extension 1.0
PortGroup                       archcheck 1.0

php5extension.setup             postgresql 5.3.12 bundled
php5extension.ini               postgresql.ini
php5extension.extensions        pgsql pdo_pgsql
categories-append               databases
platforms                       darwin
maintainers                     ryandesign
license				PHP-3.01
homepage                        http://www.php.net/pgsql

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

long_description                ${description}

checksums                       rmd160  5d91c2d16b54632aa123677f63776b312872997c \
                                sha256  91659fd645b03011e1620134fa2457fade1e502499111cef8c4e23f428ad16ac

use_parallel_build              yes

variant postgresql82 conflicts postgresql83 postgresql84 postgresql90 postgresql91 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 postgresql90 postgresql91 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 postgresql90 postgresql91 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
}

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

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

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