# -*- 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 91075 2012-03-23 15:00:56Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-sqlalchemy
version             0.7.6
revision            0
categories-append   databases
license             MIT
platforms           darwin

maintainers         landonf akitada openmaintainer

description         Python SQL ORM

long_description    SQLAlchemy is the Python SQL toolkit and Object \
                    Relational Mapper that gives application developers \
                    the full power and flexibility of SQL.

homepage            http://www.sqlalchemy.org/
master_sites        sourceforge:sqlalchemy

distname            SQLAlchemy-${version}

checksums           rmd160  4ef76d714f4dad5d315a4b73cfb191bdab77e01d \
                    sha256  a79098c2019095ecc8eef5a035117760023fc92f36f8e23f54d2b1953f0d0357

python.versions     24 25 26 27

if {$subport != $name} {
    depends_build-append    port:py${python.version}-distribute

    post-destroot {
        # Install example files not installed by the Makefile
        if {$subport == "py24-sqlalchemy" || $subport == "py25-sqlalchemy"} {
            xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}/examples
            foreach f [glob -directory ${worksrcpath}/doc *] {
                copy $f ${destroot}${prefix}/share/doc/${subport}/[file tail $f]
            }
            foreach f [glob -directory ${worksrcpath}/examples *] {
                copy $f ${destroot}${prefix}/share/doc/${subport}/examples/[file tail $f]
            }
        } elseif {$subport == "py26-sqlalchemy" || $subport == "py27-sqlalchemy"} {
            xinstall -m 755 -d ${destroot}${python.prefix}/share/doc/sqlalchemy/examples
            foreach f [glob -directory ${worksrcpath}/doc *] {
                copy $f ${destroot}${python.prefix}/share/doc/sqlalchemy/[file tail $f]
            }
            foreach f [glob -directory ${worksrcpath}/examples *] {
                copy $f ${destroot}${python.prefix}/share/doc/sqlalchemy/examples/[file tail $f]
            }
        }
    }
}

livecheck.regex     {<a href="/download\.html"><b>(.+?)</b></a>}
livecheck.type      regex
livecheck.url       ${homepage}
