Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Aug 2014 16:45:25 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r365202 - in head/net/mpd-l2tp-ipv6pd-client: . files scripts
Message-ID:  <201408171645.s7HGjPLn002747@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Sun Aug 17 16:45:25 2014
New Revision: 365202
URL: http://svnweb.freebsd.org/changeset/ports/365202
QAT: https://qat.redports.org/buildarchive/r365202/

Log:
  - Make it non-interactive port. [1]
  - Nuke mpd4 support.
  
  Requested by:	marino [1]

Added:
  head/net/mpd-l2tp-ipv6pd-client/files/
  head/net/mpd-l2tp-ipv6pd-client/files/dhcp6c.conf.in.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/dhcp6c_pd.sh.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/linkdown.sh.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/linkup.sh.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/mpd.conf.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/mpd.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/mpd.secret.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/pkg-message.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/rtadvd.conf.in   (contents, props changed)
  head/net/mpd-l2tp-ipv6pd-client/files/setup.in   (contents, props changed)
Deleted:
  head/net/mpd-l2tp-ipv6pd-client/pkg-plist
  head/net/mpd-l2tp-ipv6pd-client/scripts/
Modified:
  head/net/mpd-l2tp-ipv6pd-client/Makefile
  head/net/mpd-l2tp-ipv6pd-client/pkg-descr

Modified: head/net/mpd-l2tp-ipv6pd-client/Makefile
==============================================================================
--- head/net/mpd-l2tp-ipv6pd-client/Makefile	Sun Aug 17 16:36:13 2014	(r365201)
+++ head/net/mpd-l2tp-ipv6pd-client/Makefile	Sun Aug 17 16:45:25 2014	(r365202)
@@ -1,8 +1,7 @@
-# Created by: Hajimu UMEMOTO <ume@FreeBSD.org>
 # $FreeBSD$
 
 PORTNAME=	mpd-l2tp-ipv6pd-client
-PORTVERSION=	20081105
+PORTVERSION=	20140817
 #PORTREVISION=	0
 CATEGORIES=	net ipv6
 MASTER_SITES=	# none
@@ -11,92 +10,41 @@ DISTFILES=	# none
 MAINTAINER=	ume@FreeBSD.org
 COMMENT=	Sample implementation set of "L2TP-IPv6PD" client using mpd
 
-IS_INTERACTIVE=	yes
-MANUAL_PACKAGE_BUILD=yes
-NO_PACKAGE=	yes
-USE_RC_SUBR=	yes
-
-OPTIONS_SINGLE=		MPD
-OPTIONS_SINGLE_MPD=	MPD4 MPD5
-OPTIONS_DEFAULT=	MPD5
-OPTIONS_SUB=		yes
-MPD4_DESC=		Use mpd4
-MPD5_DESC=		Use mpd5
-
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MMPD4}
-MPD_NAME=	mpd4
-.else
-MPD_NAME=	mpd5
-.endif
+LICENSE=	BSD2CLAUSE
 
-BUILD_DEPENDS=	${MPD_NAME}:${PORTSDIR}/net/${MPD_NAME}
+BUILD_DEPENDS=	mpd5:${PORTSDIR}/net/mpd5
 RUN_DEPENDS=	dhcp6ctl:${PORTSDIR}/net/dhcp6 \
-		${MPD_NAME}:${PORTSDIR}/net/${MPD_NAME}
+		mpd5:${PORTSDIR}/net/mpd5
 
-CONF_DIR?=	etc/${MPD_NAME}
-MPD_CONF_FILES=	dhcp6c.conf.in rtadvd.conf
-SCRIPT_FILES=	dhcp6c_pd.sh linkdown.sh linkup.sh
-SECRET_FILES=	mpd.secret
-
-SCRIPTS_ENV=	WRKDIR="${WRKDIR}" \
-		SCRIPTDIR="${SCRIPTDIR}" \
-		PREFIX="${PREFIX}" \
-		CONF_DIR="${CONF_DIR}" \
-		MPD_NAME="${MPD_NAME}" \
-		CAT="${CAT}" \
-		CP="${CP}" \
-		DIALOG="${DIALOG}" \
-		MD5="${MD5}" \
-		MKTEMP="${MKTEMP}" \
-		RM="${RM}" \
-		SED="${SED}" \
-		WHICH="${WHICH}"
+NO_BUILD=	yes
 
-PLIST_SUB+=	CONF_DIR=${CONF_DIR} \
-		MPD_NAME=${MPD_NAME}
+PLIST_FILES=	sbin/${PORTNAME}-setup \
+		${TEMPLATE_FILES:C,^,${DATADIR_REL}/,g}
+PLIST_DIRS=	${DATADIR_REL}
+
+SUB_LIST=	PORTNAME=${PORTNAME}
+SUB_FILES=	pkg-message \
+		setup
 
 PKGMESSAGE=	${WRKDIR}/pkg-message
 
-do-build:
-	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/setting
-	@${DIALOG} --clear
+TEMPLATE_FILES=	dhcp6c.conf.in.in \
+		dhcp6c_pd.sh.in \
+		linkdown.sh.in \
+		linkup.sh.in \
+		mpd.conf.in \
+		mpd.in \
+		mpd.secret.in \
+		rtadvd.conf.in
 
 do-install:
-	@if [ -f ${PREFIX}/${CONF_DIR}/mpd.conf -o \
-	      -f ${PREFIX}/${CONF_DIR}/mpd.links -o \
-	      -f ${PREFIX}/${CONF_DIR}/mpd.secret ]; then \
-		${ECHO_CMD} "There are ${MPD_NAME} configuration files already"; \
-		${ECHO_CMD} "Pleae remove at least following files before install:"; \
-		${ECHO_CMD} "    ${PREFIX}/${CONF_DIR}/mpd.conf"; \
-		${ECHO_CMD} "    ${PREFIX}/${CONF_DIR}/mpd.links"; \
-		${ECHO_CMD} "    ${PREFIX}/${CONF_DIR}/mpd.secret"; \
-		exit 1; \
-	fi
-	@${MKDIR} ${STAGEDIR}${PREFIX}/${CONF_DIR}
-.if ${PORT_OPTIONS:MMPD4}
-	@${INSTALL_DATA} ${WRKDIR}/mpd.conf \
-		${STAGEDIR}${PREFIX}/${CONF_DIR}/mpd.conf
-	@${INSTALL_DATA} ${WRKDIR}/mpd.links \
-		${STAGEDIR}${PREFIX}/${CONF_DIR}/mpd.links
-.else
-	@${INSTALL_DATA} ${WRKDIR}/mpd5.conf \
-		${STAGEDIR}${PREFIX}/${CONF_DIR}/mpd.conf
-.endif
-.for f in ${MPD_CONF_FILES}
-	@${INSTALL_DATA} ${WRKDIR}/${f} \
-		${STAGEDIR}${PREFIX}/${CONF_DIR}/${f}
-.endfor
-	@${INSTALL_DATA} ${WRKDIR}/mpd \
-		${STAGEDIR}${PREFIX}/${CONF_DIR}/${MPD_NAME}
-.for f in ${SCRIPT_FILES}
-	@${INSTALL_SCRIPT} ${WRKDIR}/${f} \
-		${STAGEDIR}${PREFIX}/${CONF_DIR}/${f}
-.endfor
-.for f in ${SECRET_FILES}
-	@${INSTALL} ${COPY} -m 400 ${WRKDIR}/${f} \
-		${STAGEDIR}${PREFIX}/${CONF_DIR}/${f}
+	@${INSTALL} ${WRKDIR}/setup ${STAGEDIR}${PREFIX}/sbin/${PORTNAME}-setup
+	@${MKDIR} ${STAGEDIR}${DATADIR}
+.for f in ${TEMPLATE_FILES}
+	@${INSTALL_DATA} ${FILESDIR}/${f} ${STAGEDIR}${DATADIR}/${f}
 .endfor
 
+setup:
+	@${PREFIX}/sbin/${PORTNAME}-setup
+
 .include <bsd.port.mk>

Added: head/net/mpd-l2tp-ipv6pd-client/files/dhcp6c.conf.in.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/dhcp6c.conf.in.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,10 @@
+interface __INTERFACE__ {
+	send ia-pd 0;
+};
+
+id-assoc pd 0 {
+	prefix-interface __PD_INTERFACE__ {
+		sla-id 0;
+		sla-len 0;
+	};
+};

Added: head/net/mpd-l2tp-ipv6pd-client/files/dhcp6c_pd.sh.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/dhcp6c_pd.sh.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,127 @@
+#!/bin/sh
+#
+# Copyright (c) 2007-2014 Hajimu UMEMOTO <ume@mahoroba.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+# PROVIDE: dhcp6c_pd
+# REQUIRE: mountcritremote
+# KEYWORD: nojail nostart
+
+. /etc/rc.subr
+
+name="dhcp6c_pd"
+rcvar=
+command="%%_PREFIX_%%/sbin/dhcp6c"
+start_precmd="dhcp6c_pd_prestart"
+start_postcmd="dhcp6c_pd_poststart"
+stop_precmd="dhcp6c_pd_precmd"
+stop_cmd="dhcp6c_pd_stop"
+restart_precmd="dhcp6c_pd_precmd"
+
+# When dhcp6c gets signal, dhcp6c removes its pidfile immediately but
+# dhcp6c might not terminate.
+getpid()
+{
+	if [ -f "${pidfile}" ]; then
+		read pid junk < ${pidfile}
+		echo ${pid}
+	else
+		/bin/pgrep -f "dhcp6c -p ${pidfile}"
+	fi
+}
+
+dhcp6c_pd_precmd()
+{
+	if [ -z "${dhcp6c_pd_interface}" ]; then
+		warn "\$dhcp6c_pd_interface is not set."
+		return 1
+	fi
+}
+
+dhcp6c_pd_prestart()
+{
+	dhcp6c_pd_precmd
+
+	pid=$(getpid)
+	if [ -n "${pid}" ]; then
+		dhcp6c_pd_stop
+		sleep 2
+	fi
+
+	# create dhcp6c.conf
+	sed -e "s/__INTERFACE__/${dhcp6c_pd_interface}/" \
+	    -e "s/__PD_INTERFACE__/${dhcp6c_pd_rtadvd_interface}/" \
+	    < ${dhcp6c_pd_conf_in} > ${dhcp6c_pd_conf}.${dhcp6c_pd_interface}
+
+	# create dhcp6cctlkey
+	#if [ ! -f %%_PREFIX_%%/etc/dhcp6cctlkey ]; then
+	#	/sbin/md5 -q -s $(date "+%Y-%m-%d-%H-%M-%S") \
+	#	    > %%_PREFIX_%%/etc/dhcp6cctlkey
+	#fi
+}
+
+dhcp6c_pd_poststart()
+{
+	if checkyesno dhcp6c_pd_rtadvd_enable; then
+		/sbin/sysctl net.inet6.ip6.accept_rtadv=0
+		/sbin/sysctl net.inet6.ip6.forwarding=1
+		/usr/sbin/rtadvd -c ${dhcp6c_pd_rtadvd_conf} \
+		    ${dhcp6c_pd_rtadvd_interface}
+	fi
+}
+
+dhcp6c_pd_stop()
+{
+	if checkyesno dhcp6c_pd_rtadvd_enable; then
+		if [ -f "/var/run/rtadvd.pid" ]; then
+			read pid junk < "/var/run/rtadvd.pid"
+			kill ${pid}
+			/sbin/sysctl net.inet6.ip6.accept_rtadv=1
+			/sbin/sysctl net.inet6.ip6.forwarding=0
+		fi
+	fi
+
+	pid=$(getpid)
+	if [ -n "${pid}" ]; then
+		kill ${pid}
+		rm -f ${dhcp6c_pd_conf}.${dhcp6c_pd_interface}
+	fi
+}
+
+load_rc_config ${name}
+dhcp6c_pd_conf_in=${dhcp6c_pd_conf_in:-"%%CONFDIR%%/dhcp6c.conf.in"}
+dhcp6c_pd_conf=${dhcp6c_pd_conf:-"/var/run/dhcp6c.conf"}
+dhcp6c_pd_interface=${2:-${dhcp6c_pd_interface}}
+dhcp6c_pd_localaddr=${3:-${dhcp6c_pd_localaddr}}
+dhcp6c_pd_rtadvd_enable=${dhcp6c_pd_rtadvd_enable:-"NO"}
+dhcp6c_pd_rtadvd_interface=${dhcp6c_pd_rtadvd_interface:-"%%PD_INTERFACE%%"}
+dhcp6c_pd_rtadvd_conf=${dhcp6c_pd_rtadvd_conf:-"%%CONFDIR%%/rtadvd.conf"}
+required_files="${dhcp6c_pd_conf_in}"
+pidfile=/var/run/dhcp6c-${dhcp6c_pd_interface}.pid
+command_args="-p ${pidfile} -c ${dhcp6c_pd_conf}.${dhcp6c_pd_interface} ${dhcp6c_pd_interface}"
+if [ -n "${dhcp6c_pd_localaddr}" ]; then
+	command_args="-A ${dhcp6c_pd_localaddr} ${command_args}"
+fi
+rc_fast=yes
+run_rc_command "$1"

Added: head/net/mpd-l2tp-ipv6pd-client/files/linkdown.sh.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/linkdown.sh.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+iface=$1
+family=$2
+
+case ${family} in
+inet6)
+	%%CONFDIR%%/dhcp6c_pd.sh stop ${iface}
+	case ${iface} in
+	*)
+		/sbin/route delete -inet6 default
+		;;
+	esac
+	;;
+esac

Added: head/net/mpd-l2tp-ipv6pd-client/files/linkup.sh.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/linkup.sh.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# link up
+#linkup.sh <interface> <family> <local address> <remote address> <authname>
+#
+
+iface=$1
+family=$2
+myaddr=$3
+hisaddr=$4
+
+case ${family} in
+inet6)
+	(
+		sleep $(($(sysctl -n net.inet6.ip6.dad_count) + 1))
+		%%CONFDIR%%/dhcp6c_pd.sh start ${iface}
+	) &
+	case ${iface} in
+	*)
+		/sbin/route delete -inet6 default
+		/sbin/route add -inet6 default ::1 -ifp ${iface}
+		;;
+	esac
+	;;
+esac

Added: head/net/mpd-l2tp-ipv6pd-client/files/mpd.conf.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/mpd.conf.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,27 @@
+startup:
+
+default:
+	load l2tp
+
+l2tp:
+	create bundle static Bl2tp
+	set bundle no ipcp
+	set bundle enable ipv6cp
+	set iface idle 0
+	set iface up-script %%CONFDIR%%/linkup.sh
+	set iface down-script %%CONFDIR%%/linkdown.sh
+	#set iface route ::/0
+
+	create link static Ll2tp l2tp
+	set link action bundle Bl2tp
+	set link no acfcomp protocomp
+	set link disable pap chap
+	set link accept chap
+	set link keep-alive 15 60
+	set link max-redial 0
+	set link mtu 1390
+	set link mru 1390
+	set l2tp peer %%FIXED_SERVER%%
+	set l2tp hostname %%PPP_ID%%
+	set auth authname %%PPP_ID%%
+	open

Added: head/net/mpd-l2tp-ipv6pd-client/files/mpd.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/mpd.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,19 @@
+mpd_confdir="%%CONFDIR%%"
+mpd_rundir="/var/run"
+
+mpd_enable="YES"
+mpd_flags="-b -d ${mpd_confdir}"
+
+stop_precmd="mpd_prestop"
+
+mpd_prestop()
+{
+	local ifaces
+
+	ifaces=$(find ${mpd_rundir} -name dhcp6c.conf.\* -print | \
+		sed -e "s|${mpd_rundir}/dhcp6c\.conf\.||")
+	for iface in ${ifaces}; do
+		${mpd_confdir}/dhcp6c_pd.sh stop ${iface}
+	done
+	sleep 2
+}

Added: head/net/mpd-l2tp-ipv6pd-client/files/mpd.secret.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/mpd.secret.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1 @@
+%%PPP_ID%%	"%%PPP_PASSWD%%"

Added: head/net/mpd-l2tp-ipv6pd-client/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/pkg-message.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,5 @@
+
+Type following commands to setup:
+
+  # %%PORTNAME%%-setup
+

Added: head/net/mpd-l2tp-ipv6pd-client/files/rtadvd.conf.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/rtadvd.conf.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,2 @@
+%%PD_INTERFACE%%:\
+	:vltime#180:pltime#90:maxinterval#30:

Added: head/net/mpd-l2tp-ipv6pd-client/files/setup.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mpd-l2tp-ipv6pd-client/files/setup.in	Sun Aug 17 16:45:25 2014	(r365202)
@@ -0,0 +1,121 @@
+#!/bin/sh
+#
+# Copyright (c) 2007-2014 Hajimu UMEMOTO <ume@mahoroba.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+PREFIX=%%PREFIX%%
+DATADIR=%%DATADIR%%
+
+MPD_NAME=mpd5
+CONFDIR="${PREFIX}/etc/${MPD_NAME}"
+
+mv_if_exists()
+{
+	file="$1"
+
+	if [ -f ${file} ]; then
+		mv ${file} ${file}.bak
+	fi
+}
+
+: ${DIALOG_OK=0}
+
+tempfile=$(mktemp -t ipv6pd)
+dialog --title "L2TP-IPv6PD Setup" --clear \
+       --mixedform "Please input L2TP-IPv6PD account information." 11 76 0 \
+       "User ID:"				1 1 "" 1 36 64 0 0 \
+       "Passwd:"				2 1 "" 2 36 64 0 0 \
+       "L2TP-IPv6PD Server (Fixed Prefix):"	3 1 "" 3 36 64 0 0 \
+       "Prefix Delegation Interface:"		4 1 "" 4 36 64 0 0 \
+       2> ${tempfile}
+retval=$?
+case ${retval} in
+${DIALOG_OK})
+	OIFS="${IFS}"
+	IFS=
+	exec < ${tempfile}
+	read ppp_id
+	read ppp_passwd
+	read fixed_server
+	read pd_interface
+	rm ${tempfile}
+	IFS="${OIFS}"
+
+	dialog --clear --title "L2TP-IPv6PD Setup" \
+	       --yesno "\
+User ID: ${ppp_id}
+Passwd: ${ppp_passwd}
+L2TP-IPv6PD Server: ${fixed_server}
+Prefix Delegation Interface: ${pd_interface}
+
+Is it okay to proceed?" 10 76
+	retval=$?
+	case ${retval} in
+	$DIALOG_OK)
+		break
+		;;
+	*)
+		exit
+		;;
+	esac
+	;;
+*)
+	rm ${tempfile}
+	exit
+	;;
+esac
+
+tempdir=$(mktemp -d -t ipv6pd)
+for infile in ${DATADIR}/*.in; do
+	outfile=${tempdir}/$(basename ${infile} .in)
+	sed -e "s|%%PPP_ID%%|${ppp_id}|g" \
+	    -e "s|%%PPP_PASSWD%%|${ppp_passwd}|g" \
+	    -e "s|%%FIXED_SERVER%%|${fixed_server}|g" \
+	    -e "s|%%PD_INTERFACE%%|${pd_interface}|g" \
+	    -e "s|%%CONFDIR%%|${CONFDIR}|g" \
+	    -e "s|%%_PREFIX_%%|${PREFIX}|g" \
+		< ${infile} > ${outfile}
+done
+
+CONF_FILES="dhcp6c.conf.in mpd.conf rtadvd.conf"
+SCRIPT_FILES="dhcp6c_pd.sh linkdown.sh linkup.sh"
+SECRET_FILES="mpd.secret"
+
+mkdir -p ${CONFDIR}
+for f in ${CONF_FILES}; do
+	mv_if_exists ${CONFDIR}/${f}
+	install -m 444 ${tempdir}/${f} ${CONFDIR}/${f}
+done
+for f in ${SCRIPT_FILES}; do
+	mv_if_exists ${CONFDIR}/${f}
+	install -m 555 ${tempdir}/${f} ${CONFDIR}/${f}
+done
+for f in ${SECRET_FILES}; do
+	mv_if_exists ${CONFDIR}/${f}
+	install -m 400 ${tempdir}/${f} ${CONFDIR}/${f}
+done
+mkdir -p /etc/rc.conf.d
+mv_if_exists /etc/rc.conf.d/${MPD_NAME}
+install -m 444 ${tempdir}/mpd /etc/rc.conf.d/${MPD_NAME}
+rm -rf ${tempdir}

Modified: head/net/mpd-l2tp-ipv6pd-client/pkg-descr
==============================================================================
--- head/net/mpd-l2tp-ipv6pd-client/pkg-descr	Sun Aug 17 16:36:13 2014	(r365201)
+++ head/net/mpd-l2tp-ipv6pd-client/pkg-descr	Sun Aug 17 16:45:25 2014	(r365202)
@@ -2,9 +2,4 @@ A sample implementaiton set of "L2TP-IPv
 "OCN IPv6", provided by NTT Communications Corp, was the first
 commercial tunnel service using "L2TP-IPv6PD".
 
-NOTE: This port runs on FreeBSD 6.3 and later.  If you want to run it
-on FreeBSD 6.2, you need to apply following diff to your ng_ksocket:
-
-http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netgraph/ng_ksocket.c.diff?r1=1.59&r2=1.60
-
 WWW: http://www.ocn.ne.jp/ipv6/service/pdf/ocnipv6uni_ver1.0.pdf



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