# $Id: Portfile 62709 2010-01-14 09:24:54Z pmq@macports.org $

PortSystem 1.0

name		openvpn2
version		2.1.1
revision	1
distname	openvpn-${version}
categories	net security
platforms	darwin
maintainers	pmq openmaintainer

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/
distname	openvpn-${version}
checksums	sha1 4b18e71b07236760f3b4defa941661e94b731a5a \
		rmd160 a33ed8ef4ba564103c2d196bbb742dac88d30e80

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

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"  {
		file copy ${worksrcpath}/${dir} ${docdir}
	}
	foreach file "AUTHORS COPYING NEWS PORTS README" {
		xinstall -m 644 -W ${worksrcpath} ${file} ${docdir}
	}
	xinstall -m 644 ${worksrcpath}/openvpn-plugin.h ${destroot}${prefix}/include
}

livecheck.url	${homepage}/download.html
livecheck.regex	openvpn-(\[0-9.\]*).tar.gz
