# -*- 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 115000 2013-12-21 07:14:05Z ryandesign@macports.org $

PortSystem                      1.0
PortGroup                       php5extension 1.0

php5extension.setup             postgresql 5.3.28 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  e4910c0c365f39a5009807801bd5ee6e25be020d \
                                sha256  0cac960c651c4fbb3d21cf2f2b279a06e21948fb35a0d1439b97296cac1d8513

use_parallel_build              yes

variant postgresql82 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 description {Use PostgreSQL 8.2 libraries} {
    depends_lib-append          port:postgresql82

    configure.args-append       --with-pgsql=${prefix}/lib/postgresql82/bin \
                                --with-pdo-pgsql=${prefix}/lib/postgresql82/bin
}

variant postgresql83 conflicts postgresql82 postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 description {Use PostgreSQL 8.3 libraries} {
    depends_lib-append          port:postgresql83

    configure.args-append       --with-pgsql=${prefix}/lib/postgresql83/bin \
                                --with-pdo-pgsql=${prefix}/lib/postgresql83/bin
}

variant postgresql84 conflicts postgresql82 postgresql83 postgresql90 postgresql91 postgresql92 postgresql93 description {Use PostgreSQL 8.4 libraries} {
    depends_lib-append          port:postgresql84

    configure.args-append       --with-pgsql=${prefix}/lib/postgresql84/bin \
                                --with-pdo-pgsql=${prefix}/lib/postgresql84/bin
}

variant postgresql90 conflicts postgresql82 postgresql83 postgresql84 postgresql91 postgresql92 postgresql93 description {Use PostgreSQL 9.0 libraries} {
    depends_lib-append          port:postgresql90

    configure.args-append       --with-pgsql=${prefix}/lib/postgresql90/bin \
                                --with-pdo-pgsql=${prefix}/lib/postgresql90/bin
}

variant postgresql91 conflicts postgresql82 postgresql83 postgresql84 postgresql90 postgresql92 postgresql93 description {Use PostgreSQL 9.1 libraries} {
    depends_lib-append          port:postgresql91

    configure.args-append       --with-pgsql=${prefix}/lib/postgresql91/bin \
                                --with-pdo-pgsql=${prefix}/lib/postgresql91/bin
}

variant postgresql92 conflicts postgresql82 postgresql83 postgresql84 postgresql90 postgresql91 postgresql93 description {Use PostgreSQL 9.2 libraries} {
    depends_lib-append          port:postgresql92

    configure.args-append       --with-pgsql=${prefix}/lib/postgresql92/bin \
                                --with-pdo-pgsql=${prefix}/lib/postgresql92/bin
}

variant postgresql93 conflicts postgresql82 postgresql83 postgresql84 postgresql90 postgresql91 postgresql92 description {Use PostgreSQL 9.3 libraries} {
    depends_lib-append          port:postgresql93

    configure.args-append       --with-pgsql=${prefix}/lib/postgresql93/bin \
                                --with-pdo-pgsql=${prefix}/lib/postgresql93/bin
}

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