# $Id: Portfile 114324 2013-12-05 08:44:51Z ryandesign@macports.org $

PortSystem              1.0
PortGroup               python 1.0

name                    py-enchant
version                 1.6.5
categories-append       textproc
license                 LGPL-2.1+
platforms               darwin
supported_archs         noarch
maintainers             nomaintainer
homepage                http://pythonhosted.org/pyenchant/
description             A python interface to the enchant spell-checking library.
long_description        PyEnchant is a spellchecking library for Python, based \
                        on the excellent Enchant library.

master_sites            http://pypi.python.org/packages/source/p/pyenchant/
distname                pyenchant-${version}
checksums               md5     565014a14a52fb0195d152dd492ea948 \
                        sha1    6f01b8657b64e970a11945c2a9b4d6d8023997bc \
                        rmd160  4e94bb26134f6d60b114cf40b3170dbf5fcb6e85

python.versions         26 27 31 32 33

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

    patchfiles              patch-enchant-_enchant.py.diff

    post-patch {
        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/enchant/_enchant.py
    }
    livecheck.type          none
} else {
    livecheck.type          regex
    livecheck.url           ${homepage}
    livecheck.regex         Version (\\d+\\.\\d+\\.\\d+) released
}
