# $Id: Portfile,v 1.3 2006/04/01 12:34:11 olegb Exp $
PortSystem        1.0

name              racoon
version           20050510a
categories        security net
maintainers       a_rankine@yahoo.co.uk arsptr@swiftdsl.com.au

description       an IKE (IPSec) daemon
long_description  Racoon is the daemon which negotiates and configures IPsec security associations
homepage          http://www.kame.net/racoon
master_sites      ftp://ftp.kame.net/pub/kame/misc/

checksums         md5 50a43fa2151e52aa138922fdd9466691

worksrcdir        ${name}-${version}/${name}

patchfiles        patch-Makefile.in

configure.env-append LDFLAGS="-L../libipsec" CFLAGS="-DBIND_8_COMPAT=1  -isystem ${filespath}/includes"

destroot.destdir  mandir=${destroot}${prefix}/share/man prefix=${destroot}${prefix}

post-patch {
    file copy -force /usr/share/libtool/config.guess ${worksrcpath}/config.guess
    file copy -force /usr/share/libtool/config.sub ${worksrcpath}/config.sub

    reinplace "s|IPPROTO_MH|IPPROTO_MHRP|g" ${workpath}/${name}-${version}/libipsec/pfkey_dump.c

    cd ${worksrcpath}/../libipsec
    system "bsdmake OPSYS=FreeBSD CFLAGS=\"-isystem ${filespath}/includes\""
}

platform darwin 6 {
    configure.env-delete CFLAGS="-DBIND_8_COMPAT=1  -isystem ${filespath}/includes"
}

variant gssapi {
    configure.args --enable-gssapi
    configure.env-append LIBS="-lgssapi_krb5"
}
