# -*- 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 114324 2013-12-05 08:44:51Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-logilab-astng
version             0.24.3
revision            0
categories-append   devel
platforms           darwin
license             LGPL-2.1+
supported_archs     noarch

python.versions     24 25 26 27 32 33

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

distname            logilab-astng-${version}

checksums           rmd160  a4b4d71222ce44ca7f3273d8c4da0adf645e9ac6 \
                    sha256  961f030b055751f48179341c14ff3b8646bb1b29bee539f708e028e8fbe5e45a

if {${subport} eq "py24-logilab-astng"} {
    epoch               1
    version             0.20.1
    revision            0
    distname            logilab-astng-${version}
    checksums           rmd160  add5f8d561617313762f79ddca9728ab8a11eed6 \
                        sha256  5483499402e227db5f3d232d6e109605d42a37995032fed43413939b378db31e
}

if {${name} ne ${subport}} {
    depends_build-append \
                        port:py${python.version}-setuptools

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

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

    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
    }

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       http://ftp.logilab.org/pub/astng/
    livecheck.regex     {logilab-astng-(\d+(?:\.\d+)*)\.[tz]}
}
