# $Id: Portfile 61700 2009-12-19 10:32:01Z toby@macports.org $

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; \
c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0

name                vpnc
version             0.5.3
categories          net
maintainers         nomaintainer
description         client for cisco vpn concentrator
long_description    vpnc is an open source replacement for the commercial \
                    cisco vpnclient. It is supposed to work with the following \
                    systems: \
                    - Cisco VPN concentrator 3000 Series \
                    - Cisco IOS routers \
                    - Cisco PIX / ASA Zecurity Appliances \
                    - Juniper/Netscreen \
                    \
                    You will also need the tun/tap driver for Mac OS X: \
                    http://www-user.rhrk.uni-kl.de/~nissler/tuntap/
                    
homepage            http://www.unix-ag.uni-kl.de/~massar/vpnc/
platforms           darwin
master_sites        http://www.unix-ag.uni-kl.de/~massar/vpnc/

checksums           sha1 321527194e937371c83b5e7c38e46fca4f109304 \
                    rmd160 6f3926901e75dc98762f6ef45782930f2fb76a2f

depends_lib         port:libgcrypt \
                    port:libgpg-error

patchfiles          patch-config.c
post-patch { reinplace "s|__ETCDIR__|${prefix}/etc|g" ${worksrcpath}/config.c }

use_configure       no

build.args          PREFIX=${prefix} ETCDIR=${prefix}/etc/vpnc

destroot.args       PREFIX=${prefix} ETCDIR=${prefix}/etc/vpnc

variant             hybrid_cert description "Enable the support for hybrid and cert modes in vpnc" {
    depends_lib-append port:openssl
    build.args-append  "OPENSSL_GPL_VIOLATION=-DOPENSSL_GPL_VIOLATION OPENSSLLIBS=-lcrypto"
}
livecheck.type  regex
livecheck.url   ${homepage}
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
