Ticket #43239: patch-openvpn2-Portfile.diff

File patch-openvpn2-Portfile.diff, 4.4 KB (added by jul_bsd@…, 11 years ago)
  • net/openvpn2/Portfile

    old new  
    11# -*- 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 119080 2014-04-16 19:05:15Z macsforever2000@macports.org $
     2# $Id: Portfile 114325 2013-12-05 09:20:31Z ryandesign@macports.org $
    33
    44PortSystem          1.0
    55
    66name                openvpn2
    7 version             2.3.3
     7version             2.3.4
    88distname            openvpn-${version}
    99categories          net security
    1010platforms           darwin
    11 maintainers         nomaintainer
     11maintainers         yahoo.fr:jul_bsd openmaintainer
    1212license             {GPL-2 OpenSSLException}
    1313
    1414description         easy-to-use, robust, and highly configurable VPN
     
    2020homepage            http://www.openvpn.net
    2121master_sites        http://swupdate.openvpn.net/community/releases/
    2222
    23 checksums           rmd160  583119bd19749a5e4a1afef531d67f895ef535f7 \
    24                     sha256  f025d14631105a66e501ca897830cd4d26a1438530cd9174dc6169536ae4b113
     23checksums           rmd160  8b0cc785a8e025b5b77aabc3546e4295b96ea85a \
     24                    sha256  af506d5f48568fa8d2f2435cb3fad35f9a9a8f263999ea6df3ba296960cec85a
    2525
    2626depends_build       port:pkgconfig
    2727depends_lib         port:lzo2 \
     
    3232
    3333post-destroot {
    3434    set docdir ${destroot}${prefix}/share/doc/${name}
     35    set exdir ${destroot}${prefix}/share/examples/${name}
    3536    xinstall -m 755 -d ${docdir}
     37    xinstall -m 755 -d ${exdir}
    3638    foreach dir "sample/sample-config-files \
    3739                sample/sample-keys \
    3840                sample/sample-plugins \
    39                 sample/sample-scripts \
    40                 contrib"  {
    41         file copy ${worksrcpath}/${dir} ${docdir}
     41                sample/sample-scripts"  {
     42        file copy ${worksrcpath}/${dir} ${exdir}/
    4243    }
    43     xinstall -m 644 -W ${worksrcpath} AUTHORS ${docdir}
     44    file copy ${worksrcpath}/contrib ${docdir}/
     45    xinstall -m 644 -W ${worksrcpath} AUTHORS ${docdir}/
     46    reinplace "s|;user nobody|user nobody|;s|;group nobody|group nobody|;" \
     47        ${destroot}${prefix}/share/examples/${name}/sample-config-files/server.conf \
     48        ${destroot}${prefix}/share/examples/${name}/sample-config-files/client.conf \
     49        ${destroot}${prefix}/share/examples/${name}/sample-config-files/static-home.conf \
     50        ${destroot}${prefix}/share/examples/${name}/sample-config-files/static-office.conf \
     51        ${destroot}${prefix}/share/examples/${name}/sample-config-files/tls-home.conf \
     52        ${destroot}${prefix}/share/examples/${name}/sample-config-files/tls-office.conf
    4453}
    4554
    46 if {${os.platform} eq "darwin" && ${os.major} <= 9} {
     55post-activate {
     56    if {![file exists ${prefix}/etc/${name}]} {
     57        xinstall -d ${prefix}/etc/${name}
     58    }
     59    foreach f { server.conf client.conf } {
     60        if {![file exists ${prefix}/etc/${name}/${f}]} {
     61                xinstall ${prefix}/share/examples/${name}/sample-config-files/${f} ${prefix}/etc/${name}/
     62        }
     63    }
     64}
     65
     66notes "
     67If not existing, a default server.conf has been created in ${prefix}/etc/${name}/
     68Startup launch script is set to start with it.
     69Please adjust to your need, especially passphrase or certificates
     70
     71For minimal configuration, you need to follow these steps
     72
     73A) With a shared secret
     74    $ sudo openvpn --genkey --secret ${prefix}/etc/openvpn2/static.key
     75   Use 'secret static.key' in your config file
     76
     77B) With self-signed certificates, follow
     78   https://openvpn.net/index.php/open-source/documentation/howto.html#pki
     79
     80Alternate GUI: https://code.google.com/p/tunnelblick/
     81
     82Openvpn uses a tun device to create its network interface. It could either be:
     83- utun device built into OSX 10.7+
     84- tun device from port tuntaposx
     85"
     86
     87if {${os.platform} == "darwin" && ${os.major} <= 9} {
    4788    post-patch {
    4889        reinplace "s|security/pam_appl.h|pam/pam_appl.h|g" ${worksrcpath}/src/plugins/auth-pam/auth-pam.c
    4990    }
    5091}
    5192
    52 livecheck.url       ${homepage}/download.html
    53 livecheck.regex     openvpn-(\[0-9.\]*).tar.gz
     93startupitem.create      yes
     94startupitem.executable  "${prefix}/bin/openvpn2 --config ${prefix}/etc/${name}/server.conf"
     95
     96livecheck.type      regex
     97livecheck.url       ${homepage}/index.php/open-source/downloads.html
     98livecheck.regex     "/openvpn-(\\d+(?:\\.\\d+)*).tar.gz\">"
     99