Skip site navigation (1)Skip section navigation (2)
Date:      Mon,  5 Mar 2007 10:49:51 +0100 (CET)
From:      Matthias Andree <matthias.andree@gmx.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/109909: [MAINTAINER] security/openvpn-devel: update to _rc2, update rcfile
Message-ID:  <20070305094952.30C9B3A@libertas.emma.line.org>
Resent-Message-ID: <200703050950.l259oApU032076@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         109909
>Category:       ports
>Synopsis:       [MAINTAINER] security/openvpn-devel: update to _rc2, update rcfile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 05 09:50:10 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 6.2-RELEASE-p2 i386
>Organization:
>Environment:
System: FreeBSD libertas.emma.line.org 6.2-RELEASE-p2 FreeBSD 6.2-RELEASE-p2 #0: Tue Feb 27 22:41:06 UTC 2007
>Description:
- update to _rc2
- use rcscript from 2.0.6_7 port to support multiple instances

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- openvpn-devel-2.1.r2.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/security/openvpn-devel/Makefile /usr/home/emma/ports/security/openvpn-devel/Makefile
--- /usr/ports/security/openvpn-devel/Makefile	Sun Feb  4 20:14:20 2007
+++ /usr/home/emma/ports/security/openvpn-devel/Makefile	Mon Mar  5 10:28:41 2007
@@ -6,7 +6,7 @@
 #
 
 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.
diff -ruN --exclude=CVS /usr/ports/security/openvpn-devel/distinfo /usr/home/emma/ports/security/openvpn-devel/distinfo
--- /usr/ports/security/openvpn-devel/distinfo	Sun Nov 12 20:22:50 2006
+++ /usr/home/emma/ports/security/openvpn-devel/distinfo	Mon Mar  5 10:28:56 2007
@@ -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
diff -ruN --exclude=CVS /usr/ports/security/openvpn-devel/files/openvpn.sh.in /usr/home/emma/ports/security/openvpn-devel/files/openvpn.sh.in
--- /usr/ports/security/openvpn-devel/files/openvpn.sh.in	Mon Feb 20 21:47:39 2006
+++ /usr/home/emma/ports/security/openvpn-devel/files/openvpn.sh.in	Mon Mar  5 10:48:02 2007
@@ -2,10 +2,10 @@
 #
 # 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
-#
-# Made in Northrhine-Westphalia, Germany
+# with multi-instance contribution from Denis Shaposhnikov, Gleb Kozyrev
+# and Vasil Dimov
 #
 # $FreeBSD: ports/security/openvpn-devel/files/openvpn.sh.in,v 1.4 2006/02/20 20:47:39 dougb Exp $
 # 
@@ -30,17 +30,29 @@
 
 # -----------------------------------------------------------------------------
 #
-# 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
+#
+# 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
 #
-# openvpn_enable="YES"	# YES or NO
-# openvpn_if="tun" 	# driver(s) to load, set to "tun", "tap" or "tun tap"
+# 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.
 #
@@ -51,14 +63,24 @@
 
 . %%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
@@ -85,7 +107,7 @@
 pidfile="/var/run/${name}.pid"
 
 # command and arguments
-command="%%PREFIX%%/sbin/${name}"
+command="%%PREFIX%%/sbin/openvpn"
 
 # run this first
 start_precmd="openvpn_precmd"
@@ -93,11 +115,18 @@
 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"
diff -ruN --exclude=CVS /usr/ports/security/openvpn-devel/files/pkg-message.in /usr/home/emma/ports/security/openvpn-devel/files/pkg-message.in
--- /usr/ports/security/openvpn-devel/files/pkg-message.in	Sat Aug 19 16:29:37 2006
+++ /usr/home/emma/ports/security/openvpn-devel/files/pkg-message.in	Mon Mar  5 10:32:27 2007
@@ -8,5 +8,5 @@
 ###  If you want to donate to OpenVPN: <http://openvpn.net/donate.html>;
 ### ------------------------------------------------------------------------
 ###  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.
 ### ------------------------------------------------------------------------
--- openvpn-devel-2.1.r2.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070305094952.30C9B3A>