# -*- 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 116962 2014-02-11 11:45:30Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-readline
version             6.2.4.1
platforms           darwin
license             GPL-3+ PSF

python.versions     24 25 26 27 31 32 33 34

maintainers         nomaintainer

description         GNU readline extension for Python
long_description    ${description}

homepage            http://github.com/ludwigschwardt/python-readline
master_sites        http://pypi.python.org/packages/source/r/readline/

distname            readline-${version}

checksums           rmd160  932c96cce3475344e4f5d7defc162d21f0acc79e \
                    sha256  e00f86e03dfe52e7d1502cec5c64070b32621c85509c0081a4cfa6a0294bd107

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

    patchfiles          build.sh.patch \
                        setup.py.patch

    post-destroot {
        copy -force ${filespath}/readline.pth ${filespath}/readline_path.py \
            ${destroot}${python.pkgd}
        reinplace "s|__LIBDIR__|${python.libdir}|" ${destroot}${python.pkgd}/readline_path.py
    }

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${master_sites}
    livecheck.regex     {readline-(\d+(?:\.\d+)*)\.[tz]}
}
