# -*- 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 91571 2012-04-05 15:51:36Z hum@macports.org $

PortSystem          1.0

name                lucene-gosen
version             2.0.0
categories          java textproc japanese
platforms           darwin
maintainers         hum openmaintainer
license             LGPL-2.1

homepage            http://code.google.com/p/lucene-gosen/
description         a Japanese morphological analyzer for Apache Lucene/Solr
long_description    ${name} is ${description}.

master_sites        googlecode
distfiles           ${distname}-ipadic.jar
checksums           rmd160  11951fa3c9fa57c921001bc5bd9a5cda88df56aa \
                    sha256  14de7e3e31b368a48fa982a273cf7091990eb68e1e191239e67918b53ccdce87

variant naist description {Use naist chasen dictionary instead of ipadic} {
    distfiles       ${distname}-naist-chasen.jar
    checksums       rmd160  b057b79cb1edcdb23ad811201afb66f93991760b \
                    sha256  2004f9093fd47e23f92dfb14d5ad5a98cd4e5bc55c641863f590c522c19c900f
}

extract {}

use_configure       no
supported_archs     noarch

build {}

destroot {
    set gosendir ${destroot}${prefix}/share/java/${name}
    # install the jar file.
    xinstall -d ${gosendir}/lib
    copy ${distpath}/${distfiles} ${gosendir}/lib
    # install the config files.
    xinstall -d ${gosendir}/conf
    xinstall -m 644 -W ${filespath} \
        mapping-japanese.txt \
        stoptags_ja.txt \
        stopwords_ja.txt \
        ${gosendir}/conf
}
