# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 77096 2011-03-20 05:17:46Z ryandesign@macports.org $

PortSystem          1.0

name                stunnel
version             4.35
set major           [lindex [split ${version} .] 0]
categories          security net
platforms           darwin
maintainers         nomaintainer
license             GPL-2+

description         SSL tunneling program

long_description    Stunnel is a program that allows you to encrypt arbitrary \
                    TCP connections inside SSL (Secure Sockets Layer) available \
                    on both Unix and Windows. Stunnel can allow you to secure \
                    non-SSL aware daemons and protocols (like POP, IMAP, LDAP, \
                    etc) by having Stunnel provide the encryption, requiring no \
                    changes to the daemon's code.

homepage            http://www.stunnel.org/
master_sites        http://mirrors.zerg.biz/stunnel/ \
                    http://mirrors.zerg.biz/stunnel/obsolete/${major}.x/ \
                    ftp://ftp.stunnel.org/stunnel/

checksums           sha1    b08b95a61f1d65cf9cc44068e0665a17ea5397c3 \
                    rmd160  29bdf0402114a460016192350f4164eae5bb5cce

depends_lib         port:openssl

patchfiles          patch-configure \
                    patch-tools-stunnel.cnf

configure.args      --disable-libwrap

destroot.keepdirs   ${destroot}${prefix}/var/lib/stunnel
post-destroot {
    xinstall -d -m 770 -o nobody ${destroot}${prefix}/var/lib/stunnel/

    # Tell the user about the stupid fake certificate that we provide.
    ui_msg "A fake certificate has been installed as ${prefix}/etc/stunnel/stunnel.pem"
}

# libwrap has been reported to introduce some problems with stunnel 4.18.
# See: https://trac.macports.org/ticket/11028
variant libwrap description {Include libwrap support} {
    configure.args-delete   --disable-libwrap
}

default_variants    +libwrap
