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

go.setup            github.com/projectdiscovery/proxify 0.0.15 v
revision            0

description         \
    Swiss Army knife Proxy tool for HTTP/HTTPS traffic capture, manipulation, \
    and replay on the go.

long_description    \
    Swiss Army Knife Proxy for rapid deployments. Supports multiple \
    operations such as request/response dump, filtering and manipulation via \
    DSL language, upstream HTTP/Socks5 proxy. Additionally a replay utility \
    allows to import the dumped traffic (request/responses with correct \
    domain name) into burp or any other proxy by simply setting the upstream \
    proxy to proxify.

categories          net www
installs_libs       no
license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  2591932a8632b77de7f7ebcc0a55034c7ced3a1d \
                    sha256  21e7d9cfa047d66353e98daeaff9d182091168e2385746dbbd0c194de792fbb5 \
                    size    675315

set _dist_path      ${workpath}/dist

# Allow Go to fetch deps at build time
go.offline_build no

build.pre_args      -o ${_dist_path}
build.args          ./cmd/...

post-extract {
    file mkdir ${_dist_path}
}

post-build {
    move ${_dist_path}/replay ${_dist_path}/${name}-replay
}

destroot {
    foreach _proxify_bin [glob ${_dist_path}/*] {
        xinstall -m 0755 ${_proxify_bin} ${destroot}${prefix}/bin/
    }
}


notes "replay is installed as ${name}-replay"
