source: trunk/dports/net/openvpn2/Portfile

Last change on this file was 153910, checked in by khindenburg@…, 11 months ago

openvpn2: update to 2.3.12; update links #51907

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 153910 2016-10-15 17:29:15Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                openvpn2
7version             2.3.12
8distname            openvpn-${version}
9categories          net security
10platforms           darwin
11maintainers         nomaintainer
12license             {GPL-2 OpenSSLException}
13
14description         easy-to-use, robust, and highly configurable VPN
15long_description    \
16    OpenVPN is an easy-to-use, robust, and highly configurable VPN (Virtual \
17    Private Network) daemon which can be used to securely link two or more \
18    private networks using an encrypted tunnel over the internet.
19
20homepage            https://openvpn.net
21master_sites        https://swupdate.openvpn.net/community/releases/
22
23use_xz              yes
24
25checksums           rmd160  b4bf63fdd5debeaaa1958953ca8f1de86a91fcb8 \
26                    sha256  13b963414e2430215981868c77b9795d93653ee535a2d73576f7bb2c28200abc
27
28depends_build       port:pkgconfig
29depends_lib         port:lzo2 \
30                    path:lib/libssl.dylib:openssl
31
32configure.args      --program-suffix=2 \
33                    --docdir=${prefix}/share/doc/${name}
34
35post-destroot {
36    set docdir ${destroot}${prefix}/share/doc/${name}
37    set exdir ${destroot}${prefix}/share/examples/${name}
38    xinstall -m 755 -d ${docdir}
39    xinstall -m 755 -d ${exdir}
40    foreach dir "sample/sample-config-files \
41                sample/sample-keys \
42                sample/sample-plugins \
43                sample/sample-scripts"  {
44        file copy ${worksrcpath}/${dir} ${exdir}/
45    }
46    file copy ${worksrcpath}/contrib ${docdir}/
47    xinstall -m 644 -W ${worksrcpath} AUTHORS ${docdir}/
48    reinplace "s|;user nobody|user nobody|;s|;group nobody|group nobody|;" \
49        ${destroot}${prefix}/share/examples/${name}/sample-config-files/server.conf \
50        ${destroot}${prefix}/share/examples/${name}/sample-config-files/client.conf \
51        ${destroot}${prefix}/share/examples/${name}/sample-config-files/static-home.conf \
52        ${destroot}${prefix}/share/examples/${name}/sample-config-files/static-office.conf \
53        ${destroot}${prefix}/share/examples/${name}/sample-config-files/tls-home.conf \
54        ${destroot}${prefix}/share/examples/${name}/sample-config-files/tls-office.conf
55}
56
57post-activate {
58    if {![file exists ${prefix}/etc/${name}]} {
59        xinstall -d ${prefix}/etc/${name}
60    }
61    foreach f { server.conf client.conf } {
62        if {![file exists ${prefix}/etc/${name}/${f}]} {
63                xinstall ${prefix}/share/examples/${name}/sample-config-files/${f} ${prefix}/etc/${name}/
64        }
65    }
66}
67
68notes "
69If not existing, a default server.conf has been created in ${prefix}/etc/${name}/
70Startup launch script is set to start with it.
71Please adjust to your need, especially passphrase or certificates
72
73For minimal configuration, you need to follow these steps
74
75A) With a shared secret
76    $ sudo openvpn2 --genkey --secret ${prefix}/etc/openvpn2/static.key
77   Use 'secret static.key' in your config file
78
79B) With self-signed certificates, follow
80   ${homepage}/index.php/open-source/documentation/howto.html#pki
81
82Alternate GUI: https://tunnelblick.net/
83
84Openvpn uses a tun device to create its network interface. It could either be:
85- utun device built into OSX 10.7+
86- tun device from port tuntaposx
87"
88
89if {${os.platform} == "darwin" && ${os.major} <= 9} {
90    post-patch {
91        reinplace "s|security/pam_appl.h|pam/pam_appl.h|g" ${worksrcpath}/src/plugins/auth-pam/auth-pam.c
92    }
93}
94
95startupitem.create      yes
96startupitem.executable  ${prefix}/sbin/openvpn2 --config ${prefix}/etc/${name}/server.conf
97
98livecheck.type      regex
99livecheck.url       ${homepage}/index.php/open-source/downloads.html
100livecheck.regex     "/openvpn-(\\d+(?:\\.\\d+)*).tar.gz\">"
101
Note: See TracBrowser for help on using the repository browser.