1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

Add support for mpd5.

This commit is contained in:
Hajimu UMEMOTO 2008-11-08 16:47:57 +00:00
parent 4ec0d07fc3
commit f9ab7db432
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=222546
5 changed files with 67 additions and 45 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= mpd-l2tp-ipv6pd-client
PORTVERSION= 20080101
PORTVERSION= 20081105
#PORTREVISION= 0
CATEGORIES= net ipv6
MASTER_SITES= # none
@ -15,16 +15,33 @@ DISTFILES= # none
MAINTAINER= ume@FreeBSD.org
COMMENT= A sample implementaiton set of "L2TP-IPv6PD" client using mpd
BUILD_DEPENDS= ${MPD_NAME}:${PORTSDIR}/net/${MPD_NAME}
RUN_DEPENDS= dhcp6ctl:${PORTSDIR}/net/dhcp6 \
${MPD_NAME}:${PORTSDIR}/net/${MPD_NAME}
MANUAL_PACKAGE_BUILD=yes
NO_PACKAGE= yes
USE_RC_SUBR= yes
OPTIONS= MPD4 "Use mpd4" on \
MPD5 "Use mpd5" off
.include <bsd.port.pre.mk>
.if defined(WITH_MPD5) && defined(WITH_MPD4)
BROKEN= Multiple mpd versions selected. Run 'make config' again!
.endif
.if defined(WITH_MPD4)
MPD_NAME= mpd4
MPD4= ""
.else
MPD_NAME= mpd5
MPD4= "@comment "
.endif
BUILD_DEPENDS= ${MPD_NAME}:${PORTSDIR}/net/${MPD_NAME}
RUN_DEPENDS= dhcp6ctl:${PORTSDIR}/net/dhcp6 \
${MPD_NAME}:${PORTSDIR}/net/${MPD_NAME}
CONF_DIR?= etc/${MPD_NAME}
CONF_FILES= dhcp6c.conf.in mpd.conf mpd.links rtadvd.conf
CONF_FILES= dhcp6c.conf.in rtadvd.conf
SCRIPT_FILES= dhcp6c_pd.sh linkdown.sh linkup.sh
SECRET_FILES= mpd.secret
@ -43,19 +60,12 @@ SCRIPTS_ENV= WRKDIR="${WRKDIR}" \
SED="${SED}" \
WHICH="${WHICH}"
PLIST_SUB= CONF_DIR="${CONF_DIR}" \
MPD_NAME="${MPD_NAME}"
PLIST_SUB= CONF_DIR=${CONF_DIR} \
MPD_NAME=${MPD_NAME} \
MPD4=${MPD4}
PKGMESSAGE= ${WRKDIR}/pkg-message
.if defined(WITH_MPD5)
MPD_NAME= mpd5
.else
MPD_NAME= mpd4
.endif
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 602106 || (${OSVERSION} >= 700000 && ${OSVERSION} < 700031)
IGNORE= does not work with old ng_ksocket
.endif
@ -76,6 +86,12 @@ do-install:
exit 1; \
fi
@${MKDIR} ${PREFIX}/${CONF_DIR}
.if defined(WITH_MPD4)
@${INSTALL_DATA} ${WRKDIR}/mpd.conf ${PREFIX}/${CONF_DIR}/mpd.conf
@${INSTALL_DATA} ${WRKDIR}/mpd.links ${PREFIX}/${CONF_DIR}/mpd.links
.else
@${INSTALL_DATA} ${WRKDIR}/mpd5.conf ${PREFIX}/${CONF_DIR}/mpd.conf
.endif
.for f in ${CONF_FILES}
@${INSTALL_DATA} ${WRKDIR}/${f} ${PREFIX}/${CONF_DIR}/${f}
.endfor

View File

@ -3,7 +3,7 @@
%%CONF_DIR%%/linkdown.sh
%%CONF_DIR%%/linkup.sh
%%CONF_DIR%%/mpd.conf
%%CONF_DIR%%/mpd.links
%%MPD4%%%%CONF_DIR%%/mpd.links
%%CONF_DIR%%/mpd.secret
%%CONF_DIR%%/%%MPD_NAME%%
%%CONF_DIR%%/rtadvd.conf

View File

@ -77,7 +77,7 @@ dhcp6c_pd_prestart()
# 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}
< ${dhcp6c_pd_conf_in} > ${dhcp6c_pd_conf}.${dhcp6c_pd_interface}
# create dhcp6cctlkey
#if [ ! -f ${prefix}/etc/dhcp6cctlkey ]; then
@ -115,16 +115,16 @@ dhcp6c_pd_stop()
}
load_rc_config ${name}
dhcp6c_pd_conf=${dhcp6c_pd_conf:-"${prefix}/%%CONF_DIR%%/dhcp6c.conf"}
dhcp6c_pd_conf_in=${dhcp6c_pd_conf_in:-"${prefix}/%%CONF_DIR%%/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:-"${prefix}/%%CONF_DIR%%/rtadvd.conf"}
required_files="${dhcp6c_pd_conf}.in"
required_files="${dhcp6c_pd_conf_in}"
pidfile=/var/run/dhcp6c-${dhcp6c_pd_interface}.pid
dhcp6c_pd_flags="-p ${pidfile} ${dhcp6c_pd_flags}"
command_args="-c ${dhcp6c_pd_conf}.${dhcp6c_pd_interface} ${dhcp6c_pd_interface}"
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

View File

@ -1,5 +1,5 @@
mpd_confdir="%%PREFIX%%/%%CONF_DIR%%"
mpd_interfaces="%%INTERFACE%%"
mpd_rundir="/var/run"
mpd_enable="YES"
mpd_flags="-b -d ${mpd_confdir}"
@ -8,7 +8,11 @@ stop_precmd="mpd_prestop"
mpd_prestop()
{
for iface in ${mpd_interfaces}; do
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

View File

@ -63,27 +63,29 @@ case $retval in
esac
# Set PPP Interface
tempfile=`${MKTEMP} -t ipv6pd`
${DIALOG} --title "L2TP-IPv6PD Setup Helper" \
--inputbox "Please Input PPP Interface (default: ng0):" -1 -1 \
2> ${tempfile}
case $retval in
0)
interface=`${CAT} ${tempfile}`
if [ -z "${interface}" ]; then
interface="ng0"
fi
${RM} ${tempfile}
;;
1)
${RM} ${tempfile}
exit
;;
255)
${RM} ${tempfile}
exit
;;
esac
if [ "${MPD_NAME}" = "mpd4" ]; then
tempfile=`${MKTEMP} -t ipv6pd`
${DIALOG} --title "L2TP-IPv6PD Setup Helper" \
--inputbox "Please Input PPP Interface (default: ng0):" \
-1 -1 2> ${tempfile}
case $retval in
0)
interface=`${CAT} ${tempfile}`
if [ -z "${interface}" ]; then
interface="ng0"
fi
${RM} ${tempfile}
;;
1)
${RM} ${tempfile}
exit
;;
255)
${RM} ${tempfile}
exit
;;
esac
fi
# Set Prefix Delegation Interface
tempfile=`${MKTEMP} -t ipv6pd`