# -*- 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
PortGroup           python 1.0

github.setup        KimiNewt pyshark 0.4.3 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
name                py-${github.project}
categories-append   net

license             MIT
maintainers         nomaintainer
platforms           {darwin any}
supported_archs     noarch

description         Python wrapper for tshark

long_description    {*}${description}, allowing python packet parsing \
                    using wireshark dissectors

python.versions     39

checksums           rmd160  5c6d4811af3d85c99e0922f028061d3c762eb40c \
                    sha256  59b271bea0a802183268d942c68520685f2991dcf4d1409e9b926fa394bfa07f \
                    size    30415

if {${name} ne ${subport}} {
    depends_run-append \
                    port:py${python.version}-lxml \
                    path:bin/dumpcap:wireshark3 \
                    path:bin/tshark:wireshark3

    depends_test-append \
                    port:py${python.version}-mock

    # diff -Naur -I '^ *#' src/pyshark/config.ini.orig src/pyshark/config.ini | sed -E 's|\.orig||' > patch-config-ini.diff
    patchfiles      patch-config-ini.diff

    post-patch {
        reinplace s|@PREFIX@|${prefix}|g ${worksrcpath}/src/pyshark/config.ini
    }

    build.dir       ${worksrcpath}/src

    test.run        yes
}
