# -*- 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 113837 2013-11-24 16:27:14Z hum@macports.org $

PortSystem          1.0

name                unidic-mecab
version             2.1.2
categories          textproc japanese
maintainers         hum openmaintainer

description         a dictionary for the Japanese morphological analyzer MeCab
long_description    ${name} is ${description}.

homepage            http://sourceforge.jp/projects/unidic/
platforms           darwin
license             {BSD GPL LGPL}

distname            ${name}-${version}_bin
dist_subdir         mecab
#use_zip             yes
extract.suffix      .zip

master_sites        sourceforge_jp:unidic/58338/
checksums           rmd160  93dbf8230a9d90663028dc140c58b866bf5990ee \
                    sha256  666b549b56f47e5cf4cabe3ad9eced25a31df2f0b6e99ef73c54b5c2ce623354

# skip decompressing error of unzip.
extract {
    catch {eval exec "unzip -q ${distpath}/${distfiles} -d ${workpath}"} result
    ui_debug "unzip: $result"
}

supported_archs     noarch
use_configure       no
build {}

destroot {
    set dic_dir ${prefix}/lib/mecab/dic
    xinstall -d ${destroot}${dic_dir}
    copy ${worksrcpath} ${destroot}${dic_dir}/unidic-utf8
}

livecheck.type      regex
livecheck.url       http://sourceforge.jp/projects/unidic/releases/
livecheck.regex     ${name}-(\\d+\.\\d+\.\\d+)
