aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkuriyama <kuriyama@FreeBSD.org>2004-08-26 17:18:58 +0800
committerkuriyama <kuriyama@FreeBSD.org>2004-08-26 17:18:58 +0800
commit721339b9a90af805daab2e2d9388ff409a93bd6e (patch)
tree9bd99b3131e0f282888466fbf8a01eb5ace120ca
parentb3b846ae9e8a979e78e26121dc63407090b8e632 (diff)
downloadfreebsd-ports-gnome-721339b9a90af805daab2e2d9388ff409a93bd6e.tar.gz
freebsd-ports-gnome-721339b9a90af805daab2e2d9388ff409a93bd6e.tar.zst
freebsd-ports-gnome-721339b9a90af805daab2e2d9388ff409a93bd6e.zip
- USE_RC_SUBR'ify.
- Add knob to use simokawa's patch to enable extended mode.
-rw-r--r--net/vtun/Makefile15
-rw-r--r--net/vtun/files/extra-tun_dev.c13
-rw-r--r--net/vtun/files/vtunclient.sh27
-rw-r--r--net/vtun/files/vtund.sh26
-rw-r--r--net/vtun/pkg-plist2
5 files changed, 83 insertions, 0 deletions
diff --git a/net/vtun/Makefile b/net/vtun/Makefile
index dbd876ce1e7b..85d05f44f033 100644
--- a/net/vtun/Makefile
+++ b/net/vtun/Makefile
@@ -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>
diff --git a/net/vtun/files/extra-tun_dev.c b/net/vtun/files/extra-tun_dev.c
new file mode 100644
index 000000000000..d0f18a1c337d
--- /dev/null
+++ b/net/vtun/files/extra-tun_dev.c
@@ -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);
+ }
diff --git a/net/vtun/files/vtunclient.sh b/net/vtun/files/vtunclient.sh
new file mode 100644
index 000000000000..c4bcef6a873e
--- /dev/null
+++ b/net/vtun/files/vtunclient.sh
@@ -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"
diff --git a/net/vtun/files/vtund.sh b/net/vtun/files/vtund.sh
new file mode 100644
index 000000000000..f218c3a449a4
--- /dev/null
+++ b/net/vtun/files/vtund.sh
@@ -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"
diff --git a/net/vtun/pkg-plist b/net/vtun/pkg-plist
index 7275cb11cd1d..8912ba9fca55 100644
--- a/net/vtun/pkg-plist
+++ b/net/vtun/pkg-plist
@@ -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