# $Id: Portfile,v 1.11 2006/07/22 20:33:13 landonf Exp $

PortSystem 1.0
name		openvpn2
version		2.0.7
revision	1
distname	openvpn-${version}
categories	net security
maintainers	jordiyeh@gmail.com julien.touche@touche.fr.st pierre@queinnec.org
description	easy-to-use, robust, and highly configurable VPN
long_description	OpenVPN is an easy-to-use, robust, and highly \
			configurable VPN (Virtual Private Network) daemon \
			which can be used to securely link two or more \
			private networks using an encrypted tunnel over \
			the internet.
homepage	http://www.openvpn.net
master_sites	${homepage}/release/
platforms	darwin
distname	openvpn-${version}
checksums	md5 93528233f1f6d02fc18e2c00f82e0aca

depends_lib	port:lzo2 \
		port:openssl

configure.args	--mandir=${prefix}/share/man \
		--with-lzo-headers=${prefix}/include \
		--with-lzo-lib=${prefix}/lib \
		--with-ssl-headers=${prefix}/include \
		--with-ssl-lib=${prefix}/lib \
		--program-suffix=2

variant no_lzo	{
	configure.args-append	--disable-lzo
	depends_lib-delete	port:lzo2
}

post-patch {
	reinplace "s|lzo/lzo|lzo2/lzo|g" \
		"${worksrcpath}/configure"  \
		"${worksrcpath}/lzo.h"
 }

post-destroot {
	set docdir ${destroot}/${prefix}/share/doc/${name}
	xinstall -m 755 -d ${docdir}
	foreach dir "easy-rsa sample-config-files sample-scripts \
		contrib sample-keys management"  {
		file copy ${worksrcpath}/${dir} ${docdir}
	}
	foreach file "AUTHORS INSTALL NEWS PORTS README" {
		xinstall -m 644 -W ${worksrcpath} ${file} ${docdir}
	}
	xinstall -m 644 ${worksrcpath}/openvpn-plugin.h ${destroot}${prefix}/include
}

platform darwin 8 {
	configure.env	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}

