PortSystem              1.0

name                    py-libdnet
version                 1.12
categories              python net
license                 BSD
maintainers             nzbox.com:msavory consault.com:chris.owen
platforms		darwin

description             A python module for the libdnet low-level networking library.
long_description        \
        Libdnet provides a simplified, portable interface to several low-level \
        networking routines, including: network address manipulation, kernel \
        arp(4) cache and route(4) table lookup and manipulation, network \
        firewalling (IP filter, ipfw, ipchains, pf, ...), network interface \
        lookup and manipulation, raw IP packet and Ethernet frame transmission.

homepage                https://code.google.com/p/libdnet/
master_sites            googlecode
extract.suffix          .tgz
distname                libdnet-${version}
dist_subdir             libdnet

checksums               md5     9253ef6de1b5e28e9c9a62b882e44cc9 \
                        sha1    71302be302e84fc19b559e811951b5d600d976f8 \
                        rmd160  4b849f07c3513522fda65af067928b7e6d504aab

subport py27-libdnet {
    set python.bin	${prefix}/bin/python2.7
    set python.prefix  ${frameworks_dir}/Python.framework/Versions/2.7
    depends_lib-append  port:python27
}
subport py26-libdnet {
    set python.bin	${prefix}/bin/python2.6
    set python.prefix  ${frameworks_dir}/Python.framework/Versions/2.6
    depends_lib-append  port:python26
}

if {$subport ne $name} {
    depends_lib-append		port:libdnet

    # libdnet is not universal
    universal_variant       no

    pre-destroot {
        worksrcdir	${worksrcdir}/python
    }
    destroot.cmd		${python.bin} setup.py --no-user-cfg install
    destroot.destdir	--prefix=${python.prefix} --root=${destroot}
    livecheck.type  none
} else {
    livecheck.regex "libdnet-(\\d+(?:\\.\\d+)*)${extract.suffix}"

    # py-libdnet was previously for python 2.4
    revision            1
    replaced_by         py27-libdnet
    depends_lib         port:py27-libdnet
    supported_archs     noarch
    use_configure       no
    build               {}
    destroot {
        xinstall -d ${destroot}${prefix}/share/doc/${name}
        system "echo This port is a stub. > ${destroot}${prefix}/share/doc/${name}/README"
    }
}