# -*- 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 83942 2011-09-13 13:24:32Z takanori@macports.org $

PortSystem      1.0

name            nkf
version         2.1.2
categories      textproc japanese
maintainers     takanori openmaintainer
description     Network Kanji code conversion Filter
long_description \
                Nkf  is  a  yet  another kanji code converter among networks, hosts and \
                terminals.  It converts input kanji code to designated kanji code  such \
                as 7-bit JIS, MS-kanji (shifted-JIS), utf-8 or EUC.
platforms       darwin
license         zlib
homepage        http://sourceforge.jp/projects/nkf/
master_sites    sourceforge_jp:${name}/53171/
patchfiles      nkf.git-ecf2a983ff0945462d731afa9b4d7327cfeb9b5a.patch
checksums       rmd160  91c0d413a70299246591d314d33f45e71eba51a7

patch.pre_args  -p1

use_configure   no

variant universal {}
if {[variant_isset universal]} {
    set archflags ${configure.universal_cflags}
} else {
    set archflags ${configure.cc_archflags}
}

build.target
build.args      CC=${configure.cc} CFLAGS="${configure.cflags} ${archflags}"

test.run        yes

use_parallel_build  yes

destroot {
    xinstall -m 755 ${worksrcpath}/nkf ${destroot}${prefix}/bin
    xinstall -m 644 ${worksrcpath}/nkf.1 ${destroot}${prefix}/share/man/man1
}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 ${worksrcpath}/nkf.doc ${destroot}${prefix}/share/doc/${name}
}

livecheck.type  regex
livecheck.url   ${homepage}files/
livecheck.regex ${name}-(\[0-9.a-z\]+)\\.tar
