# $Id: Portfile 78375 2011-05-05 15:59:31Z pixilla@macports.org $

PortSystem 1.0

name		openvpn2
version		2.2.0
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        http://swupdate.openvpn.net/community/releases/

checksums           sha1    97e3389814a1bcef5a6d22774534a30e41d48bff \
                    rmd160  32aa52c886d98b6b92150dfc64d3a9c07f6e8b30

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
