PortSystem 1.0

name            proxytunnel
version         1.9.0
revision        1
categories      net
license         GPL-2+
platforms       darwin
maintainers     nomaintainer
installs_libs   no

description \
    ProxyTunnel is a program that connects stdin and stdout \
    to a server somewhere on the network, through a standard \
    HTTPS proxy. This will allow you for example to access \
    SSH servers when you normally only have http(s) access.

long_description ${description}

homepage        http://proxytunnel.sourceforge.net/
master_sites    sourceforge:proxytunnel

extract.suffix  .tgz
checksums       md5  d74472b89c3f3b3b0abf6bd809ae34c2 \
                sha1 51d816125bb9e9bca267d35f861000eb0fa9d80b

depends_build   port:pkgconfig
depends_lib     path:lib/libssl.dylib:openssl

patchfiles      patch-Makefile.diff
post-patch {
    reinplace -W ${worksrcpath} s|strlcat|strlcat2|g \
        proxytunnel.h \
        setproctitle.c \
        strlcat.c \
        strzcat.c
    reinplace -W ${worksrcpath} s|strlcpy|strlcpy2|g \
        proxytunnel.h \
        setproctitle.c \
        strlcpy.c
}

use_configure       no

variant universal {}

configure.cflags-append -Wall

platform darwin {
    configure.cflags-append -DDARWIN
}

build.args-append CC=${configure.cc} CFLAGS="${configure.cflags} [get_canonical_archflags cc]"
build.target

destroot.args PREFIX=${prefix}

livecheck.type regex
livecheck.url http://sourceforge.net/projects/proxytunnel/files/proxytunnel%20source%20tarballs/
livecheck.regex "${name} (\\d+(?:\\.\\d+)+)"