# $Id: Portfile 67948 2010-05-22 16:47:30Z jmr@macports.org $

PortSystem 1.0
PortGroup python26 1.0

name                py26-oursql
version             0.9.1
categories          python devel databases
maintainers         gmail.com:habnabit
description         Python driver for MySQL
long_description    oursql is a set of MySQL bindings for python with a focus \
                    on wrapping the MYSQL_STMT API to provide real \
                    parameterization and real server-side cursors.
platforms           darwin
homepage            https://launchpad.net/oursql
master_sites        http://launchpad.net/oursql/trunk/${version}/+download/
distname            oursql-${version}
use_bzip2           yes
checksums           md5 bb29062fd27b8e1ab5c91aa470276a52 \
                    sha1 98b742a5de84d53579973fe4b2ab2cbe6a3ad23d

variant mysql4 conflicts mysql5 description {Build with MySQL 4} {
    depends_lib-append  port:mysql4
    build.env           MYSQL_CONFIG=mysql_config4
}

variant mysql5 conflicts mysql4 description {Build with MySQL 5} {
    depends_lib-append  path:bin/mysql_config5:mysql5
    build.env           MYSQL_CONFIG=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"
    }
}
