# $Id: Portfile 45116 2009-01-08 15:08:51Z narf_tm@macports.org $

PortSystem            1.0
PortGroup             perl5 1.0

perl5.setup           DBD-Pg 2.11.8
categories            perl databases
maintainers           narf_tm openmaintainer
description           Perl DBI module to provide access to PostgreSQL databases
long_description      DBD::Pg is a Perl module which works with the DBI \
                      module to provide access to PostgreSQL databases

platforms             darwin

checksums             md5 543e8caf0de78423adc9c9bb1c9a023b \
                      sha1 ebb901b6feccaf65432509c416f09ac8e0b2ba35 \
                      rmd160 951075722f1beb2a7f8a28bb6cd70ca76c645136

depends_lib-append    port:postgresql83 \
                      port:p5-dbi \
                      port:p5-version

configure.env         PATH=${prefix}/lib/postgresql83/bin:$env(PATH) \
                      POSTGRES_INCLUDE="${prefix}/include/postgresql83" \
                      POSTGRES_LIB="${prefix}/lib/postgresql83 -lssl"

variant postgresql7 conflicts postgresql80 postgresql81 postgresql82 description {build with postgresql7 port} {
    depends_lib-delete      port:postgresql83
    depends_lib-append      port:postgresql7

    configure.env-delete    PATH=${prefix}/lib/postgresql83/bin:$env(PATH) \
                            POSTGRES_INCLUDE="${prefix}/include/postgresql83" \
                            POSTGRES_LIB="${prefix}/lib/postgresql83 -lssl"

    configure.env-append    PATH=${prefix}/lib/pgsql7/bin:$env(PATH) \
                            POSTGRES_INCLUDE="${prefix}/include/pgsql7" \
                            POSTGRES_LIB="${prefix}/lib/pgsql7 -lssl"
}

variant postgresql80 conflicts postgresql7 postgresql81 postgresql82 description {build with postgresql80 port} {
    depends_lib-delete      port:postgresql83
    depends_lib-append      port:postgresql80

    configure.env-delete    PATH=${prefix}/lib/postgresql83/bin:$env(PATH) \
                            POSTGRES_INCLUDE="${prefix}/include/postgresql83" \
                            POSTGRES_LIB="${prefix}/lib/postgresql83 -lssl"

    configure.env-append    PATH=${prefix}/lib/pgsql8/bin:$env(PATH) \
                            POSTGRES_INCLUDE="${prefix}/include/pgsql8" \
                            POSTGRES_LIB="${prefix}/lib/pgsql8 -lssl"
}

variant postgresql81 conflicts postgresql7 postgresql80 postgresql82 description {build with postgresql81 port} {
    depends_lib-delete      port:postgresql83
    depends_lib-append      port:postgresql81

    configure.env-delete    PATH=${prefix}/lib/postgresql83/bin:$env(PATH) \
                            POSTGRES_INCLUDE="${prefix}/include/postgresql83" \
                            POSTGRES_LIB="${prefix}/lib/postgresql83 -lssl"

    configure.env-append    PATH=${prefix}/lib/postgresql81/bin:$env(PATH) \
                            POSTGRES_INCLUDE="${prefix}/include/postgresql81" \
                            POSTGRES_LIB="${prefix}/lib/postgresql81 -lssl"
}

variant postgresql82 conflicts postgresql7 postgresql80 postgresql81 description {build with postgresql82 port} {
    depends_lib-delete      port:postgresql83
    depends_lib-append      port:postgresql82

    configure.env-delete    PATH=${prefix}/lib/postgresql83/bin:$env(PATH) \
                            POSTGRES_INCLUDE="${prefix}/include/postgresql83" \
                            POSTGRES_LIB="${prefix}/lib/postgresql83 -lssl"

    configure.env-append    PATH=${prefix}/lib/postgresql82/bin:$env(PATH) \
                            POSTGRES_INCLUDE="${prefix}/include/postgresql82" \
                            POSTGRES_LIB="${prefix}/lib/postgresql82 -lssl"
}
