# -*- 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 89831 2012-02-12 03:25:35Z hum@macports.org $

PortSystem          1.0
PortGroup           ruby 1.0

ruby.setup          MeCab 0.993 extconf.rb {}
categories-append   textproc japanese
platforms           darwin
maintainers         gmail.com:rsky0711 hum openmaintainer
license             GPL-2 LGPL-2.1 BSD

description         a Ruby module for MeCab
long_description    ${description}

homepage            http://mecab.sourceforge.net/
master_sites        googlecode:mecab
checksums           rmd160  8596943da117daa67aaaec4fa262b644cf134806 \
                    sha256  ca84975e231fb75d437165fc1f71c5db9fa3458c20ab3ab9c43384bbcf7ef3d5

distname            mecab-ruby-${version}
dist_subdir         mecab

depends_lib-append  path:bin/mecab-config:mecab-utf8

post-patch {
    reinplace "s|\#!/usr/bin/ruby|\#!${ruby.bin}|g" \
        ${worksrcpath}/test.rb
}

post-destroot {
    set exdir ${destroot}${prefix}/share/doc/${name}/examples
    xinstall -m 755 -d ${exdir}
    xinstall -m 755 ${worksrcpath}/test.rb ${exdir}
}

livecheck.type      regex
livecheck.url       http://code.google.com/p/mecab/downloads/list
livecheck.regex     {mecab-ruby-([\d\.]+)\.tar}
