aboutsummaryrefslogtreecommitdiff
path: root/net-im/jabber/pkg-install
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/jabber/pkg-install')
-rw-r--r--net-im/jabber/pkg-install42
1 files changed, 27 insertions, 15 deletions
diff --git a/net-im/jabber/pkg-install b/net-im/jabber/pkg-install
index 926e79391c4c..1d8a161cc6b9 100644
--- a/net-im/jabber/pkg-install
+++ b/net-im/jabber/pkg-install
@@ -8,8 +8,10 @@ USER=jabber
GROUP=${USER}
UID=93
GID=${UID}
-SPOOLDIR="/var/spool/jabber"
ETCDIR=${PREFIX:-$PKG_PREFIX}/etc
+LOGDIR="/var/log/jabberd"
+PIDDIR="/var/run/jabberd"
+SPOOLDIR="/var/spool/jabberd"
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
if pw groupadd ${GROUP} -g ${GID}; then
@@ -32,6 +34,30 @@ if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
fi
fi
+if [ ! -f ${ETCDIR}/jabber.xml ]; then
+ echo "Creating \"${ETCDIR}/jabber.xml\"."
+ cp -p ${ETCDIR}/jabber.xml.dist ${ETCDIR}/jabber.xml
+fi
+
+echo "Fixing config files ownerships and modes."
+chown root:${GROUP} ${ETCDIR}/jabber.xml ${ETCDIR}/jabber.xml.dist
+chmod 640 ${ETCDIR}/jabber.xml ${ETCDIR}/jabber.xml.dist
+
+if [ ! -d ${LOGDIR} ]; then
+ echo "Creating \"${LOGDIR}\"."
+ mkdir -p ${LOGDIR}
+fi
+
+echo "Fixing ownerships and modes in \"${LOGDIR}\"."
+touch ${LOGDIR}/error.log ${LOGDIR}/record.log
+chown ${USER}:${GROUP} ${LOGDIR}/error.log ${LOGDIR}/record.log
+chmod 640 ${LOGDIR}/error.log ${LOGDIR}/record.log
+
+if [ ! -d ${PIDDIR} ]; then
+ echo "Creating \"${PIDDIR}\"."
+ mkdir -p ${PIDDIR}
+fi
+
if [ ! -d ${SPOOLDIR} ]; then
echo "Creating \"${SPOOLDIR}\"."
mkdir -p ${SPOOLDIR}
@@ -40,17 +66,3 @@ fi
echo "Fixing ownerships and modes in \"${SPOOLDIR}\"."
chown -R ${USER}:${GROUP} ${SPOOLDIR}
chmod -R go= ${SPOOLDIR}
-
-if [ ! -f ${ETCDIR}/jabber.xml ]; then
- echo "Creating \"${ETCDIR}/jabber.xml\"."
- cp -p ${ETCDIR}/jabber.xml.sample ${ETCDIR}/jabber.xml
-fi
-
-echo "Fixing config files ownerships and modes."
-chown root:${GROUP} ${ETCDIR}/jabber.xml ${ETCDIR}/jabber.xml.sample
-chmod 640 ${ETCDIR}/jabber.xml ${ETCDIR}/jabber.xml.sample
-
-echo "Fixing log files, ownerships and modes."
-touch /var/log/jabber.error /var/log/jabber.record
-chown ${USER}:${GROUP} /var/log/jabber.error /var/log/jabber.record
-chmod 640 /var/log/jabber.error /var/log/jabber.record