summaryrefslogtreecommitdiff
path: root/chat/ejabberd/patches
diff options
context:
space:
mode:
authormartti <martti>2008-03-10 08:58:32 +0000
committermartti <martti>2008-03-10 08:58:32 +0000
commitb7a8469a73d681a026f4ee55737092e43366c12d (patch)
tree2291b7fb74b37807b4958f48fafda2d8318039be /chat/ejabberd/patches
parent3e56541ca126e70376775fd71585a88aeb3a42aa (diff)
downloadpkgsrc-b7a8469a73d681a026f4ee55737092e43366c12d.tar.gz
ejabberd is a Free and Open Source distributed fault-tolerant Jabber server.
It is writen mostly in Erlang.
Diffstat (limited to 'chat/ejabberd/patches')
-rw-r--r--chat/ejabberd/patches/patch-aa23
-rw-r--r--chat/ejabberd/patches/patch-ab24
-rw-r--r--chat/ejabberd/patches/patch-ac51
-rw-r--r--chat/ejabberd/patches/patch-ad140
-rw-r--r--chat/ejabberd/patches/patch-ae37
5 files changed, 275 insertions, 0 deletions
diff --git a/chat/ejabberd/patches/patch-aa b/chat/ejabberd/patches/patch-aa
new file mode 100644
index 00000000000..89d849a17ec
--- /dev/null
+++ b/chat/ejabberd/patches/patch-aa
@@ -0,0 +1,23 @@
+$NetBSD: patch-aa,v 1.1.1.1 2008/03/10 08:58:32 martti Exp $
+
+Modified for pkgsrc
+
+--- src/Makefile.in.orig 2008-01-16 12:33:27.000000000 +0200
++++ src/Makefile.in 2008-02-11 13:38:21.000000000 +0200
+@@ -50,13 +50,13 @@
+
+ DESTDIR =
+
+-EJABBERDDIR = $(DESTDIR)@prefix@/var/lib/ejabberd
++EJABBERDDIR = $(DESTDIR)@prefix@/lib/erlang/lib/@DISTNAME@
+ BEAMDIR = $(EJABBERDDIR)/ebin
+ PRIVDIR = $(EJABBERDDIR)/priv
+ SODIR = $(PRIVDIR)/lib
+ MSGSDIR = $(PRIVDIR)/msgs
+-LOGDIR = $(DESTDIR)@prefix@/var/log/ejabberd
+-ETCDIR = $(DESTDIR)@prefix@/etc/ejabberd
++LOGDIR = $(DESTDIR)/@JABBERD_LOGDIR@
++ETCDIR = $(DESTDIR)/@PKG_SYSCONFDIR@
+ SBINDIR = $(DESTDIR)@prefix@/sbin
+
+ ifeq ($(shell uname),Darwin)
diff --git a/chat/ejabberd/patches/patch-ab b/chat/ejabberd/patches/patch-ab
new file mode 100644
index 00000000000..5f48ed139ff
--- /dev/null
+++ b/chat/ejabberd/patches/patch-ab
@@ -0,0 +1,24 @@
+$NetBSD: patch-ab,v 1.1.1.1 2008/03/10 08:58:32 martti Exp $
+
+What is this for?
+
+--- src/mod_last.erl.orig 2008-01-16 12:33:27.000000000 +0200
++++ src/mod_last.erl 2008-02-11 13:46:13.000000000 +0200
+@@ -133,7 +133,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/chat/ejabberd/patches/patch-ac b/chat/ejabberd/patches/patch-ac
new file mode 100644
index 00000000000..cb6a3937cdf
--- /dev/null
+++ b/chat/ejabberd/patches/patch-ac
@@ -0,0 +1,51 @@
+$NetBSD: patch-ac,v 1.1.1.1 2008/03/10 08:58:32 martti Exp $
+
+Patch from Fabrice Colliot: support for multiple listeners on same port
+number (eg IPv4 and IPv6 simultaneously).
+
+--- src/ejabberd.cfg.example.orig 2008-01-16 12:33:27.000000000 +0200
++++ src/ejabberd.cfg.example 2008-02-14 15:25:12.000000000 +0200
+@@ -106,7 +106,7 @@
+ {listen,
+ [
+
+- {5222, ejabberd_c2s, [
++ {1, 5222, ejabberd_c2s, [
+
+ %%
+ %% If TLS is compiled and you installed a SSL
+@@ -123,14 +123,14 @@
+ %%
+ %% To enable the old SSL connection method in port 5223:
+ %%
+- %%{5223, ejabberd_c2s, [
++ %%{2, 5223, ejabberd_c2s, [
+ %% {access, c2s},
+ %% {shaper, c2s_shaper},
+ %% {certfile, "/path/to/ssl.pem"}, tls,
+ %% {max_stanza_size, 65536}
+ %% ]},
+
+- {5269, ejabberd_s2s_in, [
++ {3, 5269, ejabberd_s2s_in, [
+ {shaper, s2s_shaper},
+ {max_stanza_size, 131072}
+ ]},
+@@ -138,7 +138,7 @@
+ %%
+ %% ejabberd_service: Interact with external components (transports...)
+ %%
+- %%{8888, ejabberd_service, [
++ %%{4, 8888, ejabberd_service, [
+ %% {access, all},
+ %% {shaper_rule, fast},
+ %% {ip, {127, 0, 0, 1}},
+@@ -147,7 +147,7 @@
+ %% }
+ %% ]},
+
+- {5280, ejabberd_http, [
++ {5, 5280, ejabberd_http, [
+ http_poll,
+ web_admin
+ ]}
diff --git a/chat/ejabberd/patches/patch-ad b/chat/ejabberd/patches/patch-ad
new file mode 100644
index 00000000000..f8a85a71ec0
--- /dev/null
+++ b/chat/ejabberd/patches/patch-ad
@@ -0,0 +1,140 @@
+$NetBSD: patch-ad,v 1.1.1.1 2008/03/10 08:58:32 martti Exp $
+
+Patch from Fabrice Colliot: support for multiple listeners on same port
+number (eg IPv4 and IPv6 simultaneously).
+
+--- src/ejabberd_listener.erl.orig 2008-01-16 12:33:27.000000000 +0200
++++ src/ejabberd_listener.erl 2008-02-14 15:25:12.000000000 +0200
+@@ -27,12 +27,12 @@
+ -module(ejabberd_listener).
+ -author('alexey@process-one.net').
+
+--export([start_link/0, init/1, start/3,
+- init/3,
+- init_ssl/4,
+- start_listener/3,
++-export([start_link/0, init/1, start/4,
++ init/4,
++ init_ssl/5,
++ start_listener/4,
+ stop_listener/1,
+- add_listener/3,
++ add_listener/4,
+ delete_listener/1
+ ]).
+
+@@ -49,9 +49,9 @@
+ Ls ->
+ {ok, {{one_for_one, 10, 1},
+ lists:map(
+- fun({Port, Module, Opts}) ->
+- {Port,
+- {?MODULE, start, [Port, Module, Opts]},
++ fun({ListenerID, Port, Module, Opts}) ->
++ {ListenerID,
++ {?MODULE, start, [ListenerID, Port, Module, Opts]},
+ transient,
+ brutal_kill,
+ worker,
+@@ -60,7 +60,7 @@
+ end.
+
+
+-start(Port, Module, Opts) ->
++start(ListenerID, Port, Module, Opts) ->
+ SSLError = "There is a problem with your ejabberd configuration file: the option 'ssl' for listening sockets is no longer available. To get SSL encryption use the option 'tls'.",
+ case lists:keysearch(ssl, 1, Opts) of
+ {value, {ssl, _SSLOpts}} ->
+@@ -77,11 +77,11 @@
+ {error, SSLError};
+ false ->
+ {ok, proc_lib:spawn_link(?MODULE, init,
+- [Port, Module, Opts])}
++ [ListenerID, Port, Module, Opts])}
+ end
+ end.
+
+-init(Port, Module, Opts) ->
++init(ListenerID, Port, Module, Opts) ->
+ SockOpts = lists:filter(fun({ip, _}) -> true;
+ (inet6) -> true;
+ (inet) -> true;
+@@ -100,7 +100,7 @@
+ accept(ListenSocket, Module, Opts);
+ {error, Reason} ->
+ ?ERROR_MSG("Failed to open socket for ~p: ~p",
+- [{Port, Module, Opts}, Reason]),
++ [{ListenerID, Port, Module, Opts}, Reason]),
+ error
+ end.
+
+@@ -128,7 +128,7 @@
+ end.
+
+
+-init_ssl(Port, Module, Opts, SSLOpts) ->
++init_ssl(ListenerID, Port, Module, Opts, SSLOpts) ->
+ SockOpts = lists:filter(fun({ip, _}) -> true;
+ (inet6) -> true;
+ (inet) -> true;
+@@ -151,7 +151,7 @@
+ accept_ssl(ListenSocket, Module, Opts);
+ {error, Reason} ->
+ ?ERROR_MSG("Failed to open socket for ~p: ~p",
+- [{Port, Module, Opts}, Reason]),
++ [{ListenerID, Port, Module, Opts}, Reason]),
+ error
+ end.
+
+@@ -178,8 +178,8 @@
+ end.
+
+
+-start_listener(Port, Module, Opts) ->
+- ChildSpec = {Port,
++start_listener(ListenerID, Port, Module, Opts) ->
++ ChildSpec = {ListenerID,
+ {?MODULE, start, [Port, Module, Opts]},
+ transient,
+ brutal_kill,
+@@ -187,30 +187,30 @@
+ [?MODULE]},
+ supervisor:start_child(ejabberd_listeners, ChildSpec).
+
+-stop_listener(Port) ->
+- supervisor:terminate_child(ejabberd_listeners, Port),
+- supervisor:delete_child(ejabberd_listeners, Port).
++stop_listener(ListenerID) ->
++ supervisor:terminate_child(ejabberd_listeners, ListenerID),
++ supervisor:delete_child(ejabberd_listeners, ListenerID).
+
+-add_listener(Port, Module, Opts) ->
++add_listener(ListenerID, Port, Module, Opts) ->
+ Ports = case ejabberd_config:get_local_option(listen) of
+ undefined ->
+ [];
+ Ls ->
+ Ls
+ end,
+- Ports1 = lists:keydelete(Port, 1, Ports),
+- Ports2 = [{Port, Module, Opts} | Ports1],
++ Ports1 = lists:keydelete(ListenerID, 1, Ports),
++ Ports2 = [{ListenerID, Port, Module, Opts} | Ports1],
+ ejabberd_config:add_local_option(listen, Ports2),
+- start_listener(Port, Module, Opts).
++ start_listener(ListenerID, Port, Module, Opts).
+
+-delete_listener(Port) ->
++delete_listener(ListenerID) ->
+ Ports = case ejabberd_config:get_local_option(listen) of
+ undefined ->
+ [];
+ Ls ->
+ Ls
+ end,
+- Ports1 = lists:keydelete(Port, 1, Ports),
++ Ports1 = lists:keydelete(ListenerID, 1, Ports),
+ ejabberd_config:add_local_option(listen, Ports1),
+- stop_listener(Port).
++ stop_listener(ListenerID).
+
diff --git a/chat/ejabberd/patches/patch-ae b/chat/ejabberd/patches/patch-ae
new file mode 100644
index 00000000000..d81a61dd8b1
--- /dev/null
+++ b/chat/ejabberd/patches/patch-ae
@@ -0,0 +1,37 @@
+$NetBSD: patch-ae,v 1.1.1.1 2008/03/10 08:58:32 martti Exp $
+
+Keep things tidy (nothing under /usr/pkg/var)
+
+--- src/ejabberdctl.template.orig 2008-02-22 16:42:12.000000000 +0200
++++ src/ejabberdctl.template 2008-02-22 17:45:01.000000000 +0200
+@@ -13,8 +13,8 @@
+ ERLANG_NODE=$NODE@$HOST
+ 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=@EJABBERD_LOGDIR@
++EJABBERD_DB=@EJABBERD_VARDIR@/spool/ejabberd/db/$NODE
+
+ # read custom configuration
+ CONFIG=$ROOTDIR/etc/ejabberd/ejabberdctl.cfg
+@@ -42,15 +42,15 @@
+ 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_EBIN=$ROOTDIR/lib/erlang/lib/@DISTNAME@/ebin
++EJABBERD_MSGS_PATH=$ROOTDIR/lib/erlang/lib/@DISTNAME@/priv/msgs
++EJABBERD_SO_PATH=$ROOTDIR/lib/erlang/lib/@DISTNAME@/priv/lib
+ 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
++HOME=@EJABBERD_VARDIR@/run/ejabberd
+
+ # export global variables
+ export EJABBERD_CONFIG_PATH