# -*- 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 101084 2013-01-04 05:43:15Z blair@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-logilab-astng
if {$subport != "py24-logilab-astng"} {
    version         0.24.1
} else {
    epoch           1
    version         0.20.1
}
platforms           darwin

maintainers         dh openmaintainer stromnov

description         Python Abstract Syntax Tree New Generation

long_description    The aim of this module is to provide a common \
                    base representation of python source code for \
                    projects such as pychecker, pyreverse, pylint... \
                    Well, actually the development of this library is \
                    essentially governed by pylint's needs.

homepage            http://www.logilab.org/project/logilab-astng
master_sites        http://ftp.logilab.org/pub/astng \
                    ftp://ftp.logilab.fr/pub/astng

license             LGPL-2.1+

distname            logilab-astng-${version}

if {$subport != "py24-logilab-astng"} {
    checksums       md5     b9c80fe2da8c7bfcd684de1cd041ce6e \
                    sha1    067922aed15f3d3025c04e6532c65c420ed86497 \
                    rmd160  9e7500ffc4a6766aa7ce23bb384cf271ddde7903
} else {
    checksums       md5     bd9612c3d6225346050347ac13b0e4c6 \
                    sha1    ac4a7fc9c098393fd207eb2165b470b25ecb6f55 \
                    rmd160  add5f8d561617313762f79ddca9728ab8a11eed6
}

python.versions 24 25 26 27

if {$subport != $name} {
    # Fix files not being world-readable.
    post-extract {
        foreach f [exec find ${workpath}] {
        file attributes $f -permissions a+r
        }
    }

    depends_lib-append  port:py${python.version}-logilab-common

    post-destroot {
        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
        xinstall -m 644 -W ${worksrcpath} ChangeLog README \
            ${destroot}${prefix}/share/doc/${subport}
        file delete ${destroot}${python.pkgd}/logilab/__init__.py
    }
} else {
    livecheck.url   http://ftp.logilab.org/pub/astng/
    livecheck.type  regex
    livecheck.regex {logilab-astng-(\d+(?:\.\d+)*)\.tar\.gz}
}
