summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chat/silc-server/Makefile11
-rw-r--r--chat/silc-server/distinfo6
-rw-r--r--chat/silc-server/files/silcd.generic82
-rw-r--r--chat/silc-server/files/silcd.sh4
4 files changed, 95 insertions, 8 deletions
diff --git a/chat/silc-server/Makefile b/chat/silc-server/Makefile
index 6909c8431cb..48bbccfafec 100644
--- a/chat/silc-server/Makefile
+++ b/chat/silc-server/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.9 2002/03/29 11:34:51 rh Exp $
+# $NetBSD: Makefile,v 1.10 2002/05/03 22:02:49 hubertf Exp $
-DISTNAME= silc-server-0.8.1
+DISTNAME= silc-server-0.8.4
CATEGORIES= chat
MASTER_SITES= http://www.silcnet.org/download/server/sources/ \
ftp://ftp.silcnet.org/silc/server/sources/ \
@@ -52,8 +52,8 @@ DEINSTALL_EXTRA_TMPL= ${PKGDIR}/DEINSTALL
CONFIGURE_ARGS+= --with-docdir=${PREFIX}/share/doc/silcd
CONFIGURE_ARGS+= --with-etcdir=${PKG_SYSCONFDIR}
CONFIGURE_ARGS+= --with-silcd-config-file=${PKG_SYSCONFDIR}/silcd.conf
-CONFIGURE_ARGS+= --with-silcd-pid-file=/var/run/silcd.pid
CONFIGURE_ARGS+= --with-logsdir=/var/log/silcd
+CONFIGURE_ARGS+= --with-silcd-pid-file=/var/log/silcd/silcd.pid
CONFIGURE_ARGS+= --without-ncurses
# list it into IPv6-ready packages
@@ -69,8 +69,13 @@ CONFIGURE_ARGS+= --disable-asm
.endif
post-install:
+.if (${OPSYS} == "NetBSD")
@${SED} ${FILES_SUBST_SED} ${FILESDIR}/silcd.sh \
> ${PREFIX}/share/doc/silcd/silcd.default
+.else
+ @${SED} ${FILES_SUBST_SED} ${FILESDIR}/silcd.generic \
+ > ${PREFIX}/share/doc/silcd/silcd.default
+.endif
@${SED} ${FILES_SUBST_SED} ${FILESDIR}/motd.txt \
> ${PREFIX}/share/doc/silcd/motd.txt.default
diff --git a/chat/silc-server/distinfo b/chat/silc-server/distinfo
index a09cdb655fd..dc75aec118b 100644
--- a/chat/silc-server/distinfo
+++ b/chat/silc-server/distinfo
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.9 2002/03/29 11:34:51 rh Exp $
+$NetBSD: distinfo,v 1.10 2002/05/03 22:02:49 hubertf Exp $
-SHA1 (silc-server-0.8.1.tar.bz2) = fe2f3e677c5ef1580a888aa5b3c5b01ea229cca0
-Size (silc-server-0.8.1.tar.bz2) = 931438 bytes
+SHA1 (silc-server-0.8.4.tar.bz2) = 1549594faa6f21b760f4240ae167bc501efa3101
+Size (silc-server-0.8.4.tar.bz2) = 940368 bytes
SHA1 (patch-aa) = 97ccff02e5d2d1bd3ff64a1a1942525e5a4522bd
SHA1 (patch-ab) = 482b7580cb95a0833c85f64a3d94c16b2b1c984f
diff --git a/chat/silc-server/files/silcd.generic b/chat/silc-server/files/silcd.generic
new file mode 100644
index 00000000000..c8280e49670
--- /dev/null
+++ b/chat/silc-server/files/silcd.generic
@@ -0,0 +1,82 @@
+# $NetBSD: silcd.generic,v 1.1 2002/05/03 22:02:49 hubertf Exp $
+#
+
+KILL="/bin/kill"
+CAT="/bin/cat"
+RM="/bin/rm"
+
+name="silcd"
+confdir="@PKG_SYSCONFDIR@"
+required_files="$confdir/silcd.conf"
+required_dirs="/var/log/silcd"
+pidfile="/var/log/silcd/${name}.pid"
+command="@PREFIX@/sbin/silcd"
+start_precmd="silcd_precmd"
+
+silcd_precmd() {
+ if [ ! -f $confdir/silcd.prv ]; then
+ $command -C $confdir
+ fi
+}
+
+silcd_start() {
+ if [ ! -r $required_files ]; then
+ echo "$0: WARNING: $required_files is not readable."
+ exit 1
+ fi
+ if [ ! -d $required_dirs ]; then
+ echo "$0: WARNING: $required_dirs is not a directory."
+ exit 1
+ fi
+
+ eval $start_precmd
+ return_code=$?
+ if [ $return_code != "0" ]; then
+ exit 1
+ fi
+
+ echo "Starting ${name}."
+ eval $command
+ return_code=$?
+ if [ $return_code != "0" ]; then
+ exit 1
+ fi
+}
+
+
+silcd_stop() {
+ if [ -r $pidfile -a ! -z $pidfile ]; then
+ _pid=`${CAT} ${pidfile}`
+ else
+ echo "${name} not running?"
+ fi
+ if [ ${_pid:=0} -gt 1 -a ! "X$_pid" = "X " ]; then
+ echo "Stopping ${name}."
+ ${KILL} ${_pid}
+ return_code=$?
+ if [ $return_code != "0" ]; then
+ exit 1
+ fi
+ fi
+ ${RM} -f $pidfile
+}
+
+case $1 in
+
+'start')
+ silcd_start
+ ;;
+
+'stop')
+ silcd_stop
+ ;;
+
+'restart')
+ silcd_stop
+ silcd_start
+ ;;
+
+*)
+ echo "Usage: $0 (start|stop|restart)"
+ ;;
+esac
diff --git a/chat/silc-server/files/silcd.sh b/chat/silc-server/files/silcd.sh
index 91ba94bded0..60c255c95b9 100644
--- a/chat/silc-server/files/silcd.sh
+++ b/chat/silc-server/files/silcd.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: silcd.sh,v 1.3 2002/01/26 14:43:17 hubertf Exp $
+# $NetBSD: silcd.sh,v 1.4 2002/05/03 22:02:49 hubertf Exp $
#
# PROVIDE: silcd
# REQUIRE: DAEMON
@@ -15,7 +15,7 @@ rcvar=$name
confdir="@PKG_SYSCONFDIR@"
required_files="$confdir/silcd.conf"
required_dirs="/var/log/silcd"
-pidfile="/var/run/${name}.pid"
+pidfile="/var/log/silcd/${name}.pid"
command="@PREFIX@/sbin/silcd"
start_precmd="silcd_precmd"
stop_cmd="silcd_stop"