aboutsummaryrefslogtreecommitdiff
path: root/net-im
diff options
context:
space:
mode:
authorDmitry Sivachenko <demon@FreeBSD.org>2003-12-30 16:18:46 +0000
committerDmitry Sivachenko <demon@FreeBSD.org>2003-12-30 16:18:46 +0000
commit644a81b2674b9205b44f46c8d0a301a31e98d8bc (patch)
treee63ff81be77046e3b45d57bcb7a206471ad5383c /net-im
parent447ce828f4cf58092f6dfc06e474697e7c1de312 (diff)
downloadports-644a81b2674b9205b44f46c8d0a301a31e98d8bc.tar.gz
ports-644a81b2674b9205b44f46c8d0a301a31e98d8bc.zip
Notes
Diffstat (limited to 'net-im')
-rw-r--r--net-im/jabberd/Makefile10
-rw-r--r--net-im/jabberd/files/jabberd.sh27
-rw-r--r--net-im/jabberd/pkg-deinstall15
-rw-r--r--net-im/jabberd/pkg-install34
-rw-r--r--net-im/jabberd/pkg-plist1
5 files changed, 87 insertions, 0 deletions
diff --git a/net-im/jabberd/Makefile b/net-im/jabberd/Makefile
index 654e27fd84ae..0701a64d3d0f 100644
--- a/net-im/jabberd/Makefile
+++ b/net-im/jabberd/Makefile
@@ -61,4 +61,14 @@ pre-everything::
@${ECHO} "WITH_LDAP use LDAP for authentication"
@${ECHO}
+pre-install:
+ PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
+post-install:
+ ${INSTALL_DATA} ${FILESDIR}/jabberd.sh ${PREFIX}/etc/rc.d/jabberd.sh-dist
+ @if [ ! -f ${PREFIX}/etc/rc.d/jabberd.sh ]; then \
+ ${ECHO} "Installing ${PREFIX}/etc/rc.d/jabberd.sh startup file."; \
+ ${INSTALL_SCRIPT} ${FILESDIR}/jabberd.sh ${PREFIX}/etc/rc.d/jabberd.sh; \
+ fi
+
.include <bsd.port.mk>
diff --git a/net-im/jabberd/files/jabberd.sh b/net-im/jabberd/files/jabberd.sh
new file mode 100644
index 000000000000..26cdf2e7e5b4
--- /dev/null
+++ b/net-im/jabberd/files/jabberd.sh
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jabberd\.sh\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
+USER="jabber"
+RUNDIR="/var/tmp"
+HOSTNAME=`/bin/hostname`
+
+test -x ${PREFIX}/bin/jabberd || exit 1
+
+export PATH=/sbin:/bin:/usr/bin:${PREFIX}/bin:${PREFIX}/sbin
+umask 077
+
+echo -n " jabberd"
+cd ${RUNDIR} || exit
+
+case ${1:-start} in
+start)
+ su -f -m ${USER} -c "jabberd" ;;
+
+stop)
+ killall -SIGKILL -u ${USER} jabberd;
+ rm -f ${RUNDIR}/jabber.pid;
+esac
diff --git a/net-im/jabberd/pkg-deinstall b/net-im/jabberd/pkg-deinstall
new file mode 100644
index 000000000000..400091411f19
--- /dev/null
+++ b/net-im/jabberd/pkg-deinstall
@@ -0,0 +1,15 @@
+#!/bin/sh
+# $FreeBSD$
+#
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+ exit 0
+fi
+
+USER=jabber
+
+if pw usershow "${USER}" 2>/dev/null 1>&2; then
+ echo "To delete Jabber user permanently, use 'pw userdel ${USER}'"
+fi
+
+exit 0
diff --git a/net-im/jabberd/pkg-install b/net-im/jabberd/pkg-install
new file mode 100644
index 000000000000..43cb7753583f
--- /dev/null
+++ b/net-im/jabberd/pkg-install
@@ -0,0 +1,34 @@
+#!/bin/sh
+# $FreeBSD$
+#
+
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+USER=jabber
+GROUP=${USER}
+UID=93
+GID=${UID}
+
+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
+exit 0
diff --git a/net-im/jabberd/pkg-plist b/net-im/jabberd/pkg-plist
index a80feb8a4541..571ec6c7b55e 100644
--- a/net-im/jabberd/pkg-plist
+++ b/net-im/jabberd/pkg-plist
@@ -12,5 +12,6 @@ etc/jabberd/router.xml.dist
etc/jabberd/s2s.xml.dist
etc/jabberd/sm.xml.dist
etc/jabberd/templates/roster.xml.dist
+etc/rc.d/jabberd.sh-dist
@dirrm etc/jabberd/templates
@dirrm etc/jabberd