# -*- 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 101343 2013-01-09 02:35:31Z blair@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-pylint
if {$subport != "py24-pylint"} {
    version         0.26.0
    revision        1
} else {
    version         0.21.1
    revision        3
}
categories-append   devel

maintainers         blair dh openmaintainer stromnov

description         Error (and style) checking for python
long_description \
    Pylint is a tool that checks for errors in python code, and tries to \
    check that a given coding standard is respected by the coders. This is \
    similar but nevertheless different from what pychecker_ provides, \
    especially since pychecker explicitely does not bother with coding \
    style. The default coding style used by pylint is close to `Guido's \
    style guide`_.

license             GPL-2+

platforms           darwin

homepage            http://www.logilab.org/project/pylint
master_sites        http://ftp.logilab.org/pub/pylint/
distname            pylint-${version}

if {$subport != "py24-pylint"} {
    checksums       md5     8e320a0f162fb7685b15e3d90fff501a \
                    sha1    5dcc07d622b4ff7d5751523fe0161989e463ffe6 \
                    rmd160  9b94f28f2d72d6ddbf26b7a00478f5235d4a0210
} else {
    checksums       md5     70f82198cde208b9118e81a43f3c7d80 \
                    sha1    e71ba47c1a54839a44f618d7cce5bd716b1a4987 \
                    rmd160  04ec7d4c9b89dd9ff8f41bc453e20c5648b374ea
}

python.versions 24 25 26 27

if {$subport != $name} {
    depends_lib     port:py${python.version}-logilab-common \
                    port:py${python.version}-logilab-astng
    depends_run     port:pylint_select

    if {$subport != "py24-pylint"} {
        depends_lib-append  port:py${python.version}-unittest2
    }

    post-destroot {
        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
        eval xinstall -m 644 [glob ${worksrcpath}/doc/*] \
            ${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
    }

    select.group    pylint
    select.file     ${filespath}/pylint${python.version}

    notes "
To make the Python ${python.branch} version of pylint the one that is run\
when you execute the commands without a version suffix, e.g. 'pylint', run:

port select --set ${select.group} [file tail ${select.file}]
"
} else {
    livecheck.url   http://ftp.logilab.org/pub/pylint/
    livecheck.type  regex
    livecheck.regex {pylint-(\d+(?:\.\d+)*)\.tar\.gz}
}
