# -*- 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
PortGroup       app 1.1

name            netwag
version         5.39.0
set NetWVers    [join [lrange [split ${version} .] 0 1] ""]
categories      net
license         GPL-2
platforms       any
supported_archs noarch
maintainers     {i0ntempest @i0ntempest} openmaintainer

description     Graphical front end for the netwox toolkbox.
long_description \
                Netwag is a TCL/TK based graphical frontend for the netwox \
                network toolbox, based on the netwib library. It allows one to \
                easily search amongst tools proposed in netwox and run them, \
                construct command line instructions, keep a history of \
                commands, etc.

homepage        http://www.laurentconstantin.com/
master_sites    sourceforge:project/ntwag/${name}/[join [lrange [split ${version} .] 0 1] .]/
extract.suffix  .tgz
distfiles       ${distname}-src${extract.suffix} \
                ${distname}-doc_html${extract.suffix}

checksums       ${distname}-src${extract.suffix} \
                rmd160  d8d0b95891a9f27ed1860f92c705d94519c2bceb \
                sha256  e625c840797dc3568ede90dafdee6a0b63775d77c291d418cd9a2e7242e35a57 \
                size    164731 \
                ${distname}-doc_html${extract.suffix} \
                rmd160  68991f5826bbd6d710d62fc15ef895cb939e6921 \
                sha256  5dfc818ac1a66274ace0524eddf5fce2b617cad3652e16e619e6fb541d6565c5 \
                size    46461

depends_build   port:xterm
depends_lib     port:tk \
                path:bin/netwox${NetWVers}:netwox

worksrcdir      ${distname}-src/src

post-patch {
        reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/config.dat
        reinplace "s|/man|/share/man|g" ${worksrcpath}/config.dat
}

configure.pre_args
configure.cmd   ./genemake

app.name        Netwag
app.executable  ${prefix}/bin/netwag${NetWVers}
app.icon        ${workpath}/${distname}-src/misc/windows/ico/ico_netw.ico

post-destroot {
        xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
        file copy ${workpath}/${distname}-doc_html ${destroot}${prefix}/share/doc/${name}/html
        xinstall -m 644 -v -W ${worksrcpath}/../doc/ changelog.txt credits.txt \
        todo.txt ${destroot}${prefix}/share/doc/${name}/
}

post-activate {
        ui_msg "\nFull html documentation is installed as part of the port at:\n
        ${prefix}/share/doc/${name}/html/\n"
}
