# -*- 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 116977 2014-02-11 19:37:10Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0

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

python.versions     24 25 26 27 32 33 34

maintainers         dh stromnov openmaintainer

description         A number of modules used by various projects from Logilab
long_description    ${description}

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

distname            logilab-common-${version}

checksums           rmd160  224a8963df48028041aa8750de8dc978d619b772 \
                    sha256  0d92e78deeaa16bf23cd94d8b3ea41522d0a110db16657fbe22a52b959d65725

if {${subport} eq "py24-logilab-common"} {
    epoch               1
    version             0.50.3
    revision            0
    distname            logilab-common-${version}
    checksums           rmd160  33ff2aa0216fcf717bf2e1b1063a6345bd98b51d \
                        sha256  e08f26783622c3c8b19250c7030e7124ff7c4313881bae692972ca55bdd7a07b
}

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

    # Extracted files do not have correct 'group' and 'other' permissions.
    post-extract {
        system "find ${worksrcpath} -type d -print0 | xargs -0 chmod a+rx"
        system "find ${worksrcpath} -type f -print0 | xargs -0 chmod 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}
    }

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