# -*- 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$

PortSystem          1.0

name                cabocha
version             0.68
categories          textproc japanese
maintainers         hum openmaintainer

description         Yet Another Japanese Dependency Structure Analyzer

long_description    CaboCha is a Japanese dependency structure analyzer based on \
                    support vector machines. \
                    This version of CaboCha supports the UTF-8 encoding.

homepage            http://code.google.com/p/cabocha/
platforms           darwin
license             {BSD Permissive}

master_sites        googlecode
checksums           rmd160  fcc19083d24760a4755aed07b3fff9990fdb50d4 \
                    sha256  3ac152dda7bdea7371e6dfac6958566503a9ee4818ddbd0c76d7706de7826b8c

use_bzip2           yes

depends_lib         port:crfpp \
                    port:libiconv \
                    port:mecab-base \
                    port:mecab-utf8

patchfiles          patch-configure.diff
 
configure.args      --with-charset=UTF8

variant juman conflicts unidic description {Set the default posset to JUMAN} {
    configure.args-append  --with-posset=JUMAN
}

variant unidic conflicts juman description {Set the default posset to UniDic} {
    configure.args-append  --with-posset=UNIDIC
}

test.run            yes
test.target         check

post-destroot {
    # install additional documents.
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS COPYING ChangeLog TODO \
        ${destroot}${docdir}
    xinstall -m 644 ${worksrcpath}/doc/README.txt ${destroot}${docdir}
    # install extra tools.
    set shdir ${prefix}/share/${name}
    xinstall -d ${destroot}${shdir}
    copy ${worksrcpath}/tools ${destroot}${shdir}
}