mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-31 10:46:16 +00:00
- USE_RC_SUBR'ify.
- Add knob to use simokawa's patch to enable extended mode.
This commit is contained in:
parent
eb888f36a8
commit
f1309ae3e1
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=117301
@ -28,10 +28,23 @@ CONFIGURE_ARGS= --localstatedir=/var \
|
||||
--with-lzo-headers=${LOCALBASE}/include \
|
||||
--with-lzo-lib=${LOCALBASE}/lib
|
||||
CONFIGURE_ENV= YACC=${YACC}
|
||||
USE_RC_SUBR= yes
|
||||
|
||||
WRKSRC= ${WRKDIR}/vtun
|
||||
|
||||
ALL_TARGET= vtund
|
||||
RC_SCRIPT_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
|
||||
|
||||
.if defined(VTUN_EXTENDED_MODE)
|
||||
# Obtained from http://home.jp.FreeBSD.org/~simokawa/vtun-v6.html
|
||||
EXTRA_PATCHES= ${FILESDIR}/extra-tun_dev.c
|
||||
.endif
|
||||
|
||||
post-build:
|
||||
@${SED} ${RC_SCRIPT_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
<${FILESDIR}/vtund.sh >${WRKDIR}/vtund.sh
|
||||
@${SED} ${RC_SCRIPT_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
<${FILESDIR}/vtunclient.sh >${WRKDIR}/vtunclient.sh
|
||||
|
||||
post-install:
|
||||
@${INSTALL_DATA} ${WRKSRC}/vtund.conf ${PREFIX}/etc/vtund.conf.example
|
||||
@ -39,5 +52,7 @@ post-install:
|
||||
.for doc in FAQ README README.Setup README.Shaper
|
||||
@${INSTALL_DATA} ${WRKSRC}/${doc} ${PREFIX}/share/doc/vtund
|
||||
.endfor
|
||||
@${INSTALL_SCRIPT} ${WRKDIR}/vtund.sh ${PREFIX}/etc/rc.d
|
||||
@${INSTALL_SCRIPT} ${WRKDIR}/vtunclient.sh ${PREFIX}/etc/rc.d
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
13
net/vtun/files/extra-tun_dev.c
Normal file
13
net/vtun/files/extra-tun_dev.c
Normal file
@ -0,0 +1,13 @@
|
||||
--- freebsd/tun_dev.c.orig Thu Aug 26 16:45:24 2004
|
||||
+++ freebsd/tun_dev.c Thu Aug 26 16:45:42 2004
|
||||
@@ -58,8 +58,8 @@
|
||||
}
|
||||
}
|
||||
if( fd > -1 ){
|
||||
- i=0;
|
||||
- /* Disable extended modes */
|
||||
+ i=1;
|
||||
+ /* Enable extended modes */
|
||||
ioctl(fd, TUNSLMODE, &i);
|
||||
ioctl(fd, TUNSIFHEAD, &i);
|
||||
}
|
27
net/vtun/files/vtunclient.sh
Normal file
27
net/vtun/files/vtunclient.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# PROVIDE: vtunclient
|
||||
# REQUIRE: DAEMON
|
||||
# KEYWORD: FreeBSD
|
||||
#
|
||||
# Add the following line to /etc/rc.conf to enable vtunclient:
|
||||
#
|
||||
# vtunclient_enable="YES"
|
||||
# vtunclient_flags="<session> <server address>"
|
||||
#
|
||||
|
||||
vtunclient_enable=${vtunclient_enable:-"NO"}
|
||||
vtunclient_flags=${vtunclient_flags:-""}
|
||||
|
||||
. %%RC_SUBR%%
|
||||
|
||||
name=vtunclient
|
||||
rcvar=`set_rcvar`
|
||||
required_files="%%PREFIX%%/etc/vtund.conf"
|
||||
|
||||
command=%%PREFIX%%/sbin/vtund
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
26
net/vtun/files/vtund.sh
Normal file
26
net/vtun/files/vtund.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# PROVIDE: vtund
|
||||
# REQUIRE: DAEMON
|
||||
# KEYWORD: FreeBSD
|
||||
#
|
||||
# Add the following line to /etc/rc.conf to enable vtund:
|
||||
#
|
||||
# vtund_enable="YES"
|
||||
#
|
||||
|
||||
vtund_enable=${vtund_enable:-"NO"}
|
||||
vtund_flags=${vtund_flags:-"-s"}
|
||||
|
||||
. %%RC_SUBR%%
|
||||
|
||||
name=vtund
|
||||
rcvar=`set_rcvar`
|
||||
required_files="%%PREFIX%%/etc/vtund.conf"
|
||||
|
||||
command=%%PREFIX%%/sbin/vtund
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
@ -1,5 +1,7 @@
|
||||
@unexec if cmp -s %D/etc/vtund.conf.example %D/etc/vtund.conf; then rm -f %D/etc/vtund.conf; fi
|
||||
etc/vtund.conf.example
|
||||
etc/rc.d/vtunclient.sh
|
||||
etc/rc.d/vtund.sh
|
||||
sbin/vtund
|
||||
share/doc/vtund/FAQ
|
||||
share/doc/vtund/README
|
||||
|
Loading…
Reference in New Issue
Block a user