summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorYen-Ming Lee <leeym@FreeBSD.org>2005-04-24 18:05:01 +0000
committerYen-Ming Lee <leeym@FreeBSD.org>2005-04-24 18:05:01 +0000
commita63390009c908b3baa08c9a4b771b58495b4f0f6 (patch)
treecf0cc631f93dd2a5b7a6f9fe5f3467dad3306c16 /security
parentAutoconf is not necessary to build this port (diff)
- replace FILESDIR/patch-* with REINPLACE_CMD ...
- replace pkg-plist with PORTDOCS and PLIST_FILES - add USE_RC_SUBR support - rndcontrol retired on 5.x already, so only show messages on 4.x PR: 73317 Submitted by: leeym Approved by: maintainer timeout
Notes
Notes: svn path=/head/; revision=134072
Diffstat (limited to 'security')
-rw-r--r--security/vpnd/Makefile25
-rw-r--r--security/vpnd/files/patch-Makefile.FreeBSD.in13
-rw-r--r--security/vpnd/files/patch-README12
-rw-r--r--security/vpnd/files/patch-globals.c14
-rw-r--r--security/vpnd/files/patch-vpnd.c21
-rw-r--r--security/vpnd/files/patch-vpnd.conf56
-rw-r--r--security/vpnd/files/patch-vpnd.h11
-rw-r--r--security/vpnd/files/vpnd.sh24
-rw-r--r--security/vpnd/pkg-plist8
9 files changed, 39 insertions, 145 deletions
diff --git a/security/vpnd/Makefile b/security/vpnd/Makefile
index 14c50273bfb1..4d28a9a03fa3 100644
--- a/security/vpnd/Makefile
+++ b/security/vpnd/Makefile
@@ -17,33 +17,38 @@ COMMENT= VPN daemon offering transparent blowfish encryption between networks
WRKSRC= ${WRKDIR}/${PORTNAME}
HAS_CONFIGURE= yes
USE_REINPLACE= yes
+USE_RC_SUBR= yes
-DOCFILES= README FAQ.TXT SPEED.TXT VERSIONS
+PLIST_FILES= sbin/vpnd etc/rc.d/vpnd.sh etc/vpnd.conf.sample etc/vpnd.chat.sample
+PORTDOCS= README FAQ.TXT SPEED.TXT VERSIONS
post-patch:
- @${MV} ${WRKSRC}/Makefile.FreeBSD.in ${WRKSRC}/Makefile.FreeBSD.in_tmp
- @${SED} -e "s:^ETC_DIR=:ETC_DIR= ${PREFIX}/etc:" \
- < ${WRKSRC}/Makefile.FreeBSD.in_tmp > ${WRKSRC}/Makefile.FreeBSD.in
-
-pre-configure:
- ${REINPLACE_CMD} -e "s@-O3@${CFLAGS}@g; s@gcc@${CC}@g" \
- ${WRKSRC}/configure
+.for f in README globals.c vpnd.c vpnd.conf
+ @${REINPLACE_CMD} -e 's,/etc,${PREFIX}/etc,g' ${WRKSRC}/${f}
+.endfor
+ @${REINPLACE_CMD} -e "s,machine/param.h,sys/param.h,g" ${WRKSRC}/vpnd.h
+ @${REINPLACE_CMD} -e "s@-O3@${CFLAGS}@g; s@gcc@${CC}@g" ${WRKSRC}/${CONFIGURE_SCRIPT}
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/vpnd ${PREFIX}/sbin/vpnd
+ @${INSTALL_SCRIPT} ${FILESDIR}/vpnd.sh ${PREFIX}/etc/rc.d/vpnd.sh
@${INSTALL_DATA} ${WRKSRC}/vpnd.conf ${PREFIX}/etc/vpnd.conf.sample
@${INSTALL_DATA} ${WRKSRC}/vpnd.chat ${PREFIX}/etc/vpnd.chat.sample
.if !defined(NOPORTDOCS)
@${INSTALL} -d -m 0755 ${DOCSDIR}
-.for i in ${DOCFILES}
+.for i in ${PORTDOCS}
@${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.endif
+.include <bsd.port.pre.mk>
+
post-install:
+.if ${OSVERSION} < 500000
@${ECHO} "================================================================================"
@${ECHO} "Make sure you set up a few IRQ's for random generation with rndcontrol before"
@${ECHO} "trying to generate a master key file."
@${ECHO} "================================================================================"
+.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/security/vpnd/files/patch-Makefile.FreeBSD.in b/security/vpnd/files/patch-Makefile.FreeBSD.in
deleted file mode 100644
index b7df2e7e068f..000000000000
--- a/security/vpnd/files/patch-Makefile.FreeBSD.in
+++ /dev/null
@@ -1,13 +0,0 @@
---- Makefile.FreeBSD.in.orig Fri Nov 19 17:50:24 1999
-+++ Makefile.FreeBSD.in Sun Mar 25 01:39:56 2001
-@@ -5,7 +5,9 @@
- CRYPTOFLG=
- .endif
-
--CFLAGS=-c $(CBASE) $(DEBUG) $(CRYPTOFLG) -DMD5_HMAC_FAST -DSHA1_HMAC_FAST -DRMD160_HMAC_FAST
-+ETC_DIR=
-+
-+CFLAGS=-c $(CBASE) $(DEBUG) $(CRYPTOFLG) -DMD5_HMAC_FAST -DSHA1_HMAC_FAST -DRMD160_HMAC_FAST -DETC_DIR=\"$(ETC_DIR)\"
-
- OBJS1=vpnd.o globals.o parse.o slip.o route.o chatter.o serial.o die.o \
- signal.o tcp.o external.o syslog.o sequencer.o icmp.o rxtx.o crypto.o \
diff --git a/security/vpnd/files/patch-README b/security/vpnd/files/patch-README
deleted file mode 100644
index e9b453910312..000000000000
--- a/security/vpnd/files/patch-README
+++ /dev/null
@@ -1,12 +0,0 @@
---- README.old Sun Mar 25 03:05:42 2001
-+++ README Sun Mar 25 03:06:04 2001
-@@ -370,8 +370,8 @@
- ========
-
- Copy vpnd (and randomd if it is required) to any directory you like.
--Copy vpnd.conf and vpnd.chat to /etc or copy those files to any other
--directory when you use the -f option of vpnd (see later). Note that
-+Copy vpnd.conf and vpnd.chat to /usr/local/etc or copy those files to any
-+other directory when you use the -f option of vpnd (see later). Note that
- vpnd.conf and vpnd.chat must be at least mode 644 and be owned by
- root:root.
diff --git a/security/vpnd/files/patch-globals.c b/security/vpnd/files/patch-globals.c
deleted file mode 100644
index f387dd26e08d..000000000000
--- a/security/vpnd/files/patch-globals.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- globals.c.old Sun Mar 25 01:19:51 2001
-+++ globals.c Sun Mar 25 01:20:58 2001
-@@ -69,9 +69,9 @@
- anchor->pty=anchor->tty=anchor->peer=anchor->server=anchor->ping=
- anchor->serial=anchor->lock=-1;
- anchor->speed=B115200;
-- anchor->conffile="/etc/vpnd.conf";
-+ anchor->conffile=ETC_DIR "/vpnd.conf";
- anchor->randomdev="/dev/random";
-- anchor->keyfile="/etc/vpnd.key";
-+ anchor->keyfile=ETC_DIR "/vpnd.key";
- anchor->lkeyfile="vpnd.lcl.key";
- anchor->rkeyfile="vpnd.rmt.key";
- anchor->cipher=BLOWFISH;
diff --git a/security/vpnd/files/patch-vpnd.c b/security/vpnd/files/patch-vpnd.c
deleted file mode 100644
index 4cdd12573cdc..000000000000
--- a/security/vpnd/files/patch-vpnd.c
+++ /dev/null
@@ -1,21 +0,0 @@
---- vpnd.c.old Sun Mar 25 01:58:06 2001
-+++ vpnd.c Sun Mar 25 03:02:26 2001
-@@ -41,7 +41,8 @@
- " vpnd -c <extended-master-key-file>\n" \
- USAGE1 \
- " -h prints this info\n" \
-- " -m creates master key file (default is /etc/vpnd.key),\n" \
-+ " -m creates master key file (default is " ETC_DIR \
-+ "/vpnd.key),\n" \
- " note that the file must not yet exist\n" \
- " -x creates extended master key files named vpnd.lcl.key\n" \
- " and vpnd.rmt.key in the given directory,\n" \
-@@ -65,7 +66,7 @@
- " -l allow dns lookups so host names can be used\n" \
- " -n do not become daemon\n" \
- " -t do modem init chat test\n" \
-- " -f use configfile instead of /etc/vpnd.conf\n" \
-+ " -f use configfile instead of " ETC_DIR "/vpnd.conf\n" \
- COMPRESSINFO
-
- /*
diff --git a/security/vpnd/files/patch-vpnd.conf b/security/vpnd/files/patch-vpnd.conf
deleted file mode 100644
index f5b8c542c1d2..000000000000
--- a/security/vpnd/files/patch-vpnd.conf
+++ /dev/null
@@ -1,56 +0,0 @@
---- vpnd.conf.old Sun Mar 25 03:04:06 2001
-+++ vpnd.conf Sun Mar 25 03:04:43 2001
-@@ -121,7 +121,7 @@
- # which is called asynchonously when the vpn
- # link is established
- #
--# example: linkup /etc/vpnd.linkup
-+# example: linkup /usr/local/etc/vpnd.linkup
- #
- # linkdown <process-pathname>
- #
-@@ -129,7 +129,7 @@
- # which is called asynchonously when the vpn
- # link is terminated
- #
--# example: linkdown /etc/vpnd.linkdown
-+# example: linkdown /usr/local/etc/vpnd.linkdown
- #
- # ---------------------------------------------------
- # basic operation mode
-@@ -170,7 +170,7 @@
- #
- # optional, defines the pathname of the shared secret file which
- # must be created with the -m option of vpnd, if not given default
--# of /etc/vpnd.key is used
-+# of /usr/local/etc/vpnd.key is used
- #
- # example: keyfile /var/adm/mysecret.key
- #
-@@ -285,7 +285,7 @@
- # interface is established, the SLIP interface
- # name is the parameter for the process
- #
--# example: slipup /etc/vpnd.slipup
-+# example: slipup /usr/local/etc/vpnd.slipup
- #
- # slipdown <process-pathname>
- #
-@@ -294,7 +294,7 @@
- # link is terminated, the SLIP interface
- # name is the parameter for the process
- #
--# example: slipdown /etc/vpnd.slipdown
-+# example: slipdown /usr/local/etc/vpnd.slipdown
- #
- #
- # ---------------------------------------------------
-@@ -334,7 +334,7 @@
- # optional, pathname of file containing modem initialization
- # chat sequence, default is not to perform init chat
- #
--# example: modemchat /etc/vpnd.chat
-+# example: modemchat /usr/local/etc/vpnd.chat
- #
- # ---------------------------------------------------
- # TCP/IP parameters (available with version 1.0.2)
diff --git a/security/vpnd/files/patch-vpnd.h b/security/vpnd/files/patch-vpnd.h
deleted file mode 100644
index 5ec54f28193e..000000000000
--- a/security/vpnd/files/patch-vpnd.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- vpnd.h.orig Sun Oct 20 14:36:45 2002
-+++ vpnd.h Sun Oct 20 14:37:04 2002
-@@ -52,7 +52,7 @@
- #include <net/if.h>
- #include <net/slip.h>
- #include <net/if_var.h>
--#include <machine/param.h>
-+#include <sys/param.h>
- #include <sys/mbuf.h>
- #include <net/slcompress.h>
- #include <net/if_slvar.h>
diff --git a/security/vpnd/files/vpnd.sh b/security/vpnd/files/vpnd.sh
new file mode 100644
index 000000000000..9ec0fa7f8b83
--- /dev/null
+++ b/security/vpnd/files/vpnd.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# PROVIDE: vpnd
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+#
+# Note:
+# Set "vpnd_enable=yes" in either /etc/rc.conf, /etc/rc.conf.local or
+# /etc/rc.conf.d/vpnd to make this script actually do something.
+#
+# Please see rc.conf(5) and rc(8) for further details.
+#
+
+vpnd_enable=${vpnd_enable:-"NO"}
+
+. /etc/rc.subr
+
+name=vpnd
+command=/usr/local/sbin/vpnd
+rcvar=`set_rcvar`
+load_rc_config ${name}
+
+run_rc_command "$1"
diff --git a/security/vpnd/pkg-plist b/security/vpnd/pkg-plist
deleted file mode 100644
index ee2d8c4ff9c4..000000000000
--- a/security/vpnd/pkg-plist
+++ /dev/null
@@ -1,8 +0,0 @@
-sbin/vpnd
-etc/vpnd.conf.sample
-etc/vpnd.chat.sample
-%%PORTDOCS%%share/doc/vpnd/README
-%%PORTDOCS%%share/doc/vpnd/FAQ.TXT
-%%PORTDOCS%%share/doc/vpnd/SPEED.TXT
-%%PORTDOCS%%share/doc/vpnd/VERSIONS
-%%PORTDOCS%%@dirrm share/doc/vpnd