# -*- 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 119350 2014-04-23 11:29:13Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-pylint
version             1.2.0
revision            0
categories-append   devel
platforms           darwin
license             GPL-2+
supported_archs     noarch

python.versions     24 25 26 27 32 33 34

maintainers         blair dh stromnov openmaintainer

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`_.

homepage            http://www.logilab.org/project/pylint
master_sites        http://ftp.logilab.org/pub/pylint/

distname            pylint-${version}

checksums           rmd160  72908b055c778c4f3eb62d471932ea776d390780 \
                    sha256  e66102a0550d7b1f8905d88ae11e93431822ef85662db4e1567eeda489bc39bc

if {${subport} eq "py24-pylint"} {
    version             0.21.1
    revision            3
    distname            pylint-${version}
    checksums           rmd160  04ec7d4c9b89dd9ff8f41bc453e20c5648b374ea \
                        sha256  958acb89be51bf1e093c1e83080ef22bea8f01f30499af71c7444fd4a5e90c71
}

if {${subport} eq "py25-pylint"} {
    version             0.28.0
    revision            3
    distname            pylint-${version}
    checksums           rmd160  b806658fb7338138a73a778511a65ac1fbe9deed \
                        sha256  ea6c3fdc416b359a31d84c6e34dbe29730ec6c21e6316e982f38d0fb9186e780
}

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

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

    if {${subport} eq "py24-pylint" || ${subport} eq "py25-pylint"} {
        depends_lib-delete  port:py${python.version}-astroid
        depends_lib-append  port:py${python.version}-logilab-astng
    }

    depends_run-append  port:pylint_select

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

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