diff options
author | jmmv <jmmv@pkgsrc.org> | 2003-07-31 10:05:52 +0000 |
---|---|---|
committer | jmmv <jmmv@pkgsrc.org> | 2003-07-31 10:05:52 +0000 |
commit | e569e99cf2f7d29a78634716ad501761c396d5ec (patch) | |
tree | 530be8b92a1e86333e7daed0ba8f17d797640422 /security | |
parent | e173909669bcd018af6741de53b547062288e91f (diff) | |
download | pkgsrc-e569e99cf2f7d29a78634716ad501761c396d5ec.tar.gz |
Convert the rc.d script to the rc.subr framework and use RCD_SCRIPTS from
bsd.pkg.install.mk to handle its generation and installation.
While here, switch to buildlink2. Bump PKGREVISION to 1.
Diffstat (limited to 'security')
-rw-r--r-- | security/cfs/Makefile | 13 | ||||
-rw-r--r-- | security/cfs/files/cfsd.sh | 106 |
2 files changed, 18 insertions, 101 deletions
diff --git a/security/cfs/Makefile b/security/cfs/Makefile index 69981f4a63c..238990d4da4 100644 --- a/security/cfs/Makefile +++ b/security/cfs/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.11 2003/07/21 17:20:06 martti Exp $ +# $NetBSD: Makefile,v 1.12 2003/07/31 10:05:52 jmmv Exp $ DISTNAME= cfs-1.4.1 +PKGREVISION= 1 CATEGORIES= security MASTER_SITES= http://www.crypto.com/software/ @@ -8,6 +9,9 @@ MAINTAINER= tech-pkg@NetBSD.org HOMEPAGE= http://www.crypto.com/software/ COMMENT= Encrypting file system, using NFS as its interface +USE_BUILDLINK2= YES +USE_PKGINSTALL= YES + CRYPTO= # defined ALL_TARGET= cfs @@ -68,6 +72,8 @@ CFS_SUBST_SED= ${CFS_SUBST:S/->/!/:S/$/!g/:S/^/ -e s!/} DOCDIR= ${PREFIX}/share/doc/cfs +RCD_SCRIPTS= cfsd + post-extract: ${RM} -f ${WRKSRC}/esm.1 @@ -90,12 +96,7 @@ do-build: cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} \ ${SH} ${CFS_BUILD_SCRIPT} ${ALL_TARGET} -pre-install: - ${SED} -e "s|@PREFIX@|${PREFIX}|g" \ - ${FILESDIR}/cfsd.sh > ${WRKDIR}/cfsd.sh - post-install: - ${INSTALL_SCRIPT} ${WRKDIR}/cfsd.sh ${PREFIX}/etc/rc.d/cfsd cd ${WRKSRC}; for file in *.1; do \ ${INSTALL_MAN} $${file} ${PREFIX}/man/man1/$${file}; \ done diff --git a/security/cfs/files/cfsd.sh b/security/cfs/files/cfsd.sh index 1500dc9d737..30179d7100d 100644 --- a/security/cfs/files/cfsd.sh +++ b/security/cfs/files/cfsd.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: cfsd.sh,v 1.3 2001/06/07 15:35:14 jlam Exp $ +# $NetBSD: cfsd.sh,v 1.4 2003/07/31 10:05:53 jmmv Exp $ # # PROVIDE: cfsd # REQUIRE: mountd @@ -8,104 +8,20 @@ # To start cfsd at startup, copy this script to /etc/rc.d and set # cfs=YES in /etc/rc.conf. +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr +fi + name="cfsd" rcvar=$name command="@PREFIX@/sbin/${name}" command_args="> /dev/null 2>&1" required_vars="mountd rpcbind" -# set defaults -if [ -r /etc/rc.conf ] -then - . /etc/rc.conf +if [ -f /etc/rc.subr ]; then + load_rc_config "$name" + run_rc_command "$1" else - eval ${rcvar}=YES -fi - -# $flags from environment overrides ${rcvar}_flags -if [ -n "${flags}" ] -then - eval ${rcvar}_flags="${flags}" -fi - -checkyesno() -{ - eval _value=\$${1} - case $_value in - [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0 ;; - [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1 ;; - *) - echo "\$${1} is not set properly." - return 1 - ;; - esac -} - -cmd=${1:-start} -case ${cmd} in -force*) - cmd=${cmd#force} - forcecmd=YES - eval ${rcvar}=YES - ;; -esac - -required_vars="${rcvar} ${required_vars}" -pid_cmd="ps ax | awk '{print \$1,\$5}' | grep ${name} | awk '{print \$1}'" - -for _var in ${required_vars} -do - if ! checkyesno ${_var} - then - echo "\$${_var} is not set." - if [ -z "${forcecmd}" ] - then - exit 1 - fi - fi -done - -if [ -x ${command} ] -then - # Execute any relevant precmd. - eval precmd="\$${rcvar}_${cmd}_precmd" - if ! eval ${precmd} && [ -z "${forcecmd}" ] - then - exit 1 - fi - - case ${cmd} in - start) - echo "Starting ${name}." - eval ${command} ${cfsd_flags} ${command_args} - ;; - stop) - pid=`eval ${pid_cmd}` - if [ -z "${pid}" ] - then - echo "${name} not running?" - exit 1 - fi - echo "Stopping ${name}." - kill ${pid} - ;; - restart) - ( $0 forcestop ) - sleep 5 - $0 forcestart - ;; - status) - pid=`eval ${pid_cmd}` - if [ -n "${pid}" ]; then - echo "${name} is running as pid ${pid}." - else - echo "${name} is not running." - exit 1 - fi - ;; - *) - echo 1>&2 "Usage: $0 [restart|start|stop|status]" - exit 1 - ;; - esac + printf " $name" + eval ${command} ${cfsd_flags} ${command_args} fi |