[Midnightbsd-cvs] mports: jabberd/files: Add supplimental files.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Dec 28 15:39:07 EST 2007


Log Message:
-----------
Add supplimental files.

Added Files:
-----------
    mports/net-im/jabberd/files:
        jabberd.in (r1.1)
        patch-sm-mod_iq_time.c (r1.1)
        pkg-deinstall.in (r1.1)
        pkg-install.in (r1.1)

-------------- next part --------------
--- /dev/null
+++ net-im/jabberd/files/pkg-install.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+# $FreeBSD: ports/net-im/jabberd/files/pkg-install.in,v 1.1 2007/07/26 20:00:52 mm Exp $
+
+if [ "$2" != "POST-INSTALL" ]; then
+    exit 0
+fi
+
+USER=%%JABBER_USER%%
+GROUP=%%JABBER_GROUP%%
+UID=%%JABBER_UID%%
+GID=%%JABBER_GID%%
+ETCDIR=%%JABBER_ETCDIR%%
+RUNDIR=%%JABBER_RUNDIR%%
+
+if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
+	if pw groupadd ${GROUP} -g ${GID}; then
+		echo "Added group \"${GROUP}\"."
+	else
+		echo "Adding group \"${GROUP}\" failed..."
+		exit 1
+	fi
+fi
+
+if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
+	if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+		-s "/sbin/nologin" -d "/nonexistent" \
+		-c "Jabber Daemon"; \
+	then
+		echo "Added user \"${USER}\"."
+	else
+		echo "Adding user \"${USER}\" failed..."
+		exit 1
+	fi
+fi
+
+if [ ! -d ${RUNDIR} ]; then
+	echo "Creating \"${RUNDIR}\"."
+	mkdir -p ${RUNDIR}/pid ${RUNDIR}/db ${RUNDIR}/logs
+fi
+
+echo "Fixing ownerships and modes in \"${ETCDIR}\"."
+chown -R ${USER}:${GROUP} ${ETCDIR}
+chmod -R go= ${ETCDIR}
+
+echo "Fixing ownerships and modes in \"${RUNDIR}\"."
+chown -R ${USER}:${GROUP} ${RUNDIR}
+chmod -R go= ${RUNDIR}
--- /dev/null
+++ net-im/jabberd/files/patch-sm-mod_iq_time.c
@@ -0,0 +1,11 @@
+--- sm/mod_iq_time.c.orig	2007-10-17 21:15:26.000000000 +0200
++++ sm/mod_iq_time.c	2007-10-21 22:13:05.000000000 +0200
+@@ -77,7 +77,7 @@
+ 
+     datetime_out(t, dt_DATETIME, buf, 64);
+     nad_insert_elem(pkt->nad, 2, NAD_ENS(pkt->nad, 1), "utc", buf);
+-#ifdef HAVE_TZSET
++#ifdef HAVE_TZNAME
+     snprintf(buf, 64, "%+03d:%02d", -((int)timezone)/(60*60), -((int)timezone)%(60*60));
+ #else
+     snprintf(buf, 64, "%+03d:%02d", (int) tm->tm_gmtoff/(60*60), (int) tm->tm_gmtoff%(60*60));
--- /dev/null
+++ net-im/jabberd/files/jabberd.in
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# $FreeBSD: ports/net-im/jabberd/files/jabberd.in,v 1.1 2007/07/26 20:00:52 mm Exp $
+
+# PROVIDE: jabberd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+#
+prefix=%%PREFIX%%
+
+# Define these jabberd_* variables in one of these files:
+#       /etc/rc.conf
+#       /etc/rc.conf.local
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+jabberd_chdir=${jabberd_chdir-"%%JABBER_RUNDIR%%/pid"}
+jabberd_enable=${jabberd_enable-"NO"}
+jabberd_user=${jabberd_user-"%%JABBER_USER%%"}
+
+. %%RC_SUBR%%
+
+name="jabberd"
+rcvar=`set_rcvar`
+command="${prefix}/bin/jabberd"
+command_args="&"
+procname="${prefix}/bin/router"
+
+load_rc_config $name
+
+pidfile="${jabberd_chdir}/router.pid"
+
+case "$1" in
+	stop|faststop|onestop)
+		echo "Stopping Jabber2"
+		killall -u ${jabberd_user} jabberd c2s resolver router s2s sm
+		for file in c2s resolver router s2s sm; do
+			rm -f ${jabberd_chdir}/$file.pid
+		done
+	;;
+	*)
+		run_rc_command "$1"
+	;;
+esac
--- /dev/null
+++ net-im/jabberd/files/pkg-deinstall.in
@@ -0,0 +1,23 @@
+#!/bin/sh
+# $FreeBSD: ports/net-im/jabberd/files/pkg-deinstall.in,v 1.1 2007/07/26 20:00:52 mm Exp $
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+    exit 0
+fi
+
+USER=%%JABBER_USER%%
+GROUP=%%JABBER_GROUP%%
+RUNDIR="%%JABBER_RUNDIR%%"
+
+if pw usershow "${USER}" 2>/dev/null 1>&2; then
+	echo "To delete Jabber user permanently, use 'pw userdel ${USER}'"
+fi
+
+if pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
+	echo "To delete Jabber group permanently, use 'pw groupdel ${USER}'"
+fi
+
+echo "You may want to delete the following directories:"
+echo "${RUNDIR}" 
+
+exit 0


More information about the Midnightbsd-cvs mailing list