# -*- 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

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

description     Toolbox with several features to test an Ethernet/IP network.
long_description \
                Netwox is a toolbox containing 197 tools implemented from \
                the Network Library netwib. They help to find and solve \
                network problems with common techniques such as sniffing and \
                spoffing, analazing DNS, FTP, HTTP, IRC, NNTP, SMTP, SNMP, \
                SYSLOG, TELNET and TFTP traffic, scans, ping and traceroute, \
                client/servers implementations, etc.

homepage        http://www.laurentconstantin.com/
master_sites    sourceforge:project/ntwox/${name}%20only/[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  3af3238f37e30c9b518a66e31a0f7931947d6ed9 \
                sha256  35eaabac4d11d6a2fa7001bd9c153e053e6080c5f5b66c37e463ad32e909fbfd \
                size    771942 \
                ${distname}-doc_html${extract.suffix} \
                rmd160  eebc36ab51bfc95a0768428f979dc5f0b4bbdb35 \
                sha256  430c5c53852005c8ab4012564b70bc78dceece573567b8babb9b09efd21365f3 \
                size    146301

depends_lib     path:lib/libnetwib${NetWVers}.a:netwib

worksrcdir      ${distname}-src/src

pre-configure {
    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/config.dat
    reinplace "s|\\(NETWOXDEF_PROGCC_INC=\\)\"\"|\\1-I${prefix}/include|g" ${worksrcpath}/config.dat
    reinplace "s|\\(NETWOXDEF_PROGCC_LIB=\\)\"\"|\\1-L${prefix}/lib|g" ${worksrcpath}/config.dat
    reinplace "s|man|share/man|g" ${worksrcpath}/config.dat
    reinplace "s|share/man1|man1|g"    ${worksrcpath}/config.dat
}

configure.pre_args
configure.cmd   ./genemake

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 \
    guidestyle.txt todo.txt toollist.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"
}
