# -*- 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 90953 2012-03-19 15:23:53Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-levenshtein
version             0.10.2
revision            0
categories-append   textproc
license             GPL
platforms           darwin freebsd

maintainers         nomaintainer

description         Python module for fast computation of Levensthein distances.

long_description    The Levenshtein Python C extension module contains \
                    functions for fast computation of Levenshtein (edit) \
                    distance, and edit operations, string similarity, \
                    approximate median strings, and generally string \
                    averaging, string sequence and set similarity. It \
                    supports both normal and Unicode strings.

homepage            http://github.com/miohtama/python-Levenshtein
master_sites        http://pypi.python.org/packages/source/p/python-Levenshtein

distname            python-Levenshtein-${version}

checksums           rmd160  a08ebd7edc92cfb34ea822cbb6d87f4cd23b8581 \
                    sha256  49a3b3c3210157e2070eb46c0713e64f409efc8c9a7520632ddf16f8a9508bed

python.versions     24 25 26 27

if {$subport != $name} {
    depends_lib     port:py${python.version}-distribute

    post-destroot {
        set realname levenshtein
        if {$subport == "py24-${realname}" || $subport == "py25-${realname}"} {
            xinstall -d ${destroot}${prefix}/share/doc/${subport}/examples
            xinstall -m 644 -W ${worksrcpath} COPYING NEWS README.rst \
                ${destroot}${prefix}/share/doc/${subport}
            xinstall -m 644 ${worksrcpath}/StringMatcher.py \
                ${destroot}${prefix}/share/doc/${subport}/examples
        } else {
            xinstall -d ${destroot}${python.prefix}/share/doc/${realname}/examples
            xinstall -m 644 -W ${worksrcpath} COPYING NEWS README.rst \
                ${destroot}${python.prefix}/share/doc/${realname}
            xinstall -m 644 ${worksrcpath}/StringMatcher.py \
                ${destroot}${python.prefix}/share/doc/${realname}/examples
        }
    }
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "python-Levenshtein-(\\d+(?:\\.\\d+)*)${extract.suffix}"
