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

PortSystem          1.0

name                tcptrace
version             6.6.7
revision            1
categories          net
platforms           darwin
license             GPL

maintainers         nomaintainer

description         A TCP dump file analysis tool

long_description \
    tcptrace a TCP dump file analysis tool written by Shawn Ostermann at \
    Ohio University. It is NOT a packet capture program. It reads output \
    dump files in the formats of several popular packet capturing \
    programs: tcpdump, snoop, etherpeek, and netm.  It can also output \
    (ie, convert thus converting to) tcpdump format files.

homepage            http://tcptrace.org
master_sites        http://tcptrace.org/download.html

checksums           rmd160  1dd0f373f766322343ffad59d0655eba4c6682e0 \
                    sha256  63380a4051933ca08979476a9dfc6f959308bc9f60d45255202e388eb56910bd

depends_lib         lib:libpcap:libpcap

post-configure {
    set path "${worksrcpath}"
    reinplace "s|PCAP_INCS    = -I/usr/local/include -I. -I../pcap -I/usr/include/pcap|PCAP_INCS    = -I${prefix}/include|" "${path}/Makefile"
    reinplace "s|PCAP_LDFLAGS = -L/usr/local/lib -Llib -Lpcap -L../pcap -L./cygwin-libs|PCAP_LDFLAGS = -L${prefix}/lib|" "${path}/Makefile"
}

destroot {
    file mkdir ${destroot}${prefix}/bin
    foreach f {tcptrace xpl2gpl} {
        xinstall -m 755 ${worksrcpath}/$f ${destroot}${prefix}/bin/
    }
    file mkdir ${destroot}${prefix}/share/man/man1
    xinstall -m 444 ${worksrcpath}/tcptrace.man ${destroot}${prefix}/share/man/man1/tcptrace.1
    file mkdir ${destroot}${prefix}/share/doc/tcptrace
    foreach f {ARGS COPYING COPYRIGHT README README.mailing_list
        README.modules README.pcap README.tline_graphs
        README.tput_graphs README.version README.xpl2gpl
        THANKS WWW} {
        xinstall -m 444 ${worksrcpath}/$f ${destroot}${prefix}/share/doc/tcptrace/
    }
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     {tcptrace-(\d+(?:\.\d+)*)\.[tz]}