aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorkrion <krion@FreeBSD.org>2004-08-25 17:16:16 +0800
committerkrion <krion@FreeBSD.org>2004-08-25 17:16:16 +0800
commitf51c1316066f4ff7b7aad6f3ab2a8fc04fb7dce8 (patch)
tree61b8d48ae980269535d4a51478e3bdf298a17efc /misc
parent7b394110c79e2498408d84cff1eda93455607946 (diff)
downloadfreebsd-ports-gnome-f51c1316066f4ff7b7aad6f3ab2a8fc04fb7dce8.tar.gz
freebsd-ports-gnome-f51c1316066f4ff7b7aad6f3ab2a8fc04fb7dce8.tar.zst
freebsd-ports-gnome-f51c1316066f4ff7b7aad6f3ab2a8fc04fb7dce8.zip
Use RCNG
Minor tidyups PR: ports/70861 Submitted by: maintainer
Diffstat (limited to 'misc')
-rw-r--r--misc/dnetc/Makefile11
-rw-r--r--misc/dnetc/files/dnetc.sh56
-rw-r--r--misc/dnetc/pkg-plist2
3 files changed, 32 insertions, 37 deletions
diff --git a/misc/dnetc/Makefile b/misc/dnetc/Makefile
index b3b025dfe06d..5e20ae3469c1 100644
--- a/misc/dnetc/Makefile
+++ b/misc/dnetc/Makefile
@@ -24,6 +24,7 @@ MD5_FILE= ${MASTERDIR}/distinfo.${ARCH}
ONLY_FOR_ARCHS= i386 alpha sparc64 amd64
+USE_RC_SUBR= yes
NO_BUILD= yes
BINDIR= ${PREFIX}/distributed.net
@@ -52,17 +53,15 @@ VERSION= 2.9008.491
IGNORE= "This port requires FreeBSD 3.X or greater."
.endif
-.if exists(${PREFIX}/distributed.net/rc5des)
-BROKEN= "rc5des/dnetc conflict: Please deinstall all rc5des ports/packages first."
-.endif
-
post-extract:
@${SED} -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' -e 's#%%CLIENTGROUP%%#${CLIENTGROUP}#' \
-e 's#%%CLIENTUID%%#${CLIENTUID}#g' ${MASTERDIR}/pkg-install > ${PKGINSTALL}
@${SED} -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' -e 's#%%CLIENTGROUP%%#${CLIENTGROUP}#' \
${MASTERDIR}/pkg-deinstall > ${PKGDEINSTALL}
@${SED} -e 's#%%BINDIR%%#${BINDIR}#' ${MASTERDIR}/pkg-message > ${PKGMESSAGE}
- @${SED} -e 's#%%BINDIR%%#${BINDIR}#' -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' \
+ @${SED} -e 's#%%BINDIR%%#${BINDIR}#' \
+ -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' \
+ -e 's#%%RC_SUBR%%#${RC_SUBR}#g' \
${FILESDIR}/dnetc.sh > ${WRKDIR}/dnetc.sh
do-configure:
@@ -86,7 +85,7 @@ do-install:
${INSTALL_DATA} ${FILESDIR}/INFO ${BINDIR}
${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1
- ${INSTALL_SCRIPT} ${WRKDIR}/dnetc.sh ${PREFIX}/etc/rc.d/dnetc.sh.sample
+ ${INSTALL_SCRIPT} ${WRKDIR}/dnetc.sh ${PREFIX}/etc/rc.d/dnetc.sh
${INSTALL} -c -m 644 -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc.ini ${BINDIR}/dnetc.ini.sample
.if !exists(${BINDIR}/dnetc.ini)
diff --git a/misc/dnetc/files/dnetc.sh b/misc/dnetc/files/dnetc.sh
index ed7c39e4fe6f..1b8af10307f7 100644
--- a/misc/dnetc/files/dnetc.sh
+++ b/misc/dnetc/files/dnetc.sh
@@ -1,41 +1,37 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: dnetc
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+dnetc_enable=${dnetc_enable:-"NO"}
dir="%%BINDIR%%"
user="%%CLIENTUSER%%"
-case "$1" in
-start)
- if [ ! -d $dir ]; then
- logger -i "dnetc client directory doesn't exist. ($dir)."
- exit
- fi
+. %%RC_SUBR%%
- if [ ! -f $dir/dnetc ]; then
- logger -i "dnetc client doesn't exist. ($dir/dnetc)."
- exit
- fi
+name="dnetc"
+rcvar=`set_rcvar`
- if [ ! -f $dir/dnetc.ini ]; then
- logger -i "dnetc client config file doesn't exist. ($dir/dnetc.ini)."
- exit
- fi
+required_files=${dir}/dnetc.ini
- email=`grep "^id=" $dir/dnetc.ini|cut -d"=" -f2`
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
- if [ "$email" = "rc5@distributed.net" ]; then
- logger -i "dnetc client running with default email address. ($email)"
- fi
+dnetc_start()
+{
+ echo -n " dnetc"
+ su -m ${user} -c "${dir}/dnetc -quiet" 2>/dev/null >/dev/null
+}
+dnetc_stop()
+{
echo -n " dnetc"
- su -m $user -c "$dir/dnetc -quiet" 2>/dev/null >/dev/null &
- ;;
-stop)
- killall -u $user dnetc && echo -n " dnetc"
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- exit 64
- ;;
-esac
-
-exit 0
+ su -m ${user} -c "${dir}/dnetc -shutdown" 2>/dev/null >/dev/null
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/misc/dnetc/pkg-plist b/misc/dnetc/pkg-plist
index a621da54a467..2c708af56079 100644
--- a/misc/dnetc/pkg-plist
+++ b/misc/dnetc/pkg-plist
@@ -3,5 +3,5 @@ distributed.net/INFO
@unexec if cmp -s %D/distributed.net/dnetc.ini %D/distributed.net/dnetc.ini.sample; then rm -f %D/distributed.net/dnetc.ini; fi
distributed.net/dnetc.ini.sample
@exec [ -f %B/dnetc.ini ] || cp %B/%f %B/dnetc.ini
-etc/rc.d/dnetc.sh.sample
+etc/rc.d/dnetc.sh
@dirrm distributed.net