# $Id: Portfile 84963 2011-10-05 22:37:13Z jmr@macports.org $

PortSystem            1.0
PortGroup             perl5 1.0

perl5.setup           DBD-mysql 4.020
license               {Artistic-1 GPL}
maintainers           nomaintainer
description           Perl5 Database Interface to the MySQL database
long_description      ${description}

platforms             darwin

checksums             rmd160  84707487c20985808e3f9ce35fce26e1ec0777bb \
                      sha256  9299f39f3903d3e0afa6440401f88329a057834817684aa699a507dad6a993e7

if {${perl5.major} != ""} {
depends_lib-append    port:p${perl5.major}-dbi

variant mysql4 conflicts mysql5 description {build with mysql4 port} {
    depends_lib-append       port:mysql4
}

variant mysql5 conflicts mysql4 description {build with mysql5 port} {
    depends_lib-append       path:bin/mysql_config5:mysql5
    configure.args-append    --mysql_config=${prefix}/bin/mysql_config5
}

if {![variant_isset mysql4]} {
    default_variants         +mysql5
}

pre-fetch {
    if {![variant_isset mysql4] && ![variant_isset mysql5]} {
        return -code error "you must select either mysql4 or mysql5"
    }
}
}
