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

name                    cntlm
version                 0.92.3
license                 GPL-2+
categories              net
platforms               darwin
maintainers             nomaintainer
description             Cntlm is an NTLM / NTLM Session Response / \
                        NTLMv2 authenticating HTTP proxy
long_description        Cntlm integrates TCP/IP port forwarding (HTTP \
                        tunneling), SOCKS5 proxy mode, standalone proxy \
                        allowing you to browse intranet as well as \
                        Internet and to access corporate web servers \
                        with NTLM protection. There are many advanced \
                        features like NTLMv2 support, password protection, \
                        password hashing, completely mutliplatform code \
                        (running on just about every architecture and OS \
                        out there) and so much more.
homepage                http://cntlm.sourceforge.net/
master_sites            sourceforge:project/cntlm/cntlm/cntlm%20${version}
use_bzip2               yes

checksums               rmd160  6655738ca5f93d15f14681d3c14bbe8ec8e6a543 \
                        sha256  7b603d6200ab0b26034e9e200fab949cc0a8e5fdd4df2c80b8fc5b1c37e7b930 \
                        size    78198

patchfiles              patch-Makefile.diff

depends_lib             path:libexec/coreutils/libstdbuf.so:coreutils

build.args              SYSCONFDIR=${destroot}${prefix}/etc \
                        BINDIR=${destroot}${prefix}/sbin \
                        MANDIR=${destroot}${prefix}/share/man

destroot.args           ${build.args}

post-destroot {
    # Move conf file to sample so it does not get overwritten
    file rename ${destroot}${prefix}/etc/cntlm.conf ${destroot}${prefix}/etc/cntlm.conf.sample
}

post-activate {
   # Create initial conf file if needed
   if {![file exists ${prefix}/etc/cntlm.conf]} {
      file copy ${prefix}/etc/cntlm.conf.sample \
         ${prefix}/etc/cntlm.conf
   }
}

startupitem.create      yes
startupitem.name        cntlm
startupitem.executable  ${prefix}/sbin/cntlm -f

notes "The Cntlm configuration file -> ${prefix}/etc/cntlm.conf"

livecheck.regex         ${name} (\[0-9.\]+)
