aboutsummaryrefslogtreecommitdiffstats
path: root/net-im/ejabberd/files
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-03-16 16:38:32 +0800
committerdelphij <delphij@FreeBSD.org>2009-03-16 16:38:32 +0800
commit1edfe0c2b7ff83a5737b8121bec31b43eaf121ca (patch)
tree5cee6906203d7bc2acafdac02dbdac49285161ff /net-im/ejabberd/files
parent15fe5880032de2a0e9816d1f5278cf01c10f4123 (diff)
downloadfreebsd-ports-gnome-1edfe0c2b7ff83a5737b8121bec31b43eaf121ca.tar.gz
freebsd-ports-gnome-1edfe0c2b7ff83a5737b8121bec31b43eaf121ca.tar.zst
freebsd-ports-gnome-1edfe0c2b7ff83a5737b8121bec31b43eaf121ca.zip
Update to 2.0.3.
Submitted by: "Mikle Davidkin" <skylord linkline ru> PR: 128463 Approved by: maintainer timeout
Diffstat (limited to 'net-im/ejabberd/files')
-rw-r--r--net-im/ejabberd/files/ejabberd.defaults13
-rw-r--r--net-im/ejabberd/files/ejabberd.in114
-rw-r--r--net-im/ejabberd/files/ejabberd.inetrc3
-rw-r--r--net-im/ejabberd/files/ejabberd.sh.in75
-rw-r--r--net-im/ejabberd/files/patch-ejab-446.diff14
-rw-r--r--net-im/ejabberd/files/patch-src-Makefile.in43
-rw-r--r--net-im/ejabberd/files/patch-src::ejabberdctl.template35
-rw-r--r--net-im/ejabberd/files/patch-src::mod_last.erl20
-rw-r--r--net-im/ejabberd/files/pkg-install.in38
-rw-r--r--net-im/ejabberd/files/pkg-message.in20
10 files changed, 189 insertions, 186 deletions
diff --git a/net-im/ejabberd/files/ejabberd.defaults b/net-im/ejabberd/files/ejabberd.defaults
deleted file mode 100644
index f079642b3f43..000000000000
--- a/net-im/ejabberd/files/ejabberd.defaults
+++ /dev/null
@@ -1,13 +0,0 @@
-# Additionnal options passed to erlang while starting ejabberd.
-# See erl(3) for more info
-# default options already passed are:
-# -noshell -detached
-#export ERL_OPTIONS="-heart"
-
-# To use more than 1024 connections, you will need to set environment variable ERL_MAX_PORTS:
-#export ERL_MAX_PORTS=1024
-
-# To reduce memory usage, you can set environment variable ERL_FULLSWEEP_AFTER:
-# But in this case ejabberd may work slower.
-#export ERL_FULLSWEEP_AFTER=0
-
diff --git a/net-im/ejabberd/files/ejabberd.in b/net-im/ejabberd/files/ejabberd.in
index 737cd534f9d7..5132de022550 100644
--- a/net-im/ejabberd/files/ejabberd.in
+++ b/net-im/ejabberd/files/ejabberd.in
@@ -1,36 +1,80 @@
-#!/bin/sh
-
-[ -f %%PREFIX%%/etc/%%PORTNAME%%/%%PORTNAME%%.defaults ] && . %%PREFIX%%/etc/%%PORTNAME%%/%%PORTNAME%%.defaults
-
-CONFIG=%%PREFIX%%/etc/%%PORTNAME%%/%%PORTNAME%%.cfg
-INETRC=%%PREFIX%%/etc/%%PORTNAME%%/%%PORTNAME%%.inetrc
-LOG=/var/log/%%PORTNAME%%/%%PORTNAME%%.log
-SASL_LOG=/var/log/%%PORTNAME%%/sasl.log
-SPOOL=/var/spool/%%PORTNAME%%
-
-ARGS=
-
-while [ $# -ne 0 ]
-do
- PARAM=$1
- shift
- case $PARAM in
- --) break ;;
- --config) CONFIG=$1 ; shift ;;
- --log) LOG=$1 ; shift ;;
- --sasl-log) SASL_LOG=$1 ; shift ;;
- --spool) SPOOL=$1 ; shift ;;
- *) ARGS="$ARGS $PARAM" ;;
- esac
-done
-
-cd $SPOOL &&
-exec erl +K true -sname %%PORTNAME%% \
- -s %%PORTNAME%% \
- -%%PORTNAME%% config \"$CONFIG\" log_path \"$LOG\" \
- -sasl sasl_error_logger \{file,\"$SASL_LOG\"\} \
- -mnesia dir \"$SPOOL\" \
- -kernel inetrc \"${INETRC}\" \
- -pz "%%LOCALBASE%%/lib/erlang/" \
- $ERL_OPTIONS $ARGS "$@"
+#! /bin/sh
+# $FreeBSD$
+# PROVIDE: ejabberd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Define these ejabberd_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/ejabberd
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+ejabberd_enable=${ejabberd_enable-"NO"}
+ejabberd_node=${ejabberd_node-"ejabberd@localhost"}
+
+. %%RC_SUBR%%
+
+name="ejabberd"
+rcvar=`set_rcvar`
+
+reload_cmd="ejabberd_reload"
+restart_cmd="ejabberd_reload"
+start_cmd="ejabberd_start"
+status_cmd="ejabberd_status"
+stop_cmd="ejabberd_stop"
+
+extra_commands="reload status"
+
+EJABBERDCTL=%%PREFIX%%/sbin/ejabberdctl
+EJABBERDUSER=ejabberd
+
+ejabberd_status()
+{
+ if ejabberd_checkstatus; then
+ echo "$name is running "
+ else
+ echo "$name is not running "
+ fi
+}
+
+ejabberd_checkstatus()
+{
+ su $EJABBERDUSER -c "$EJABBERDCTL --node $ejabberd_node status > /dev/null"
+}
+
+ejabberd_start()
+{
+ echo -n "Starting $name: "
+ su $EJABBERDUSER -c "$EJABBERDCTL --node $ejabberd_node start"
+ echo "$name."
+}
+
+ejabberd_stop()
+{
+ echo -n "Stopping $name: "
+ if su $EJABBERDUSER -c "$EJABBERDCTL --node $ejabberd_node stop"; then
+# sleep 2
+# killall -u ejabberd -kill
+ else
+ echo -n " failed "
+ fi
+ echo "$name."
+}
+
+ejabberd_reload()
+{
+ echo -n "Restarting $name: "
+ if ejabberd_checkstatus; then
+ su $EJABBERDUSER -c "$EJABBERDCTL --node $ejabberd_node restart"
+ else
+ ejabberd_start
+ fi
+ echo "$name."
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net-im/ejabberd/files/ejabberd.inetrc b/net-im/ejabberd/files/ejabberd.inetrc
deleted file mode 100644
index 73fc40a010af..000000000000
--- a/net-im/ejabberd/files/ejabberd.inetrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{lookup,["file","native"]}.
-{host,{127,0,0,1}, ["localhost","hostalias"]}.
-{file, resolv, "/etc/resolv.conf"}.
diff --git a/net-im/ejabberd/files/ejabberd.sh.in b/net-im/ejabberd/files/ejabberd.sh.in
deleted file mode 100644
index 54421cb29669..000000000000
--- a/net-im/ejabberd/files/ejabberd.sh.in
+++ /dev/null
@@ -1,75 +0,0 @@
-#! /bin/sh
-# $FreeBSD$
-
-# PROVIDE: ejabberd
-# REQUIRE: DAEMON
-# BEFORE: LOGIN
-# KEYWORD: shutdown
-
-# Define these ejabberd_* variables in one of these files:
-# /etc/rc.conf
-# /etc/rc.conf.local
-# /etc/rc.conf.d/ejabberd
-#
-# DO NOT CHANGE THESE DEFAULT VALUES HERE
-#
-ejabberd_enable="${ejabberd_enable-NO}"
-
-. %%RC_SUBR%%
-
-name=ejabberd
-rcvar=`set_rcvar`
-
-reload_cmd="ejabberd_reload"
-restart_cmd="ejabberd_reload"
-start_cmd="ejabberd_start"
-status_cmd="ejabberd_status"
-stop_cmd="ejabberd_stop"
-
-cd %%PREFIX%% # Why is this needed!?
-
-# Include ejabberd defaults if available
-[ -f %%PREFIX%%/etc/ejabberd/ejabberd.defaults ] && . %%PREFIX%%/etc/ejabberd/ejabberd.defaults
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin
-EJABBERD=%%PREFIX%%/bin/ejabberd
-EJABBERDCTL=%%PREFIX%%/bin/ejabberdctl
-EJABBERDUSER=ejabberd
-
-ejabberd_status()
-{
- su $EJABBERDUSER -c "$EJABBERDCTL ejabberd@`hostname -s` status >/dev/null"
-}
-
-ejabberd_start()
-{
- echo -n "Starting $name: "
- su $EJABBERDUSER -c "$EJABBERD -s -noshell -detached"
- echo "$name."
-}
-
-ejabberd_stop()
-{
- echo -n "Stopping $name: "
- if su $EJABBERDUSER -c "$EJABBERDCTL ejabberd@`hostname -s` stop"; then
- sleep 2
- killall -u ejabberd -kill
- else
- echo -n " failed "
- fi
- echo "$name."
-}
-
-ejabberd_reload()
-{
- echo -n "Restarting $name: "
- if ejabberd_status; then
- su $EJABBERDUSER -c "$EJABBERDCTL ejabberd@`hostname -s` restart"
- else
- ejabberd_start
- fi
- echo "$name."
-}
-
-load_rc_config $name
-run_rc_command "$1"
diff --git a/net-im/ejabberd/files/patch-ejab-446.diff b/net-im/ejabberd/files/patch-ejab-446.diff
deleted file mode 100644
index 14a996c96488..000000000000
--- a/net-im/ejabberd/files/patch-ejab-446.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: ejabberd_s2s_in.erl
-===================================================================
---- ejabberd_s2s_in.erl (revision 1026)
-+++ ejabberd_s2s_in.erl (working copy)
-@@ -30,8 +30,7 @@
-
- -include("ejabberd.hrl").
- -include("jlib.hrl").
---include_lib("ssl/include/PKIX1Explicit88.hrl").
---include_lib("ssl/include/PKIX1Implicit88.hrl").
-+-include_lib("ssl/include/OTP-PKIX.hrl").
- -include("XmppAddr.hrl").
-
- -define(DICT, dict).
diff --git a/net-im/ejabberd/files/patch-src-Makefile.in b/net-im/ejabberd/files/patch-src-Makefile.in
index 44a88ca445e8..70648598a4b0 100644
--- a/net-im/ejabberd/files/patch-src-Makefile.in
+++ b/net-im/ejabberd/files/patch-src-Makefile.in
@@ -1,32 +1,43 @@
---- Makefile.in.orig 2007-04-30 08:08:01.000000000 +0100
-+++ Makefile.in 2007-10-30 01:26:29.000000000 +0000
-@@ -32,15 +32,15 @@
- SOURCES = $(wildcard *.erl)
+--- Makefile.in.orig 2009-01-14 12:54:15.000000000 +0300
++++ Makefile.in 2009-01-24 18:45:50.000000000 +0300
+@@ -56,18 +56,18 @@
+ ERLBEHAVBEAMS = $(ERLBEHAVS:.erl=.beam)
BEAMS = $(SOURCES:.erl=.beam)
--DESTDIR =
+-DESTDIR =
-
--EJABBERDDIR = $(DESTDIR)@prefix@/var/lib/ejabberd
+-EJABBERDDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
+DESTDIR = @prefix@
+
+EJABBERDDIR = $(DESTDIR)/lib/erlang/lib/ejabberd-$(PORTVERSION)
BEAMDIR = $(EJABBERDDIR)/ebin
+-SPOOLDIR = $(EJABBERDDIR)/db
++SPOOLDIR = /var/spool/ejabberd
PRIVDIR = $(EJABBERDDIR)/priv
SODIR = $(PRIVDIR)/lib
+ PBINDIR = $(PRIVDIR)/bin
MSGSDIR = $(PRIVDIR)/msgs
--LOGDIR = $(DESTDIR)@prefix@/var/log/ejabberd
--ETCDIR = $(DESTDIR)@prefix@/etc/ejabberd
+-LOGDIR = $(DESTDIR)@localstatedir@/log/ejabberd
+-ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
+-SBINDIR = $(DESTDIR)@sbindir@
+LOGDIR = /var/log/ejabberd
+ETCDIR = $(DESTDIR)/etc/ejabberd
++SBINDIR = @sbindir@
- ASN_FLAGS = -bber_bin +der +compact_bit_string +optimize +noobj
-
-@@ -89,7 +89,7 @@
+ ifeq ($(shell uname),Darwin)
+ DYNAMIC_LIB_CFLAGS = -fPIC -bundle -flat_namespace -undefined suppress
+@@ -122,10 +122,10 @@
install -d $(MSGSDIR)
install -m 644 msgs/*.msg $(MSGSDIR)
- install -d $(ETCDIR)
+ install -d -m 750 $(ETCDIR)
- [ -f $(ETCDIR)/ejabberd.cfg ] && install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new || install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
-+ install -b -m 644 ejabberd.cfg.example $(ETCDIR)
- install -d $(LOGDIR)
-
- clean: clean-recursive clean-local
+- sed -e "s*@rootdir@*@prefix@*" -e "s*@erl@*@ERL@*" ejabberdctl.template > ejabberdctl.example
+- [ -f $(ETCDIR)/ejabberdctl.cfg ] && install -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new || install -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
+- install -b -m 644 inetrc $(ETCDIR)/inetrc
++ install -m 640 ejabberd.cfg.example $(ETCDIR)
++ sed -e "s*@rootdir@*@prefix@*" -e "s*@erl@*@ERL@*" -e "s*lib/erlang/lib/ejabberd*lib/erlang/lib/ejabberd-$(PORTVERSION)*" ejabberdctl.template > ejabberdctl.example
++ install -m 640 ejabberdctl.cfg.example $(ETCDIR)
++ install -m 640 inetrc $(ETCDIR)/inetrc.example
+ install -d $(SBINDIR)
+ install -m 755 ejabberdctl.example $(SBINDIR)/ejabberdctl
+ install -d -m 750 $(LOGDIR)
diff --git a/net-im/ejabberd/files/patch-src::ejabberdctl.template b/net-im/ejabberd/files/patch-src::ejabberdctl.template
new file mode 100644
index 000000000000..fe04d5cf2539
--- /dev/null
+++ b/net-im/ejabberd/files/patch-src::ejabberdctl.template
@@ -0,0 +1,35 @@
+--- ejabberdctl.template.orig 2009-01-14 12:54:15.000000000 +0300
++++ ejabberdctl.template 2009-01-24 18:32:15.000000000 +0300
+@@ -14,8 +14,8 @@
+ ERL=@erl@
+ ROOTDIR=@rootdir@
+ EJABBERD_CONFIG_PATH=$ROOTDIR/etc/ejabberd/ejabberd.cfg
+-LOGS_DIR=$ROOTDIR/var/log/ejabberd/
+-EJABBERD_DB=$ROOTDIR/var/lib/ejabberd/db/$NODE
++LOGS_DIR=/var/log/ejabberd/
++EJABBERD_DB=/var/spool/ejabberd/$NODE
+
+ # read custom configuration
+ CONFIG=$ROOTDIR/etc/ejabberd/ejabberdctl.cfg
+@@ -43,16 +43,16 @@
+ ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES"
+
+ # define additional environment variables
+-EJABBERD_EBIN=$ROOTDIR/var/lib/ejabberd/ebin
+-EJABBERD_MSGS_PATH=$ROOTDIR/var/lib/ejabberd/priv/msgs
+-EJABBERD_SO_PATH=$ROOTDIR/var/lib/ejabberd/priv/lib
+-EJABBERD_BIN_PATH=$ROOTDIR/var/lib/ejabberd/priv/bin
++HOME=$ROOTDIR/lib/erlang/lib/ejabberd
++EJABBERD_EBIN=$HOME/ebin
++EJABBERD_MSGS_PATH=$HOME/priv/msgs
++EJABBERD_SO_PATH=$HOME/priv/lib
++EJABBERD_BIN_PATH=$HOME/priv/bin
+ EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
+ SASL_LOG_PATH=$LOGS_DIR/sasl.log
+ DATETIME=`date "+%Y%m%d-%H%M%S"`
+ ERL_CRASH_DUMP=$LOGS_DIR/erl_crash_$DATETIME.dump
+ ERL_INETRC=$ROOTDIR/etc/ejabberd/inetrc
+-HOME=$ROOTDIR/var/lib/ejabberd
+
+ # export global variables
+ export EJABBERD_CONFIG_PATH
diff --git a/net-im/ejabberd/files/patch-src::mod_last.erl b/net-im/ejabberd/files/patch-src::mod_last.erl
deleted file mode 100644
index 81ebfe6e4a88..000000000000
--- a/net-im/ejabberd/files/patch-src::mod_last.erl
+++ /dev/null
@@ -1,20 +0,0 @@
---- mod_last.erl.orig
-+++ mod_last.erl
-@@ -102,7 +102,16 @@
- sub_el = [{xmlelement, "query",
- [{"xmlns", ?NS_LAST},
- {"seconds", integer_to_list(Sec)}],
-- [{xmlcdata, Status}]}]}
-+ [{xmlcdata, Status}]}]};
-+ [{last_activity, _, TimeStamp}] ->
-+ {MegaSecs, Secs, _MicroSecs} = now(),
-+ TimeStamp2 = MegaSecs * 1000000 + Secs,
-+ Sec = TimeStamp2 - TimeStamp,
-+ IQ#iq{type = result,
-+ sub_el = [{xmlelement, "query",
-+ [{"xmlns", ?NS_LAST},
-+ {"seconds", integer_to_list(Sec)}],
-+ []}]}
- end.
-
-
diff --git a/net-im/ejabberd/files/pkg-install.in b/net-im/ejabberd/files/pkg-install.in
new file mode 100644
index 000000000000..ca83f6f813fc
--- /dev/null
+++ b/net-im/ejabberd/files/pkg-install.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+if [ x"$2" != x"POST-INSTALL" ]; then
+ exit 0
+fi
+
+USER=ejabberd
+GROUP=${USER}
+UID=543
+GID=${UID}
+USERS_HOME="/var/spool/ejabberd"
+
+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 "/bin/sh" -d ${USERS_HOME} -c "ejabberd pseudo user"; \
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+fi
+
+install -d -m 750 -o ${USER} -g ${GROUP} ${USERS_HOME} /var/log/ejabberd
+
+chown -R ${USER}:${GROUP} %%PREFIX%%/etc/%%PORTNAME%%
+chown -R ${USER}:${GROUP} %%PREFIX%%/lib/erlang/lib/%%PORTNAME%%-%%PORTVERSION%%
+
+exit 0
diff --git a/net-im/ejabberd/files/pkg-message.in b/net-im/ejabberd/files/pkg-message.in
index be842583c38f..c91c3f7babd1 100644
--- a/net-im/ejabberd/files/pkg-message.in
+++ b/net-im/ejabberd/files/pkg-message.in
@@ -1,16 +1,16 @@
-WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING!!!
+------------------------------------------------------------------------
+
+Congratulations, you have installed %%PORTNAME%%!
-This version of port has several signigicant changes:
o To enable ejabberd you need to add following string to your /etc/rc.conf:
ejabberd_enable="YES"
- o Configs are located in %%PREFIX%%/etc/ejabberd now.
- o The home directory is /var/spool/ejabberd now instead of
- /var/run/ejabberd. Please do:
-
- pw usermod ejabberd -d /var/spool/ejabberd
-
- if you need it.
+ o Config samples are located in %%PREFIX%%/etc/ejabberd - please, create
+ working ones before running %%PORTNAME%%.
+ o The home directory is /var/spool/ejabberd
+ o PLEASE NOTE! "ejabberd" user UID and GID have changed from version 2.0.3
+ of this port! Users are advised to check all configuration files and data
+ in /var/spool/ejabberd to ensure everything has the correct owner/group.
-WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING!!!
+------------------------------------------------------------------------