summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2005-03-01 22:15:34 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2005-03-01 22:15:34 +0000
commit84e12198e264b16f0f1dd9ad1a4ad0a18fb02a0c (patch)
treea4b5f8983c4dc9a0d01c4699c29ef8aa517c3cc7 /www
parentFix plist (diff)
Switch aolserver to start using rc.subr in startup script.
Auto-generate pkg-message to avoid hardcoding /usr/local.
Notes
Notes: svn path=/head/; revision=130127
Diffstat (limited to 'www')
-rw-r--r--www/aolserver/Makefile6
-rw-r--r--www/aolserver/files/aolserver.sh44
-rw-r--r--www/aolserver/files/pkg-message.in (renamed from www/aolserver/pkg-message)2
3 files changed, 35 insertions, 17 deletions
diff --git a/www/aolserver/Makefile b/www/aolserver/Makefile
index d359c612bac8..b87ff4e0f331 100644
--- a/www/aolserver/Makefile
+++ b/www/aolserver/Makefile
@@ -20,6 +20,10 @@ WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
USE_GMAKE= yes
+USE_RC_SUBR= YES
+PKGMESSAGE= ${WRKDIR}/pkg-message
+SUB_FILES= pkg-message
+
INSTALL_TARGET= install INST=${PREFIX}/${PORTNAME}
post-extract:
@@ -49,6 +53,6 @@ post-install:
>${PREFIX}/etc/rc.d/aolserver.sh ; \
${CHMOD} 755 ${PREFIX}/etc/rc.d/aolserver.sh; \
fi
- @${CAT} ${PKGDIR}/pkg-message
+ @${CAT} ${WRKDIR}/pkg-message
.include <bsd.port.mk>
diff --git a/www/aolserver/files/aolserver.sh b/www/aolserver/files/aolserver.sh
index 2f9a840bb11d..834d58fff005 100644
--- a/www/aolserver/files/aolserver.sh
+++ b/www/aolserver/files/aolserver.sh
@@ -1,21 +1,35 @@
-#!/bin/sh
+#! /bin/sh
+#
+#
+# PROVIDE: aolserver
+# REQUIRE: DAEMON NETWORKING SERVERS
+# KEYWORD: FreeBSD
+#
+# Add the following line to /etc/rc.conf to enable aolserver:
+#
+# aolserver_enable="YES"
+#
+# Tweakable parameters for users to override in rc.conf
-PREFIX=%%PREFIX%%/aolserver
-CONFIG=${PREFIX}/nsd.tcl
+aolserver_enable=NO
+aolserver_home=%%PREFIX%%/aolserver
+aolserver_conf=${aolserver_home}/nsd.tcl
+aolserver_flags="-t ${aolserver_conf} -u nobody -g nobody"
+aolserver_prog=nsd8x
-case "$1" in
+. /etc/rc.subr
-start)
- ${PREFIX}/bin/nsd8x -t ${CONFIG} -u nobody -g nobody
- ;;
+name=aolserver
+rcvar=$(set_rcvar)
+required_files=${aolserver_conf}
+command=${aolserver_home}/bin/${aolserver_prog}
+procname=${aolserver_home}/bin/${aolserver_prog}
-stop)
- ${PREFIX}/bin/nsd8x -t ${CONFIG} -u nobody -g nobody -K
- ;;
+stop_cmd="stop_cmd"
-*)
- echo "usage: $0 {start|stop}" 1>&2
- exit 64
- ;;
+stop_cmd() {
+ ${command} ${aolserver_flags} -K
+}
-esac
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/www/aolserver/pkg-message b/www/aolserver/files/pkg-message.in
index 5560d868c81a..0343be321bea 100644
--- a/www/aolserver/pkg-message
+++ b/www/aolserver/files/pkg-message.in
@@ -1,5 +1,5 @@
-Assuming you have changed to /usr/local, please copy
+Assuming you have changed to %%PREFIX%%, please copy
aolserver/sample-config.tcl to aolserver/nsd.tcl and season to taste.
An example server is in at aolserver/servers/server1, and you should
similarly copy the contents of this directory to, e.g.,