aboutsummaryrefslogtreecommitdiffstats
path: root/security/cfs
diff options
context:
space:
mode:
authorjylefort <jylefort@FreeBSD.org>2005-06-08 19:11:08 +0800
committerjylefort <jylefort@FreeBSD.org>2005-06-08 19:11:08 +0800
commit170defcf271d8f14a354dc156a2590cf216d8de1 (patch)
tree910ab2042ae264ff3ea6f487c07adb5f1a96214e /security/cfs
parentf214e13b7bf5b2391a55431b7ff2fb8b8030dc84 (diff)
downloadfreebsd-ports-graphics-170defcf271d8f14a354dc156a2590cf216d8de1.tar.gz
freebsd-ports-graphics-170defcf271d8f14a354dc156a2590cf216d8de1.tar.zst
freebsd-ports-graphics-170defcf271d8f14a354dc156a2590cf216d8de1.zip
- convert cfsd.sh to rcNG
- add a CFS bootstrap directory to the port (${PREFIX}/cfsd-bootstrap) - mount that CFS bootstrap directory in cfsd.sh (default mountpoint is /crypt, configurable in /etc/rc.conf) - explain how to quickly setup cfsd in pkg-message - do display pkg-message - while here, use USE_RC_SUBR PR: ports/18800 Submitted by: Louis Mamakos <louie@TransSys.COM>, myself Approved by: green (maintainer)
Diffstat (limited to 'security/cfs')
-rw-r--r--security/cfs/Makefile13
-rw-r--r--security/cfs/files/cfsd.sh20
-rw-r--r--security/cfs/files/cfsd.sh.in51
-rw-r--r--security/cfs/files/pkg-message.in27
-rw-r--r--security/cfs/pkg-descr3
-rw-r--r--security/cfs/pkg-message2
-rw-r--r--security/cfs/pkg-plist3
7 files changed, 89 insertions, 30 deletions
diff --git a/security/cfs/Makefile b/security/cfs/Makefile
index bccc14bb6de..8f998252dc7 100644
--- a/security/cfs/Makefile
+++ b/security/cfs/Makefile
@@ -7,7 +7,7 @@
PORTNAME= cfs
PORTVERSION= 1.4.1
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= security
MASTER_SITES= http://www.crypto.com/software/
@@ -19,6 +19,12 @@ ALL_TARGET= cfs
MAN1= cattach.1 cdetach.1 cmkdir.1 cpasswd.1 cfssh.1
MAN8= ccat.8 cfsd.8 cname.8
+CFSD_BOOTSTRAP= ${PREFIX}/cfsd-bootstrap
+USE_RC_SUBR= cfsd.sh
+SUB_FILES= pkg-message
+SUB_LIST= CFSD_BOOTSTRAP=${CFSD_BOOTSTRAP}
+PLIST_SUB= CFSD_BOOTSTRAP=${CFSD_BOOTSTRAP}
+
post-patch:
${REINPLACE_CMD} 's/^\.TH SSH/.TH CFSSH/' ${WRKSRC}/cfssh.1
@@ -31,8 +37,7 @@ do-install:
${INSTALL_MAN} ${MAN8} ${PREFIX}/man/man8; \
${MKDIR} ${PREFIX}/share/doc/cfs; \
${INSTALL_DATA} README.install notes.ms ${PREFIX}/share/doc/cfs
- @if [ ! -f ${PREFIX}/etc/rc.d/cfsd.sh ]; then \
- ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/cfsd.sh ${PREFIX}/etc/rc.d/cfsd.sh; \
- fi
+ ${INSTALL} -d ${_BINOWNGRP} -m 0 ${CFSD_BOOTSTRAP}
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/security/cfs/files/cfsd.sh b/security/cfs/files/cfsd.sh
deleted file mode 100644
index f90fe91a375..00000000000
--- a/security/cfs/files/cfsd.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- [ -x ${PREFIX}/sbin/cfsd ] && ${PREFIX}/sbin/cfsd > /dev/null 2>&1 && echo -n ' cfsd'
- ;;
-stop)
- killall cfsd && echo -n ' cfsd'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/security/cfs/files/cfsd.sh.in b/security/cfs/files/cfsd.sh.in
new file mode 100644
index 00000000000..0a1f7afe330
--- /dev/null
+++ b/security/cfs/files/cfsd.sh.in
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: cfsd
+# REQUIRE: mountd
+
+#
+# Add the following line to /etc/rc.conf to enable cfsd:
+#
+# cfsd_enable="YES"
+#
+# Additional options:
+#
+# cfsd_port="3049" # the port to listen to
+# cfsd_mountpoint="/crypt" # the CFS mountpoint
+#
+
+. %%RC_SUBR%%
+
+name="cfsd"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/cfsd"
+start_postcmd="cfsd_poststart"
+stop_precmd="cfsd_prestop"
+
+cfsd_poststart()
+{
+ if [ -n "$cfsd_mountpoint" ]; then
+ mount -o port="$cfsd_port",nfsv2 localhost:%%CFSD_BOOTSTRAP%% "$cfsd_mountpoint"
+ fi
+}
+
+cfsd_prestop()
+{
+ if [ -n "$cfsd_mountpoint" ]; then
+ umount "$cfsd_mountpoint"
+ fi
+}
+
+load_rc_config $name
+: ${cfsd_enable="NO"}
+: ${cfsd_port="3049"}
+: ${cfsd_mountpoint="/crypt"}
+
+command_args="$cfsd_port >/dev/null 2>&1"
+required_dirs="%%CFSD_BOOTSTRAP%% $cfsd_mountpoint"
+
+run_rc_command "$1"
diff --git a/security/cfs/files/pkg-message.in b/security/cfs/files/pkg-message.in
new file mode 100644
index 00000000000..f4a1db7d745
--- /dev/null
+++ b/security/cfs/files/pkg-message.in
@@ -0,0 +1,27 @@
+===============================================================================
+Quick start instructions:
+
+ - add the following entry to /etc/exports:
+
+ %%CFSD_BOOTSTRAP%% localhost
+
+ - create the default CFS mountpoint (if you want to use a different
+ mountpoint, set the cfsd_mountpoint variable in /etc/rc.conf):
+
+ mkdir /crypt
+
+ - enable rpcbind, mountd and cfsd in /etc/rc.conf:
+
+ FreeBSD 4.x:
+
+ portmap_enable="YES"
+ single_mountd_enable="YES"
+ cfsd_enable="YES"
+
+ FreeBSD 5.x:
+
+ mountd_enable="YES"
+ cfsd_enable="YES"
+
+ - reboot the system
+===============================================================================
diff --git a/security/cfs/pkg-descr b/security/cfs/pkg-descr
index c6375f03677..1bf60c084c7 100644
--- a/security/cfs/pkg-descr
+++ b/security/cfs/pkg-descr
@@ -8,9 +8,6 @@ and the manual pages. There is a paper describing CFS at:
http://www.crypto.com/papers/cfs.pdf
-Under FreeBSD, the mount command for the CFS tree must include
-"-o port=3049,nfsv2".
-
WWW: http://www.crypto.com/software/
John Polstra <jdp@polstra.com>
diff --git a/security/cfs/pkg-message b/security/cfs/pkg-message
deleted file mode 100644
index 5078a34dd2d..00000000000
--- a/security/cfs/pkg-message
+++ /dev/null
@@ -1,2 +0,0 @@
-Please make sure to edit rc.conf(5) to include -L in the flags for
-rpcbind(8) if necessary.
diff --git a/security/cfs/pkg-plist b/security/cfs/pkg-plist
index 57db2769a61..b32516fed14 100644
--- a/security/cfs/pkg-plist
+++ b/security/cfs/pkg-plist
@@ -3,10 +3,11 @@ bin/cdetach
bin/cmkdir
bin/cpasswd
bin/cfssh
-etc/rc.d/cfsd.sh
sbin/ccat
sbin/cfsd
sbin/cname
share/doc/cfs/README.install
share/doc/cfs/notes.ms
+@exec install -d -o root -g wheel -m 0 %%CFSD_BOOTSTRAP%% 2>/dev/null || true
+@unexec rmdir %%CFSD_BOOTSTRAP%% 2>/dev/null || true
@dirrm share/doc/cfs