# -*- 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 107369 2013-06-26 12:25:25Z hum@macports.org $

PortSystem          1.0

name                lucene-gosen4
version             4.3.1
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 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  cd596b8c656dc5145e65984319abe68b2013392c \
                    sha256  1a4f997eb4165dd4528670e5be6c28cf5768c48b2667fe49c50781b1af282d1a

variant naist description {Use naist chasen dictionary instead of ipadic} {
    distfiles       ${distname}-naist-chasen.jar
    checksums       rmd160  0f8035ead70acac3b4c54ec1ff9eb0b7d5978b7e \
                    sha256  26ee444fcd0e2e26bc190ab9a2375795e13167e49af82c98b6cebb3ccd4f0054
}

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
}

livecheck.name      lucene-gosen
