# $Id: Portfile 94744 2012-06-28 11:23:17Z jmr@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-pcapy
version             0.10.5
categories-append   net
license             Apache-1.1
maintainers         nomaintainer

description         python interface to libpcap

long_description    Pcapy is a Python extension module that interfaces with \
                    the libpcap packet capture library. Pcapy enables python \
                    scripts to capture packets on the network.

platforms           darwin

homepage            http://oss.coresecurity.com/projects/pcapy.html
master_sites        http://oss.coresecurity.com/repo/
distname            pcapy-${version}

checksums           md5     1dcff6af494f3d6763f457aa86aa0853 \
                    sha1    e7e803b423f2c2e3401ee616cddfd6ab237fc8d8 \
                    rmd160  fef424f4b912ba73e95e192355a0ad2e527492ff

python.versions     24 25 26 27

if {$subport != $name} {
    depends_lib-append  port:libpcap

    build.env       CPPFLAGS="-I${prefix}/include -L${prefix}/lib" \
                    CFLAGS=-I${prefix}/include \
                    LDFLAGS=-L${prefix}/lib

    post-destroot {
        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
        eval file rename [glob ${destroot}${python.prefix}/share/doc/pcapy/*] \
            ${destroot}${prefix}/share/doc/${subport}
        xinstall -m 644 -W ${worksrcpath} ChangeLog PKG-INFO \
            ${destroot}${prefix}/share/doc/${subport}
    }
    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.regex     {pcapy-([0-9.]+)\.tar}
}
