# -*- 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 103265 2013-02-19 15:25:57Z hum@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-mecab
version             0.996
python.versions     26 27
categories-append   textproc japanese
maintainers         hum gmail.com:rsky0711 openmaintainer

description         a Python module for MeCab
long_description    ${description}

master_sites        googlecode:mecab
checksums           rmd160  c46ee001b058fa84cff4694f25369dc5d46995a4 \
                    sha256  d305c30af9e781e70f7619a0b444ac1101f2faaf3922415a0d6c49da85a63511

homepage            http://mecab.sourceforge.net/
platforms           darwin
license             {GPL LGPL BSD}

distname            mecab-python-${version}
dist_subdir         mecab

if {${subport} != ${name}} {
    depends_lib-append  path:bin/mecab-config:mecab-utf8

    post-patch {
        reinplace "s|#!/usr/bin/python|#!${python.bin}|" \
            ${worksrcpath}/test.py
    }

    post-destroot {
        set exdir ${destroot}${prefix}/share/doc/${subport}/examples
        xinstall -m 755 -d ${exdir}
        xinstall -m 755 ${worksrcpath}/test.py ${exdir}
    }

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       http://code.google.com/p/mecab/downloads/list
    livecheck.regex     {mecab-python-([\d\.]+)\.tar}
}
