Index: head/security/openvpn-devel/Makefile =================================================================== --- head/security/openvpn-devel/Makefile (revision 186668) +++ head/security/openvpn-devel/Makefile (revision 186669) @@ -1,88 +1,88 @@ # New ports collection makefile for: openvpn # Date created: 2002-06-23 # Whom: Matthias Andree # # $FreeBSD$ # PORTNAME= openvpn -DISTVERSION= 2.1_rc1 +DISTVERSION= 2.1_rc2 CATEGORIES= security net # MASTER_SITES points to hosts in distinct data centers, # so just one MASTER_SITES entry should be OK. MASTER_SITES= http://openvpn.net/release/ PKGNAMESUFFIX= -devel MAINTAINER= matthias.andree@gmx.de COMMENT= Secure IP/Ethernet tunnel daemon CONFLICTS= openvpn-[0-9]* GNU_CONFIGURE= yes USE_OPENSSL= yes CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL} CONFIGURE_ARGS= --with-lzo-lib=${LOCALBASE}/lib \ --with-lzo-headers=${LOCALBASE}/include MAN8= openvpn.8 OPTIONS= PW_SAVE "Interactive passwords may be read from a file" off USE_RC_SUBR= openvpn.sh USE_LDCONFIG= ${PREFIX}/lib SUB_FILES= pkg-message pkg-req SUB_LIST+= OSVERSION=${OSVERSION} .include SUB_LIST+= RCSFX=${RC_SUBR_SUFFIX} # NOTE: there is no way to explicitly specify the LZO version to OpenVPN, # if LZO2 and LZO1 are installed, OpenVPN will pick LZO2. # So depend on LZO1 only if it's already there and LZO2 isn't. # PACKAGE_BUILDING will also force LZO2. .if exists(${LOCALBASE}/lib/liblzo2.so.2) || !exists(${LOCALBASE}/lib/liblzo.so.1) || defined(PACKAGE_BUILDING) LIB_DEPENDS+= lzo2.2:${PORTSDIR}/archivers/lzo2 .else LIB_DEPENDS+= lzo.1:${PORTSDIR}/archivers/lzo .endif .if defined(WITH_PW_SAVE) CONFIGURE_ARGS+= --enable-password-save .endif post-patch: @${FIND} ${WRKSRC} -name \*.orig -delete post-build: cd ${WRKSRC}/plugin/down-root && ${MAKE} cd ${WRKSRC}/plugin/auth-pam && ${CC} ${CPPFLAGS} -I../.. -DDLOPEN_PAM=0 ${CFLAGS} -fPIC -shared -Wl,-soname,openvpn-auth-pam.so -o openvpn-auth-pam.so auth-pam.c pamdl.c -lc -lpam @# self-tests here .if !defined(WITHOUT_CHECK) cd ${WRKSRC} && ${MAKE} check .endif pre-install: PKG_PREFIX=${PREFIX} ${SH} ${PKGREQ} ${PKGNAME} INSTALL post-install: ${MKDIR} ${PREFIX}/lib ${INSTALL_PROGRAM} ${WRKSRC}/plugin/down-root/openvpn-down-root.so ${PREFIX}/lib ${INSTALL_PROGRAM} ${WRKSRC}/plugin/auth-pam/openvpn-auth-pam.so ${PREFIX}/lib .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/plugin/down-root/README ${DOCSDIR}/README.openvpn-down-root ${INSTALL_DATA} ${WRKSRC}/plugin/auth-pam/README ${DOCSDIR}/README.openvpn-auth-pam .for docs in AUTHORS COPYING COPYRIGHT.GPL ChangeLog INSTALL NEWS \ PORTS README ${INSTALL_DATA} ${WRKSRC}/${docs} ${DOCSDIR} .endfor ( cd ${WRKSRC} \ && ${FIND} easy-rsa sample-config-files sample-scripts -depth \ | ${GREP} -v easy-rsa/Windows \ | ${CPIO} -pdmu ${DOCSDIR} ) .endif @${CAT} ${PKGMESSAGE} .include Property changes on: head/security/openvpn-devel/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.32 \ No newline at end of property +1.33 \ No newline at end of property Index: head/security/openvpn-devel/distinfo =================================================================== --- head/security/openvpn-devel/distinfo (revision 186668) +++ head/security/openvpn-devel/distinfo (revision 186669) @@ -1,3 +1,3 @@ -MD5 (openvpn-2.1_rc1.tar.gz) = b0773149ef9d93a0075dfa42b87042a0 -SHA256 (openvpn-2.1_rc1.tar.gz) = b5eb4f0d4eda58aaa8b60eb1b2f1d1a0d55ca22e9b098a2f65b6f44abc1c9e11 -SIZE (openvpn-2.1_rc1.tar.gz) = 796620 +MD5 (openvpn-2.1_rc2.tar.gz) = 853c81d2de51d85b5381d4c7f7f074e3 +SHA256 (openvpn-2.1_rc2.tar.gz) = 696630de3b8a8308a508d7ee1965fc5f2d6487ecb3d75e19c249c76f70ebfcb4 +SIZE (openvpn-2.1_rc2.tar.gz) = 802075 Property changes on: head/security/openvpn-devel/distinfo ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.19 \ No newline at end of property +1.20 \ No newline at end of property Index: head/security/openvpn-devel/files/openvpn.sh.in =================================================================== --- head/security/openvpn-devel/files/openvpn.sh.in (revision 186668) +++ head/security/openvpn-devel/files/openvpn.sh.in (revision 186669) @@ -1,103 +1,132 @@ #!/bin/sh # # openvpn.sh - load tun/tap driver and start OpenVPN daemon # -# (C) Copyright 2005 by Matthias Andree +# (C) Copyright 2005 - 2007 by Matthias Andree # based on suggestions by Matthias Grimm and Dirk Gouders +# with multi-instance contribution from Denis Shaposhnikov, Gleb Kozyrev +# and Vasil Dimov # -# Made in Northrhine-Westphalia, Germany -# # $FreeBSD$ # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin # Street, Fifth Floor, Boston, MA 02110-1301, USA. # PROVIDE: openvpn # REQUIRE: DAEMON # BEFORE: # KEYWORD: shutdown # ----------------------------------------------------------------------------- # -# Add the following lines to /etc/rc.conf to enable openvpn at boot-up time: +# This script supports running multiple instances of openvpn. +# To run additional instance link this script to something like +# % ln -s openvpn openvpn_foo +# and define additional openvpn_foo_* variables in one of +# /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/openvpn_foo # -# openvpn_enable="YES" # YES or NO -# openvpn_if="tun" # driver(s) to load, set to "tun", "tap" or "tun tap" +# Below NAME should be substituted with the name of this script. By default +# it is openvpn, so read as openvpn_enable. If you linked the script to +# openvpn_foo, then read as openvpn_foo_enable etc. # +# The following variables are supported (defaults are shown). +# You can place them in any of +# /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/NAME +# +# NAME_enable="NO" # set to YES to enable openvpn +# NAME_if="" # driver(s) to load, set to "tun", "tap" or "tun tap" +# # # optional: -# openvpn_flags="" # openvpn command line flags -# openvpn_configfile="%%PREFIX%%/etc/openvpn/openvpn.conf" # --config file -# openvpn_dir="%%PREFIX%%/etc/openvpn" # --cd directory +# NAME_flags="" # additional command line arguments +# NAME_configfile="%%PREFIX%%/etc/openvpn/NAME.conf" # --config file +# NAME_dir="%%PREFIX%%/etc/openvpn" # --cd directory # -# You also need to set openvpn_configfile and openvpn_dir, if the configuration +# You also need to set NAME_configfile and NAME_dir, if the configuration # file and directory where keys and certificates reside differ from the above # settings. # # Note that we deliberately refrain from unloading drivers. # # For further documentation, please see openvpn(8). # . %%RC_SUBR%% -name=openvpn -rcvar=`set_rcvar` +case "$0" in +/etc/rc*) + # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), + # so get the name of the script from $_file + name=$(basename "$_file" .sh) + ;; +*) + name=$(basename "$0" .sh) + ;; +esac +rcvar=$(set_rcvar) + prefix="%%PREFIX%%" openvpn_precmd() { - for i in $openvpn_if ; do + for i in $interfaces ; do # FreeBSD <= 5.4 does not know kldstat's -m option # FreeBSD >= 6.0 does not add debug.* sysctl information # in the default build - we check both to keep things simple if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 \ && ! kldstat -m if_${i} >/dev/null 2>&1 ; then if ! kldload if_${i} ; then warn "Could not load $i module." return 1 fi fi done return 0 } stop_postcmd() { rm -f "$pidfile" || warn "Could not remove $pidfile." } # support SIGHUP to reparse configuration file extra_commands="reload" # pidfile pidfile="/var/run/${name}.pid" # command and arguments -command="%%PREFIX%%/sbin/${name}" +command="%%PREFIX%%/sbin/openvpn" # run this first start_precmd="openvpn_precmd" # and this last stop_postcmd="stop_postcmd" load_rc_config ${name} -: ${openvpn_enable="NO"} -: ${openvpn_flags=""} -: ${openvpn_if=""} -: ${openvpn_configfile="${prefix}/etc/openvpn/openvpn.conf"} -: ${openvpn_dir="${prefix}/etc/openvpn"} -required_files="${openvpn_configfile}" -command_args="--cd ${openvpn_dir} --daemon --config ${openvpn_configfile} --writepid ${pidfile}" + +eval ": \${${name}_enable:=\"NO\"}" +eval ": \${${name}_flags:=\"\"}" +eval ": \${${name}_if:=\"\"}" +eval ": \${${name}_configfile:=\"${prefix}/etc/openvpn/${name}.conf\"}" +eval ": \${${name}_dir:=\"${prefix}/etc/openvpn\"}" + +configfile="$(eval echo \${${name}_configfile})" +dir="$(eval echo \${${name}_dir})" +interfaces="$(eval echo \${${name}_if})" + +required_files=${configfile} +command_args="--cd ${dir} --daemon --config ${configfile} --writepid ${pidfile}" + run_rc_command "$1" Property changes on: head/security/openvpn-devel/files/openvpn.sh.in ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.4 \ No newline at end of property +1.5 \ No newline at end of property Index: head/security/openvpn-devel/files/pkg-message.in =================================================================== --- head/security/openvpn-devel/files/pkg-message.in (revision 186668) +++ head/security/openvpn-devel/files/pkg-message.in (revision 186669) @@ -1,12 +1,12 @@ ### ------------------------------------------------------------------------ ### Edit /etc/rc.conf[.local] to start OpenVPN automatically at system ### startup. See %%PREFIX%%/etc/rc.d/openvpn%%RCSFX%% for details. ### ------------------------------------------------------------------------ ### For compatibility notes when interoperating with older OpenVPN ### versions, please, see ### ------------------------------------------------------------------------ ### If you want to donate to OpenVPN: ### ------------------------------------------------------------------------ ### NOTE THIS IS AN UNSTABLE VERSION UNDER DEVELOPMENT! -### Consider using the stable version instead for production. +### It may or may not be suitable for production. Use at your own risk. ### ------------------------------------------------------------------------ Property changes on: head/security/openvpn-devel/files/pkg-message.in ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.4 \ No newline at end of property +1.5 \ No newline at end of property