# -*- 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 101036 2013-01-03 13:33:27Z hum@macports.org $

PortSystem          1.0
PortGroup           github 1.0

github.setup        nullnull normalizeNumexp f3202c292cf05d6084c7aaa131bc150516a5e7fa
version             3.0.20121221

categories          textproc japanese
maintainers         hum openmaintainer

description         Numerical/Temporal expression normalizer
long_description    ${name} is a tool for normalizing numerical/temporal expression.

homepage            http://www.cl.ecei.tohoku.ac.jp/~katsuma/software/normalizeNumexp/
platforms           darwin
license             BSD

checksums           rmd160  663b1c582b27f345f80a42ea21aa9fa7d9d8b4ab \
                    sha256  7ee8270bcd0802b4de0c459332e50e95351a016da308268506934b89aed2f723

depends_build       port:pkgconfig

depends_lib         port:ux-trie port:pficommon

configure.cmd       ./waf configure
configure.universal_args

build.cmd           ./waf build
build.target

destroot.cmd        ./waf install
destroot.args       --destdir=${destroot}
destroot.destdir

post-destroot {
    # install additional documents.
    set docdir   ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        LICENSE README.rst history.txt \
        ${docdir}
    # fix install_name.
    set libpath  ${prefix}/lib/libnormalize_numexp.dylib
    set builddir ${worksrcpath}/build/src
    set bin      ${destroot}${prefix}/bin/normalizeNumexp
    regexp {(\S+\/libnormalize_numexp\S+dylib)} [exec otool -L ${bin}] path
    system "install_name_tool -id     ${libpath} ${destroot}${libpath}"
    system "install_name_tool -change ${path}    ${libpath} ${bin}"
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.version   [join [lrange [split ${version} .] 0 1] .]
livecheck.regex     "${name} (\[0-9.\]+)"
