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

github.setup        MITRECND libnids 1.26
revision            0
categories          net
maintainers         nomaintainer
license             GPL-2
maintainers         nomaintainer
homepage            http://libnids.sourceforge.net
description         E-component of Network Intrusion Detection System
long_description \
    Libnids is an implementation of an E-component of Network \
    Intrusion Detection System. It emulates the IP stack of \
    Linux 2.0.x. Libnids offers IP defragmentation, TCP stream \
    assembly and TCP port scan detection.
checksums           rmd160  a788d174eff0af27e73958fbc4fb3af4b5ddd05d \
                    sha256  3f3e9f99a83cd37bc74af83d415c5e3a7505f5b190dfaf456b0849e0054f6733 \
                    size    146172
github.tarball_from archive

depends_lib         port:libnet \
                    port:libpcap

post-extract {
    # Copy "owner" permission to "group" and "others" but removing write.
    fs-traverse item ${worksrcpath} {
        set p [file attributes ${item} -permissions]
        set x [expr {${p} >> 6 & 5}]
        file attributes ${item} -permissions [format {0%o} [expr {${x} | (${x} << 3) | ${p}}]]
    }
}

patchfiles          implicit.patch \
                    inline.patch \
                    LDFLAGS.patch

platform darwin {
    patchfiles-append \
                    dylib.patch
}

configure.args      --disable-libglib \
                    --enable-shared \
                    --mandir=${prefix}/share/man

destroot.destdir install_prefix=${destroot}
