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

PortSystem          1.0

name                lucene-gosen4
version             4.6.0
categories          java textproc japanese
platforms           any
maintainers         nomaintainer
license             LGPL-2.1

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

dist_subdir         lucene-gosen
distname            lucene-gosen-${version}

master_sites        googlecode:lucene-gosen
distfiles           ${distname}-ipadic.jar
checksums           rmd160  5fde027bdba160bed251e85c7131a88efbbeab96 \
                    sha256  0c5801ae7a47b1d50700ba4f7e1efb6b1afa3710c24149af94844e497bccb5cd

variant naist description {Use naist chasen dictionary instead of ipadic} {
    distfiles       ${distname}-naist-chasen.jar
    checksums       rmd160  52f8a9a3edf6247e3b581f0b5d5ea1fe932775f7 \
                    sha256  6478117cfdc1aecde6ea7683ee75191fb375b36db24f1811aed654ee8500ed25
}

extract.only

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
}

# The latest distribution (>= 4.6.1) is stored in Google Drive and could not be downloaded by MacPorts.
livecheck.type      none
livecheck.name      lucene-gosen
