summaryrefslogtreecommitdiff
path: root/chat/ejabberd
diff options
context:
space:
mode:
authorfhajny <fhajny@pkgsrc.org>2009-12-15 13:30:54 +0000
committerfhajny <fhajny@pkgsrc.org>2009-12-15 13:30:54 +0000
commit673fc43b9aa9798b30dae14dd3f744957b27b8fd (patch)
tree19e92835dcc4d779cfac4f09dfa2fc4b5d068aab /chat/ejabberd
parentf3538fa3cc99052949fe423bdacfc05ec2d23899 (diff)
downloadpkgsrc-673fc43b9aa9798b30dae14dd3f744957b27b8fd.tar.gz
Update ejabberd to 2.1.0.
Very brief list of additions: * Erlang/OTP R13 support * HTTP-Bind (BOSH) optimization and clean-up * LDAPS support * MUC rooms can require a CAPTCHA to join the room * PubSub: major improvements. Update to XEP version 1.12 * PEP and Caps: many improvements * Run commands with ejabberdctl or other frontends (XML-RPC, HTTP) * STUN server * XEPs like: XMPP Ping, Roster Versioning, Import/Export Format See full release note: http://www.process-one.net/en/ejabberd/release_notes/release_note_ejabberd_2.1.0
Diffstat (limited to 'chat/ejabberd')
-rw-r--r--chat/ejabberd/Makefile14
-rw-r--r--chat/ejabberd/PLIST76
-rw-r--r--chat/ejabberd/distinfo19
-rw-r--r--chat/ejabberd/patches/patch-aa171
-rw-r--r--chat/ejabberd/patches/patch-ac276
-rw-r--r--chat/ejabberd/patches/patch-ad76
-rw-r--r--chat/ejabberd/patches/patch-ae56
-rw-r--r--chat/ejabberd/patches/patch-af25
-rw-r--r--chat/ejabberd/patches/patch-ag205
-rw-r--r--chat/ejabberd/patches/patch-ah50
-rw-r--r--chat/ejabberd/patches/patch-ai158
11 files changed, 270 insertions, 856 deletions
diff --git a/chat/ejabberd/Makefile b/chat/ejabberd/Makefile
index 746d040197d..09eae6535f3 100644
--- a/chat/ejabberd/Makefile
+++ b/chat/ejabberd/Makefile
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.13 2009/05/19 08:59:05 wiz Exp $
+# $NetBSD: Makefile,v 1.14 2009/12/15 13:30:54 fhajny Exp $
-DISTNAME= ejabberd-2.0.5
-#PKGREVISION= 1
+DISTNAME= ejabberd-2.1.0
CATEGORIES= chat
-MASTER_SITES= http://www.process-one.net/downloads/ejabberd/2.0.5/
+MASTER_SITES= http://www.process-one.net/downloads/ejabberd/2.1.0/
MAINTAINER= martti@NetBSD.org
HOMEPAGE= http://www.ejabberd.im/
@@ -26,7 +25,6 @@ CONFIGURE_ARGS+= --enable-mod_muc
CONFIGURE_ARGS+= --enable-eldap
CONFIGURE_ARGS+= --enable-web
CONFIGURE_ARGS+= --enable-tls
-CONFIGURE_ARGS+= --enable-odbc
CONFIGURE_ARGS+= --enable-ejabberd_zlib
CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl}
CONFIGURE_ARGS+= --with-zlib=${BUILDLINK_PREFIX.zlib}
@@ -75,6 +73,8 @@ PLIST_SUBST+= EJABBERD_EXDIR=${EJABBERD_EXDIR}
PKG_GROUPS+= ${EJABBERD_GROUP}
PKG_USERS+= ${EJABBERD_USER}:${EJABBERD_GROUP}
+PKG_GECOS.${EJABBERD_USER}= ejabberd user
+PKG_HOME.${EJABBERD_USER}= ${EJABBERD_DB}
EGDIR= ${PREFIX}/${EJABBERD_EXDIR}
@@ -86,6 +86,8 @@ CONF_FILES= ${EGDIR}/ejabberd.cfg ${PKG_SYSCONFDIR}/ejabberd.cfg
CONF_FILES+= ${EGDIR}/ejabberdctl.cfg ${PKG_SYSCONFDIR}/ejabberdctl.cfg
CONF_FILES+= ${EGDIR}/inetrc ${PKG_SYSCONFDIR}/inetrc
+REPLACE_SH= src/ejabberdctl.template tools/captcha.sh
+
post-patch:
${RM} -f ${WRKSRC}/doc/guide.tex.orig
@@ -99,12 +101,14 @@ SUBST_CLASSES+= paths
SUBST_MESSAGE.paths= Localizing paths
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths= src/Makefile.in
+SUBST_FILES.paths+= src/ejabberd.cfg.example
SUBST_FILES.paths+= src/ejabberdctl.template
SUBST_FILES.paths+= doc/guide.tex
SUBST_SED.paths+= -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
SUBST_SED.paths+= -e 's,@JABBERD_LOGDIR@,${EJABBERD_LOGDIR},g'
SUBST_SED.paths+= -e 's,@EJABBERD_LOGDIR@,${EJABBERD_LOGDIR},g'
SUBST_SED.paths+= -e 's,@EJABBERD_DB@,${EJABBERD_DB},g'
+SUBST_SED.paths+= -e 's,@PREFIX@,${PREFIX},g'
SUBST_SED.paths+= -e 's,@DISTNAME@,${DISTNAME},g'
SUBST_SED.paths+= -e 's,@EJABBERD_VARDIR@,${VARBASE},g'
diff --git a/chat/ejabberd/PLIST b/chat/ejabberd/PLIST
index 7d2438c85c1..ac4a9938ea4 100644
--- a/chat/ejabberd/PLIST
+++ b/chat/ejabberd/PLIST
@@ -1,7 +1,4 @@
-@comment $NetBSD: PLIST,v 1.8 2009/06/14 18:28:43 joerg Exp $
-${EJABBERD_EXDIR}/ejabberd.cfg
-${EJABBERD_EXDIR}/ejabberdctl.cfg
-${EJABBERD_EXDIR}/inetrc
+@comment $NetBSD: PLIST,v 1.9 2009/12/15 13:30:54 fhajny Exp $
lib/erlang/lib/${PKGNAME}/ebin/ELDAPv3.beam
lib/erlang/lib/${PKGNAME}/ebin/XmppAddr.beam
lib/erlang/lib/${PKGNAME}/ebin/acl.beam
@@ -10,6 +7,7 @@ lib/erlang/lib/${PKGNAME}/ebin/cyrsasl.beam
lib/erlang/lib/${PKGNAME}/ebin/cyrsasl_anonymous.beam
lib/erlang/lib/${PKGNAME}/ebin/cyrsasl_digest.beam
lib/erlang/lib/${PKGNAME}/ebin/cyrsasl_plain.beam
+lib/erlang/lib/${PKGNAME}/ebin/dynamic_compile.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd.app
lib/erlang/lib/${PKGNAME}/ebin/ejabberd.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_admin.beam
@@ -23,9 +21,12 @@ lib/erlang/lib/${PKGNAME}/ebin/ejabberd_auth_odbc.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_auth_pam.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_c2s.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_c2s_config.beam
+lib/erlang/lib/${PKGNAME}/ebin/ejabberd_captcha.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_check.beam
+lib/erlang/lib/${PKGNAME}/ebin/ejabberd_commands.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_config.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_ctl.beam
+lib/erlang/lib/${PKGNAME}/ebin/ejabberd_debug.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_frontend_socket.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_hooks.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_http.beam
@@ -38,6 +39,7 @@ lib/erlang/lib/${PKGNAME}/ebin/ejabberd_loglevel.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_node_groups.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_odbc.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_odbc_sup.beam
+lib/erlang/lib/${PKGNAME}/ebin/ejabberd_piefxis.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_rdbms.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_receiver.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_router.beam
@@ -47,6 +49,7 @@ lib/erlang/lib/${PKGNAME}/ebin/ejabberd_s2s_out.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_service.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_sm.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_socket.beam
+lib/erlang/lib/${PKGNAME}/ebin/ejabberd_stun.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_sup.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_system_monitor.beam
lib/erlang/lib/${PKGNAME}/ebin/ejabberd_tmp_sup.beam
@@ -87,6 +90,7 @@ lib/erlang/lib/${PKGNAME}/ebin/mod_muc_log.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_muc_room.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_offline.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_offline_odbc.beam
+lib/erlang/lib/${PKGNAME}/ebin/mod_ping.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_privacy.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_privacy_odbc.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_private.beam
@@ -97,6 +101,7 @@ lib/erlang/lib/${PKGNAME}/ebin/mod_proxy65_service.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_proxy65_sm.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_proxy65_stream.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_pubsub.beam
+lib/erlang/lib/${PKGNAME}/ebin/mod_pubsub_odbc.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_register.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_roster.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_roster_odbc.beam
@@ -110,28 +115,57 @@ lib/erlang/lib/${PKGNAME}/ebin/mod_vcard_odbc.beam
lib/erlang/lib/${PKGNAME}/ebin/mod_version.beam
lib/erlang/lib/${PKGNAME}/ebin/node_buddy.beam
lib/erlang/lib/${PKGNAME}/ebin/node_club.beam
-lib/erlang/lib/${PKGNAME}/ebin/node_default.beam
+lib/erlang/lib/${PKGNAME}/ebin/node_dag.beam
lib/erlang/lib/${PKGNAME}/ebin/node_dispatch.beam
+lib/erlang/lib/${PKGNAME}/ebin/node_flat.beam
+lib/erlang/lib/${PKGNAME}/ebin/node_flat_odbc.beam
+lib/erlang/lib/${PKGNAME}/ebin/node_hometree.beam
+lib/erlang/lib/${PKGNAME}/ebin/node_hometree_odbc.beam
+lib/erlang/lib/${PKGNAME}/ebin/node_mb.beam
lib/erlang/lib/${PKGNAME}/ebin/node_pep.beam
+lib/erlang/lib/${PKGNAME}/ebin/node_pep_odbc.beam
lib/erlang/lib/${PKGNAME}/ebin/node_private.beam
lib/erlang/lib/${PKGNAME}/ebin/node_public.beam
-lib/erlang/lib/${PKGNAME}/ebin/nodetree_default.beam
+lib/erlang/lib/${PKGNAME}/ebin/nodetree_dag.beam
+lib/erlang/lib/${PKGNAME}/ebin/nodetree_tree.beam
+lib/erlang/lib/${PKGNAME}/ebin/nodetree_tree_odbc.beam
lib/erlang/lib/${PKGNAME}/ebin/nodetree_virtual.beam
lib/erlang/lib/${PKGNAME}/ebin/odbc_queries.beam
lib/erlang/lib/${PKGNAME}/ebin/p1_fsm.beam
lib/erlang/lib/${PKGNAME}/ebin/p1_mnesia.beam
-lib/erlang/lib/${PKGNAME}/ebin/ram_file_io_server.beam
+lib/erlang/lib/${PKGNAME}/ebin/pubsub_db_odbc.beam
+lib/erlang/lib/${PKGNAME}/ebin/pubsub_index.beam
+lib/erlang/lib/${PKGNAME}/ebin/pubsub_subscription.beam
+lib/erlang/lib/${PKGNAME}/ebin/pubsub_subscription_odbc.beam
lib/erlang/lib/${PKGNAME}/ebin/randoms.beam
lib/erlang/lib/${PKGNAME}/ebin/sha.beam
lib/erlang/lib/${PKGNAME}/ebin/shaper.beam
lib/erlang/lib/${PKGNAME}/ebin/stringprep.beam
lib/erlang/lib/${PKGNAME}/ebin/stringprep_sup.beam
+lib/erlang/lib/${PKGNAME}/ebin/stun_codec.beam
lib/erlang/lib/${PKGNAME}/ebin/tls.beam
lib/erlang/lib/${PKGNAME}/ebin/translate.beam
lib/erlang/lib/${PKGNAME}/ebin/treap.beam
lib/erlang/lib/${PKGNAME}/ebin/win32_dns.beam
lib/erlang/lib/${PKGNAME}/ebin/xml.beam
lib/erlang/lib/${PKGNAME}/ebin/xml_stream.beam
+lib/erlang/lib/${PKGNAME}/include/XmppAddr.hrl
+lib/erlang/lib/${PKGNAME}/include/adhoc.hrl
+lib/erlang/lib/${PKGNAME}/include/ejabberd.hrl
+lib/erlang/lib/${PKGNAME}/include/ejabberd_commands.hrl
+lib/erlang/lib/${PKGNAME}/include/ejabberd_config.hrl
+lib/erlang/lib/${PKGNAME}/include/ejabberd_ctl.hrl
+lib/erlang/lib/${PKGNAME}/include/eldap/ELDAPv3.hrl
+lib/erlang/lib/${PKGNAME}/include/eldap/eldap.hrl
+lib/erlang/lib/${PKGNAME}/include/jlib.hrl
+lib/erlang/lib/${PKGNAME}/include/mod_muc/mod_muc_room.hrl
+lib/erlang/lib/${PKGNAME}/include/mod_privacy.hrl
+lib/erlang/lib/${PKGNAME}/include/mod_proxy65/mod_proxy65.hrl
+lib/erlang/lib/${PKGNAME}/include/mod_pubsub/pubsub.hrl
+lib/erlang/lib/${PKGNAME}/include/mod_roster.hrl
+lib/erlang/lib/${PKGNAME}/include/web/ejabberd_http.hrl
+lib/erlang/lib/${PKGNAME}/include/web/ejabberd_web_admin.hrl
+lib/erlang/lib/${PKGNAME}/priv/bin/captcha.sh
lib/erlang/lib/${PKGNAME}/priv/lib/ejabberd_zlib_drv.so
lib/erlang/lib/${PKGNAME}/priv/lib/expat_erl.so
lib/erlang/lib/${PKGNAME}/priv/lib/iconv_erl.so
@@ -140,6 +174,7 @@ lib/erlang/lib/${PKGNAME}/priv/lib/tls_drv.so
lib/erlang/lib/${PKGNAME}/priv/msgs/ca.msg
lib/erlang/lib/${PKGNAME}/priv/msgs/cs.msg
lib/erlang/lib/${PKGNAME}/priv/msgs/de.msg
+lib/erlang/lib/${PKGNAME}/priv/msgs/el.msg
lib/erlang/lib/${PKGNAME}/priv/msgs/eo.msg
lib/erlang/lib/${PKGNAME}/priv/msgs/es.msg
lib/erlang/lib/${PKGNAME}/priv/msgs/fr.msg
@@ -178,9 +213,6 @@ share/doc/${PKGNAME}/guide.pdf
share/doc/${PKGNAME}/guide.tex
share/doc/${PKGNAME}/introduction.tex
share/doc/${PKGNAME}/logo.png
-share/doc/${PKGNAME}/mod_http_bind.tex
-share/doc/${PKGNAME}/mod_http_fileserver.tex
-share/doc/${PKGNAME}/release_notes_${PKGVERSION}.txt
share/doc/${PKGNAME}/release_notes_0.9.1.txt
share/doc/${PKGNAME}/release_notes_0.9.8.txt
share/doc/${PKGNAME}/release_notes_0.9.txt
@@ -195,10 +227,34 @@ share/doc/${PKGNAME}/release_notes_2.0.1.txt
share/doc/${PKGNAME}/release_notes_2.0.2.txt
share/doc/${PKGNAME}/release_notes_2.0.3.txt
share/doc/${PKGNAME}/release_notes_2.0.4.txt
+share/doc/${PKGNAME}/release_notes_2.0.5.txt
+share/doc/${PKGNAME}/release_notes_${PKGVERSION}.txt
share/doc/${PKGNAME}/version.tex
share/doc/${PKGNAME}/webadmmain.png
share/doc/${PKGNAME}/webadmmainru.png
share/doc/${PKGNAME}/yozhikheader.png
+share/doc/ejabberd/discorus.png
+share/doc/ejabberd/guide.html
+share/doc/ejabberd/logo.png
+share/doc/ejabberd/release_notes_0.9.1.txt
+share/doc/ejabberd/release_notes_0.9.8.txt
+share/doc/ejabberd/release_notes_0.9.txt
+share/doc/ejabberd/release_notes_1.0.0.txt
+share/doc/ejabberd/release_notes_1.1.0.txt
+share/doc/ejabberd/release_notes_1.1.1.txt
+share/doc/ejabberd/release_notes_1.1.2.txt
+share/doc/ejabberd/release_notes_1.1.3.txt
+share/doc/ejabberd/release_notes_1.1.4.txt
+share/doc/ejabberd/release_notes_2.0.0.txt
+share/doc/ejabberd/release_notes_2.0.1.txt
+share/doc/ejabberd/release_notes_2.0.2.txt
+share/doc/ejabberd/release_notes_2.0.3.txt
+share/doc/ejabberd/release_notes_2.0.4.txt
+share/doc/ejabberd/release_notes_2.0.5.txt
+share/doc/ejabberd/release_notes_${PKGVERSION}.txt
+share/doc/ejabberd/webadmmain.png
+share/doc/ejabberd/webadmmainru.png
+share/doc/ejabberd/yozhikheader.png
share/examples/ejabberd/ejabberd.cfg
share/examples/ejabberd/ejabberdctl.cfg
share/examples/ejabberd/inetrc
diff --git a/chat/ejabberd/distinfo b/chat/ejabberd/distinfo
index de62785a1b7..4a1e2bdbe97 100644
--- a/chat/ejabberd/distinfo
+++ b/chat/ejabberd/distinfo
@@ -1,13 +1,8 @@
-$NetBSD: distinfo,v 1.8 2009/05/12 18:36:19 martti Exp $
+$NetBSD: distinfo,v 1.9 2009/12/15 13:30:54 fhajny Exp $
-SHA1 (ejabberd-2.0.5.tar.gz) = e5b8c4b742fdcc439da9458f94f530604abdfdd5
-RMD160 (ejabberd-2.0.5.tar.gz) = 5ec0210b3995004c708180a66a096e0b9be5f1ba
-Size (ejabberd-2.0.5.tar.gz) = 1796737 bytes
-SHA1 (patch-aa) = b3cc3c7eaffeada40f322303f6b8d7ee4624f205
-SHA1 (patch-ac) = 54bf662dfeaa45bcf8443507033664d729e4b47f
-SHA1 (patch-ad) = 0aa1652ec464c1c995ae81a7ea6b00d0d9e1cd0d
-SHA1 (patch-ae) = c1c615a1d2e28d05d069f2bafa30179437922536
-SHA1 (patch-af) = 908ebaaea76de53cc22a53289d3b93189767d40c
-SHA1 (patch-ag) = c6620ce3018e4c01d8c9edf6242a8cb52a55395d
-SHA1 (patch-ah) = 29703bddcc89df1c7b8d85cebcd3efb273b14e89
-SHA1 (patch-ai) = a764916c2c9c396bc55ed4244dc7afcd14208cd3
+SHA1 (ejabberd-2.1.0.tar.gz) = 003d921d98b16ac1f9b750e700d0e1ceb5f8ce1d
+RMD160 (ejabberd-2.1.0.tar.gz) = 2b9b1e9c3702b5476e2fc10352f2dfc310199f01
+Size (ejabberd-2.1.0.tar.gz) = 2219822 bytes
+SHA1 (patch-aa) = f0c8f884f43d31e77456f273d2037595432b10ea
+SHA1 (patch-ad) = 64e4795488cb21ee343f35e43aab08a713d5e65b
+SHA1 (patch-ae) = 362f19c23338154f0683cb2e97e6fc66fdae68a4
diff --git a/chat/ejabberd/patches/patch-aa b/chat/ejabberd/patches/patch-aa
index 709c9038b30..7ae4e962592 100644
--- a/chat/ejabberd/patches/patch-aa
+++ b/chat/ejabberd/patches/patch-aa
@@ -1,34 +1,159 @@
-$NetBSD: patch-aa,v 1.4 2009/02/09 23:05:02 joerg Exp $
+$NetBSD: patch-aa,v 1.5 2009/12/15 13:30:54 fhajny Exp $
-Modified for pkgsrc
-
---- src/Makefile.in.orig 2008-08-27 12:37:52.000000000 +0300
+--- src/Makefile.in.orig 2009-11-06 19:53:19.000000000 +0000
+++ src/Makefile.in
-@@ -58,15 +58,15 @@ BEAMS = $(SOURCES:.erl=.beam)
+@@ -59,7 +59,7 @@ endif
+
+ INSTALL_EPAM=
+ ifeq (@pam@, pam)
+- INSTALL_EPAM=install -m 750 $(O_USER) epam $(PBINDIR)
++ INSTALL_EPAM=$(BSD_INSTALL_DATA) -m 750 $(O_USER) epam $(PBINDIR)
+ endif
+ prefix = @prefix@
+@@ -76,13 +76,13 @@ BEAMS = $(SOURCES:.erl=.beam)
DESTDIR =
--EJABBERDDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
+ # /etc/ejabberd/
+-ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
++ETCDIR = $(DESTDIR)@prefix@/share/examples/ejabberd
+
+ # /sbin/
+ SBINDIR = $(DESTDIR)@sbindir@
+
+ # /lib/ejabberd/
+-EJABBERDDIR = $(DESTDIR)@libdir@/ejabberd
+EJABBERDDIR = $(DESTDIR)@prefix@/lib/erlang/lib/@DISTNAME@
- BEAMDIR = $(EJABBERDDIR)/ebin
--SPOOLDIR = $(EJABBERDDIR)/db
-+SPOOLDIR = @EJABBERD_VARDIR@/spool/ejabberd/db/$NODE
- PRIVDIR = $(EJABBERDDIR)/priv
- SODIR = $(PRIVDIR)/lib
- PBINDIR = $(PRIVDIR)/bin
+
+ # /share/doc/ejabberd
+ PACKAGE_TARNAME = @PACKAGE_TARNAME@
+@@ -108,13 +108,13 @@ SODIR = $(PRIVDIR)/lib
MSGSDIR = $(PRIVDIR)/msgs
+
+ # /var/lib/ejabberd/
+-SPOOLDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
++SPOOLDIR = @EJABBERD_VARDIR@/spool/ejabberd/db/$NODE
+
+ # /var/lib/ejabberd/.erlang.cookie
+ COOKIEFILE = $(SPOOLDIR)/.erlang.cookie
+
+ # /var/log/ejabberd/
-LOGDIR = $(DESTDIR)@localstatedir@/log/ejabberd
--ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
+LOGDIR = $(DESTDIR)/@JABBERD_LOGDIR@
-+ETCDIR = $(DESTDIR)@prefix@/share/examples/ejabberd
- SBINDIR = $(DESTDIR)@sbindir@
- ifeq ($(shell uname),Darwin)
-@@ -114,7 +114,6 @@ install: all
- install -m 644 *.beam $(BEAMDIR)
+ # Assume Linux-style dynamic library flags
+ DYNAMIC_LIB_CFLAGS = -fpic -shared
+@@ -167,10 +167,10 @@ translations:
+ install: all
+ #
+ # Configuration files
+- install -d -m 750 $(G_USER) $(ETCDIR)
++ $(BSD_INSTALL_DATA_DIR) -m 750 $(G_USER) $(ETCDIR)
+ [ -f $(ETCDIR)/ejabberd.cfg ] \
+- && install -b -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new \
+- || install -b -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
++ && $(BSD_INSTALL_DATA) -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new \
++ || $(BSD_INSTALL_DATA) -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
+ sed -e "s*@rootdir@*@prefix@*" \
+ -e "s*@installuser@*@INSTALLUSER@*" \
+ -e "s*@LIBDIR@*@libdir@*" \
+@@ -180,13 +180,13 @@ install: all
+ -e "s*@erl@*@ERL@*" ejabberdctl.template \
+ > ejabberdctl.example
+ [ -f $(ETCDIR)/ejabberdctl.cfg ] \
+- && install -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
+- || install -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
+- install -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
++ && $(BSD_INSTALL_DATA) -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
++ || $(BSD_INSTALL_DATA) -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
++ $(BSD_INSTALL_DATA) -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
+ #
+ # Administration script
+- [ -d $(SBINDIR) ] || install -d -m 755 $(SBINDIR)
+- install -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
++ [ -d $(SBINDIR) ] || $(BSD_INSTALL_DATA_DIR) -m 755 $(SBINDIR)
++ $(BSD_INSTALL_DATA) -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
+ #
+ # Init script
+ sed -e "s*@ctlscriptpath@*$(SBINDIR)*" \
+@@ -194,54 +194,48 @@ install: all
+ > ejabberd.init
+ #
+ # Binary Erlang files
+- install -d $(BEAMDIR)
+- install -m 644 *.app $(BEAMDIR)
+- install -m 644 *.beam $(BEAMDIR)
++ $(BSD_INSTALL_DATA_DIR) $(BEAMDIR)
++ $(BSD_INSTALL_DATA) -m 644 *.app $(BEAMDIR)
++ $(BSD_INSTALL_DATA) -m 644 *.beam $(BEAMDIR)
rm -f $(BEAMDIR)/configure.beam
- install -m 644 *.app $(BEAMDIR)
-- install -d -m 750 $(SPOOLDIR)
- install -d $(SODIR)
- install -d $(PBINDIR)
- install -m 644 *.so $(SODIR)
+ #
+ # ejabberd header files
+- install -d $(INCLUDEDIR)
+- install -m 644 *.hrl $(INCLUDEDIR)
+- install -d $(INCLUDEDIR)/eldap/
+- install -m 644 eldap/*.hrl $(INCLUDEDIR)/eldap/
+- install -d $(INCLUDEDIR)/mod_muc/
+- install -m 644 mod_muc/*.hrl $(INCLUDEDIR)/mod_muc/
+- install -d $(INCLUDEDIR)/mod_proxy65/
+- install -m 644 mod_proxy65/*.hrl $(INCLUDEDIR)/mod_proxy65/
+- install -d $(INCLUDEDIR)/mod_pubsub/
+- install -m 644 mod_pubsub/*.hrl $(INCLUDEDIR)/mod_pubsub/
+- install -d $(INCLUDEDIR)/web/
+- install -m 644 web/*.hrl $(INCLUDEDIR)/web/
++ $(BSD_INSTALL_DATA_DIR) $(INCLUDEDIR)
++ $(BSD_INSTALL_DATA) -m 644 *.hrl $(INCLUDEDIR)
++ $(BSD_INSTALL_DATA_DIR) $(INCLUDEDIR)/eldap/
++ $(BSD_INSTALL_DATA) -m 644 eldap/*.hrl $(INCLUDEDIR)/eldap/
++ $(BSD_INSTALL_DATA_DIR) $(INCLUDEDIR)/mod_muc/
++ $(BSD_INSTALL_DATA) -m 644 mod_muc/*.hrl $(INCLUDEDIR)/mod_muc/
++ $(BSD_INSTALL_DATA_DIR) $(INCLUDEDIR)/mod_proxy65/
++ $(BSD_INSTALL_DATA) -m 644 mod_proxy65/*.hrl $(INCLUDEDIR)/mod_proxy65/
++ $(BSD_INSTALL_DATA_DIR) $(INCLUDEDIR)/mod_pubsub/
++ $(BSD_INSTALL_DATA) -m 644 mod_pubsub/*.hrl $(INCLUDEDIR)/mod_pubsub/
++ $(BSD_INSTALL_DATA_DIR) $(INCLUDEDIR)/web/
++ $(BSD_INSTALL_DATA) -m 644 web/*.hrl $(INCLUDEDIR)/web/
+ #
+ # Binary C programs
+- install -d $(PBINDIR)
+- install -m 750 $(O_USER) ../tools/captcha.sh $(PBINDIR)
++ $(BSD_INSTALL_SCRIPT_DIR) $(PBINDIR)
++ $(BSD_INSTALL_SCRIPT) -m 750 $(O_USER) ../tools/captcha.sh $(PBINDIR)
+ $(INSTALL_EPAM)
+ #
+ # Binary system libraries
+- install -d $(SODIR)
+- install -m 644 *.so $(SODIR)
++ $(BSD_INSTALL_LIB_DIR) $(SODIR)
++ $(BSD_INSTALL_LIB) -m 644 *.so $(SODIR)
+ #
+ # Translated strings
+- install -d $(MSGSDIR)
+- install -m 644 msgs/*.msg $(MSGSDIR)
+- #
+- # Spool directory
+- install -d -m 750 $(O_USER) $(SPOOLDIR)
+- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
+- chmod -R 750 $(SPOOLDIR)
+- [ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; }
++ $(BSD_INSTALL_DATA_DIR) $(MSGSDIR)
++ $(BSD_INSTALL_DATA) -m 644 msgs/*.msg $(MSGSDIR)
+ #
+ # Log directory
+- install -d -m 750 $(O_USER) $(LOGDIR)
++ $(BSD_INSTALL_DATA_DIR) -m 750 $(O_USER) $(LOGDIR)
+ $(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
+ chmod -R 750 $(LOGDIR)
+ #
+ # Documentation
+- install -d $(DOCDIR)
+- install ../doc/guide.html $(DOCDIR)
+- install ../doc/*.png $(DOCDIR)
+- install ../doc/*.txt $(DOCDIR)
++ $(BSD_INSTALL_DATA_DIR) $(DOCDIR)
++ $(BSD_INSTALL_DATA) ../doc/guide.html $(DOCDIR)
++ $(BSD_INSTALL_DATA) ../doc/*.png $(DOCDIR)
++ $(BSD_INSTALL_DATA) ../doc/*.txt $(DOCDIR)
+
+ uninstall: uninstall-binary
+
diff --git a/chat/ejabberd/patches/patch-ac b/chat/ejabberd/patches/patch-ac
deleted file mode 100644
index 4a90c5eca6e..00000000000
--- a/chat/ejabberd/patches/patch-ac
+++ /dev/null
@@ -1,276 +0,0 @@
-$NetBSD: patch-ac,v 1.4 2009/03/22 10:39:44 martti Exp $
-
-Modified to use IPv6/v4 patch (https://support.process-one.net/browse/EJAB-389)
-
---- doc/guide.tex.orig 2009-03-12 08:41:02.000000000 +0000
-+++ doc/guide.tex 2009-03-22 10:26:07.000000000 +0000
-@@ -713,34 +713,80 @@
- will listen and what services will be run on them. Each element of the list is a
- tuple with the following elements:
- \begin{itemize}
--\item Port number.
--\item Module that serves this port.
--\item Options to this module.
-+\item Port number. Optionally also the IP address.
-+\item Listening module that serves this port.
-+\item Options for the TCP socket and for the listening module.
- \end{itemize}
-
-+With the basic syntax the ports will listen on all IPv4 network addresses:
-+\begin{verbatim}
-+{listen, [
-+ {<port-number>, <module>, [<options>]},
-+ {<port-number>, <module>, [<options>]},
-+ ...
-+ {<port-number>, <module>, [<options>]}
-+ ]}.
-+\end{verbatim}
-+
-+It is possible to specify the IP address for a port using the full syntax:
-+\begin{verbatim}
-+ {{<port-number>, <ip-address>}, <module>, [<options>]}
-+\end{verbatim}
-+
-+
-+\makesubsubsection{listened-port}{Port Number and IP Address}
-+
-+The port number defines which port to listen for incoming connections.
-+It can be a Jabber/XMPP standard port
-+(see section \ref{firewall}) or any other valid port number.
-+
-+The IP address can be represented with a string
-+or an Erlang tuple with decimal or hexadecimal numbers.
-+The socket will listen only in that network interface.
-+It is possible to specify a generic address,
-+so \ejabberd{} will listen in all addresses.
-+Depending in the type of the IP address, IPv4 or IPv6 will be used.
-+
-+Some example values for IP address:
-+\begin{itemize}
-+\item \verb|"0.0.0.0"| to listen in all IPv4 network interfaces. This is the default value when no IP is specified.
-+\item \verb|"::"| to listen in all IPv6 network interfaces
-+\item \verb|"10.11.12.13"| is the IPv4 address \verb|10.11.12.13|
-+\item \verb|"::FFFF:127.0.0.1"| is the IPv6 address \verb|::FFFF:127.0.0.1/128|
-+\item \verb|{10, 11, 12, 13}| is the IPv4 address \verb|10.11.12.13|
-+\item \verb|{0, 0, 0, 0, 0, 65535, 32512, 1}| is the IPv6 address \verb|::FFFF:127.0.0.1/128|
-+\item \verb|{16#fdca, 16#8ab6, 16#a243, 16#75ef, 0, 0, 0, 1}| is the IPv6 address \verb|FDCA:8AB6:A243:75EF::1/128|
-+\end{itemize}
-+
-+
-+\makesubsubsection{listened-module}{Listening Module}
-+
- \ind{modules!ejabberd\_c2s}\ind{modules!ejabberd\_s2s\_in}\ind{modules!ejabberd\_service}\ind{modules!ejabberd\_http}\ind{protocols!XEP-0114: Jabber Component Protocol}
- The available modules, their purpose and the options allowed by each one are:
- \begin{description}
- \titem{\texttt{ejabberd\_c2s}}
- Handles c2s connections.\\
-- Options: \texttt{access}, \texttt{certfile}, \texttt{inet6},
-- \texttt{ip}, \texttt{max\_stanza\_size}, \texttt{shaper},
-+ Options: \texttt{access}, \texttt{certfile},
-+ \texttt{max\_stanza\_size}, \texttt{shaper},
- \texttt{starttls}, \texttt{starttls\_required}, \texttt{tls},
- \texttt{zlib}
- \titem{\texttt{ejabberd\_s2s\_in}}
- Handles incoming s2s connections.\\
-- Options: \texttt{inet6}, \texttt{ip}, \texttt{max\_stanza\_size}
-+ Options: \texttt{max\_stanza\_size}
- \titem{\texttt{ejabberd\_service}}
- Interacts with an \footahref{http://www.ejabberd.im/tutorials-transports}{external component}
- (as defined in the Jabber Component Protocol (\xepref{0114}).\\
-- Options: \texttt{access}, \texttt{hosts}, \texttt{inet6},
-- \texttt{ip}, \texttt{shaper}, \texttt{service\_check\_from}
-+ Options: \texttt{access}, \texttt{hosts},
-+ \texttt{shaper}, \texttt{service\_check\_from}
- \titem{\texttt{ejabberd\_http}}
- Handles incoming HTTP connections.\\
- Options: \texttt{certfile}, \texttt{http\_bind}, \texttt{http\_poll},
-- \texttt{inet6}, \texttt{ip}, \texttt{request\_handlers}, \texttt{tls}, \texttt{web\_admin}\\
-+ \texttt{request\_handlers}, \texttt{tls}, \texttt{web\_admin}\\
- \end{description}
-
-+
-+\makesubsubsection{listened-options}{Options}
-+
- This is a detailed description of each option allowed by the listening modules:
- \begin{description}
- \titem{\{access, <access rule>\}} \ind{options!access}This option defines
-@@ -786,12 +832,6 @@
- is also needed in the \Jabber{} client. Remark also that HTTP Polling can be
- interesting to host a web-based \Jabber{} client such as
- \footahref{http://jwchat.sourceforge.net/}{JWChat}.
-- \titem{inet6} \ind{options!inet6}\ind{IPv6}Set up the socket for IPv6 instead of IPv4.
-- Note: this option is not required for S2S outgoing connections,
-- because when ejabberd attempts to establish a S2S outgoing connection
-- it first tries IPv4, and if that fails it attempts with IPv6.
-- \titem{\{ip, IPAddress\}} \ind{options!ip}This option specifies which network
-- interface to listen for. For example \verb|{ip, {192, 168, 1, 1}}|.
- \titem{\{max\_stanza\_size, Size\}}
- \ind{options!max\_stanza\_size}This option specifies an
- approximate maximum size in bytes of XML stanzas. Approximate,
-@@ -839,7 +879,7 @@
- option will not affect connections (there will be no stream compression).
- \end{description}
-
--There are some additional global options:
-+There are some additional global options that can be specified in the ejabberd configuration file (outside \term{listen}):
- \begin{description}
- \titem{\{s2s\_use\_starttls, true|false\}}
- \ind{options!s2s\_use\_starttls}\ind{STARTTLS}This option defines whether to
-@@ -860,6 +900,8 @@
- Specified in seconds. The default value is 300 seconds (5 minutes).
- \end{description}
-
-+\makesubsubsection{listened-examples}{Examples}
-+
- For example, the following simple configuration defines:
- \begin{itemize}
- \item There are three domains. The default certificate file is \term{server.pem}.
-@@ -867,10 +909,10 @@
- \item Port 5222 listens for c2s connections with STARTTLS,
- and also allows plain connections for old clients.
- \item Port 5223 listens for c2s connections with the old SSL.
--\item Port 5269 listens for s2s connections with STARTTLS.
-+\item Port 5269 listens for s2s connections with STARTTLS. The socket is set for IPv6 instead of IPv4.
- \item Port 5280 listens for HTTP requests, and serves the HTTP Poll service.
- \item Port 5281 listens for HTTP requests, and serves the Web Admin using HTTPS as explained in
-- section~\ref{webadmin}.
-+ section~\ref{webadmin}. The socket only listens connections to the IP address 127.0.0.1.
- \end{itemize}
- \begin{verbatim}
- {hosts, ["example.com", "example.org", "example.net"]}.
-@@ -879,50 +921,52 @@
- {5222, ejabberd_c2s, [
- {access, c2s},
- {shaper, c2s_shaper},
-- starttls, {certfile, "/etc/ejabberd/server.pem"},
-+ starttls, {certfile, "@PKG_SYSCONFDIR@/server.pem"},
- {max_stanza_size, 65536}
- ]},
- {5223, ejabberd_c2s, [
- {access, c2s},
- {shaper, c2s_shaper},
-- tls, {certfile, "/etc/ejabberd/server.pem"},
-+ tls, {certfile, "@PKG_SYSCONFDIR@/server.pem"},
- {max_stanza_size, 65536}
- ]},
-- {5269, ejabberd_s2s_in, [
-- {shaper, s2s_shaper},
-- {max_stanza_size, 131072}
-- ]},
-+ {{5269, "::"}, ejabberd_s2s_in, [
-+ {shaper, s2s_shaper},
-+ {max_stanza_size, 131072}
-+ ]},
- {5280, ejabberd_http, [
- http_poll
- ]},
-- {5281, ejabberd_http, [
-- web_admin,
-- tls, {certfile, "/etc/ejabberd/server.pem"},
-- ]}
-+ {{5281, "127.0.0.1"}, ejabberd_http, [
-+ web_admin,
-+ tls, {certfile, "@PKG_SYSCONFDIR@/server.pem"},
-+ ]}
- ]
- }.
- {s2s_use_starttls, true}.
--{s2s_certfile, "/etc/ejabberd/server.pem"}.
--{domain_certfile, "example.com", "/etc/ejabberd/example_com.pem"}.
-+{s2s_certfile, "@PKG_SYSCONFDIR@/server.pem"}.
-+{domain_certfile, "example.com", "@PKG_SYSCONFDIR@/example_com.pem"}.
- \end{verbatim}
-
- In this example, the following configuration defines that:
- \begin{itemize}
--\item c2s connections are listened for on port 5222 and 5223 (SSL) and denied
-+\item c2s connections are listened for on port 5222 (all IPv4 addresses) and
-+ on port 5223 (SSL, IP 192.168.0.1 and fdca:8ab6:a243:75ef::1) and denied
- for the user called `\term{bad}'.
--\item s2s connections are listened for on port 5269 with STARTTLS for secured
-- traffic enabled.
-+\item s2s connections are listened for on port 5269 (all IPv4 addresses)
-+ with STARTTLS for secured traffic enabled.
- Incoming and outgoing connections of remote Jabber servers are denied,
- only two servers can connect: "jabber.example.org" and "example.com".
--\item Port 5280 is serving the Web Admin and the HTTP Polling service. Note
-+\item Port 5280 is serving the Web Admin and the HTTP Polling service
-+ in all the IPv4 addresses. Note
- that it is also possible to serve them on different ports. The second
- example in section~\ref{webadmin} shows how exactly this can be done.
- \item All users except for the administrators have a traffic of limit
- 1,000\,Bytes/second
- \item \ind{transports!AIM}The
- \footahref{http://www.ejabberd.im/pyaimt}{AIM transport}
-- \jid{aim.example.org} is connected to port 5233 with password
-- `\term{aimsecret}'.
-+ \jid{aim.example.org} is connected to port 5233 on localhost IP addresses
-+ (127.0.0.1 and ::1) with password `\term{aimsecret}'.
- \item \ind{transports!ICQ}The ICQ transport JIT (\jid{icq.example.org} and
- \jid{sms.example.org}) is connected to port 5234 with password
- `\term{jitsecret}'.
-@@ -950,13 +994,32 @@
- {access, c2s_shaper, [{none, admin},
- {normal, all}]}.
- {listen,
-- [{5222, ejabberd_c2s, [{access, c2s}, {shaper, c2s_shaper}]},
-- {5223, ejabberd_c2s, [{access, c2s},
-- ssl, {certfile, "/path/to/ssl.pem"}]},
-+ [{5222, ejabberd_c2s, [
-+ {access, c2s},
-+ {shaper, c2s_shaper}
-+ ]},
-+ {{5223, {192, 168, 0, 1}}, ejabberd_c2s, [
-+ {access, c2s},
-+ ssl, {certfile, "/path/to/ssl.pem"}
-+ ]},
-+ {{5223, {16#fdca, 16#8ab6, 16#a243, 16#75ef, 0, 0, 0, 1}},
-+ ejabberd_c2s, [
-+ {access, c2s},
-+ ssl, {certfile, "/path/to/ssl.pem"}
-+ ]},
- {5269, ejabberd_s2s_in, []},
-- {5280, ejabberd_http, [http_poll, web_admin]},
-- {5233, ejabberd_service, [{hosts, ["aim.example.org"],
-- [{password, "aimsecret"}]}]},
-+ {{5280, {0, 0, 0, 0}}, ejabberd_http, [
-+ http_poll,
-+ web_admin
-+ ]},
-+ {{5233, {127, 0, 0, 1}}, ejabberd_service, [
-+ {hosts, ["aim.example.org"],
-+ [{password, "aimsecret"}]}
-+ ]},
-+ {{5233, "::1"}, ejabberd_service, [
-+ {hosts, ["aim.example.org"],
-+ [{password, "aimsecret"}]}
-+ ]},
- {5234, ejabberd_service, [{hosts, ["icq.example.org", "sms.example.org"],
- [{password, "jitsecret"}]}]},
- {5235, ejabberd_service, [{hosts, ["msn.example.org"],
-@@ -3737,7 +3800,7 @@
- \item For security reasons, you can serve the Web Admin on a secured
- connection, on a port differing from the HTTP Polling interface, and bind it
- to the internal LAN IP. The Web Admin will be accessible by pointing your
-- web browser to \verb|https://192.168.1.1:5280/admin/|:
-+ web browser to \verb|https://192.168.1.1:5282/admin/|:
- \begin{verbatim}
-
- {hosts, ["example.org"]}.
-@@ -3745,9 +3808,13 @@
- {listen,
- [
- ...
-- {5270, ejabberd_http, [http_poll]},
-- {5280, ejabberd_http, [web_admin, {ip, {192, 168, 1, 1}},
-- tls, {certfile, "/usr/local/etc/server.pem"}]},
-+ {5280, ejabberd_http, [
-+ http_poll
-+ ]},
-+ {{5282, "192.168.1.1"}, ejabberd_http, [
-+ web_admin,
-+ tls, {certfile, "@PKG_SYSCONFDIR@/server.pem"}
-+ ]},
- ...
- ]}.
- \end{verbatim}
diff --git a/chat/ejabberd/patches/patch-ad b/chat/ejabberd/patches/patch-ad
index d12f8ecee51..c825dfc0e26 100644
--- a/chat/ejabberd/patches/patch-ad
+++ b/chat/ejabberd/patches/patch-ad
@@ -1,22 +1,16 @@
-$NetBSD: patch-ad,v 1.3 2009/03/22 10:39:44 martti Exp $
+$NetBSD: patch-ad,v 1.4 2009/12/15 13:30:54 fhajny Exp $
-Modified to use IPv6/v4 patch (https://support.process-one.net/browse/EJAB-389)
-
---- src/ejabberd.cfg.example.orig 2009-03-12 08:41:02.000000000 +0000
-+++ src/ejabberd.cfg.example 2009-03-22 10:27:16.000000000 +0000
-@@ -108,10 +108,9 @@
+--- src/ejabberd.cfg.example.orig 2009-11-06 19:53:19.000000000 +0000
++++ src/ejabberd.cfg.example
+@@ -109,7 +109,6 @@
[
{5222, ejabberd_c2s, [
-
%%
%% If TLS is compiled and you installed a SSL
-- %% certificate, put the correct path to the
-+ %% certificate, put the correct path to the
- %% file and uncomment this line:
- %%
- %%{certfile, "/path/to/ssl.pem"}, starttls,
-@@ -124,12 +123,12 @@
+ %% certificate, put the correct path to the
+@@ -125,12 +124,12 @@
%%
%% To enable the old SSL connection method in port 5223:
%%
@@ -35,59 +29,25 @@ Modified to use IPv6/v4 patch (https://support.process-one.net/browse/EJAB-389)
{5269, ejabberd_s2s_in, [
{shaper, s2s_shaper},
-@@ -139,14 +138,14 @@
+@@ -140,10 +139,10 @@
%%
%% ejabberd_service: Interact with external components (transports...)
%%
- %%{8888, ejabberd_service, [
-- %% {access, all},
-- %% {shaper_rule, fast},
-- %% {ip, {127, 0, 0, 1}},
-- %% {hosts, ["icq.example.org", "sms.example.org"],
-- %% [{password, "secret"}]
-- %% }
-- %% ]},
+ %%{{8888, "127.0.0.1"},
+ %% ejabberd_service, [
-+ %% {access, all},
-+ %% {shaper_rule, fast},
-+ %% {hosts, ["icq.example.org", "sms.example.org"],
-+ %% [{password, "secret"}]
-+ %% }
-+ %% ]},
-
- {5280, ejabberd_http, [
- http_poll,
-@@ -225,17 +224,26 @@
- %% List of LDAP servers:
- %%{ldap_servers, ["localhost"]}.
- %%
--%% LDAP attribute that holds user ID:
--%%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
-+%% Encryption of connection to LDAP servers:
-+%%{ldap_encrypt, tls}.
- %%
--%% Search base of LDAP directory:
--%%{ldap_base, "dc=example,dc=com"}.
-+%% Port connect to LDAP server:
-+%%{ldap_port, 636}.
+ %% {access, all},
+ %% {shaper_rule, fast},
+- %% {ip, {127, 0, 0, 1}},
+ %% {hosts, ["icq.example.org", "sms.example.org"],
+ %% [{password, "secret"}]
+ %% }
+@@ -465,7 +464,7 @@
%%
- %% LDAP manager:
--%%{ldap_rootdn, "dc=example,dc=com"}.
-+%%{ldap_rootdn, "dc=example,dc=com"}.
+ %% Full path to a script that generates the image.
%%
- %% Password to LDAP manager:
--%%{ldap_password, "******"}.
-+%%{ldap_password, "******"}.
-+%%
-+%% Search base of LDAP directory:
-+%%{ldap_base, "dc=example,dc=com"}.
-+%%
-+%% LDAP attribute that holds user ID:
-+%%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
-+%%
-+%% LDAP filter:
-+%%{ldap_filter, "(objectClass=shadowAccount)"}.
+-%%{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.
++%%{captcha_cmd, "@PREFIX@/lib/erlang/lib/@DISTNAME@/priv/bin/captcha.sh"}.
%%
- %% Anonymous login support:
+ %% Host part of the URL sent to the user.
diff --git a/chat/ejabberd/patches/patch-ae b/chat/ejabberd/patches/patch-ae
index aa65b1561cc..bf6f4fbbcda 100644
--- a/chat/ejabberd/patches/patch-ae
+++ b/chat/ejabberd/patches/patch-ae
@@ -1,38 +1,26 @@
-$NetBSD: patch-ae,v 1.3 2008/11/12 13:13:59 martti Exp $
+$NetBSD: patch-ae,v 1.4 2009/12/15 13:30:54 fhajny Exp $
-Modified for pkgsrc
-
---- src/ejabberdctl.template.orig 2008-08-27 12:37:52.000000000 +0300
+--- src/ejabberdctl.template.orig 2009-11-16 20:25:51.344260518 +0000
+++ src/ejabberdctl.template
-@@ -14,8 +14,8 @@ ERLANG_NODE=$NODE@$HOST
- 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=@EJABBERD_LOGDIR@
-+EJABBERD_DB=@EJABBERD_VARDIR@/spool/ejabberd/db/$NODE
-
- # read custom configuration
- CONFIG=$ROOTDIR/etc/ejabberd/ejabberdctl.cfg
-@@ -43,16 +43,16 @@ NAME=-name
- ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES"
+@@ -43,10 +43,10 @@ if [ "$EJABBERDCTL_CONFIG_PATH" = "" ] ;
+ fi
+ [ -f "$EJABBERDCTL_CONFIG_PATH" ] && . "$EJABBERDCTL_CONFIG_PATH"
+ if [ "$LOGS_DIR" = "" ] ; then
+- LOGS_DIR=@LOCALSTATEDIR@/log/ejabberd
++ LOGS_DIR=@EJABBERD_LOGDIR@
+ fi
+ if [ "$SPOOLDIR" = "" ] ; then
+- SPOOLDIR=@LOCALSTATEDIR@/lib/ejabberd
++ SPOOLDIR=@EJABBERD_DB@
+ fi
+ if [ "$EJABBERD_DOC_PATH" = "" ] ; then
+ EJABBERD_DOC_PATH=@DOCDIR@
+@@ -83,7 +83,7 @@ ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_
# 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_BIN_PATH=$ROOTDIR/var/lib/ejabberd/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
-+HOME=@EJABBERD_VARDIR@/spool/ejabberd/db/$NODE
-
- # export global variables
- export EJABBERD_CONFIG_PATH
+ if [ "$EJABBERDDIR" = "" ]; then
+- EJABBERDDIR=@LIBDIR@/ejabberd
++ EJABBERDDIR=@LIBDIR@/erlang/lib/@DISTNAME@
+ fi
+ if [ "$EJABBERD_EBIN_PATH" = "" ]; then
+ EJABBERD_EBIN_PATH=$EJABBERDDIR/ebin
diff --git a/chat/ejabberd/patches/patch-af b/chat/ejabberd/patches/patch-af
deleted file mode 100644
index ed0c27e215e..00000000000
--- a/chat/ejabberd/patches/patch-af
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-af,v 1.1 2008/11/12 13:13:59 martti Exp $
-
-Modified to use IPv6/v4 patch (https://support.process-one.net/browse/EJAB-389)
-
---- src/ejabberd_config.erl.orig 2008-08-27 12:37:52.000000000 +0300
-+++ src/ejabberd_config.erl
-@@ -140,8 +140,16 @@ process_term(Term, State) ->
- {host_config, Host, Terms} ->
- lists:foldl(fun(T, S) -> process_host_term(T, Host, S) end,
- State, Terms);
-- {listen, Val} ->
-- add_option(listen, Val, State);
-+ {listen, Listeners} ->
-+ Listeners2 =
-+ lists:map(
-+ fun({PortIP, Module, Opts}) ->
-+ {Port, IPT, _, _, OptsClean} =
-+ ejabberd_listener:parse_listener_portip(PortIP, Opts),
-+ {{Port, IPT}, Module, OptsClean}
-+ end,
-+ Listeners),
-+ add_option(listen, Listeners2, State);
- {language, Val} ->
- add_option(language, Val, State);
- {outgoing_s2s_port, Port} ->
diff --git a/chat/ejabberd/patches/patch-ag b/chat/ejabberd/patches/patch-ag
deleted file mode 100644
index b1eb395bb14..00000000000
--- a/chat/ejabberd/patches/patch-ag
+++ /dev/null
@@ -1,205 +0,0 @@
-$NetBSD: patch-ag,v 1.2 2009/02/03 12:07:26 martti Exp $
-
-Modified to use IPv6/v4 patch (https://support.process-one.net/browse/EJAB-389)
-
---- src/ejabberd_listener.erl.orig 2009-01-14 11:54:15.000000000 +0200
-+++ src/ejabberd_listener.erl 2009-02-03 08:21:35.000000000 +0200
-@@ -32,6 +32,7 @@
- init_ssl/4,
- start_listener/3,
- stop_listener/1,
-+ parse_listener_portip/2,
- add_listener/3,
- delete_listener/1
- ]).
-@@ -50,8 +51,7 @@
- undefined ->
- ignore;
- Ls ->
-- {ok, {{one_for_one, 10, 1},
-- lists:map(
-+ Ls2 = lists:map(
- fun({Port, Module, Opts}) ->
- {Port,
- {?MODULE, start, [Port, Module, Opts]},
-@@ -59,7 +59,20 @@
- brutal_kill,
- worker,
- [?MODULE]}
-- end, Ls)}}
-+ end, Ls),
-+ report_duplicated_portips(Ls),
-+ {ok, {{one_for_one, 10, 1}, Ls2}}
-+ end.
-+
-+report_duplicated_portips(L) ->
-+ LKeys = [Port || {Port, _, _} <- L],
-+ LNoDupsKeys = proplists:get_keys(L),
-+ case LKeys -- LNoDupsKeys of
-+ [] -> ok;
-+ Dups ->
-+ ?CRITICAL_MSG("In the ejabberd configuration there are duplicated "
-+ "Port number + IP address:~n ~p",
-+ [Dups])
- end.
-
-
-@@ -84,7 +97,11 @@
- end
- end.
-
--init(Port, Module, Opts) ->
-+init(PortIP, Module, Opts1) ->
-+ {Port, IPT, IPS, IPV, OptsClean} = parse_listener_portip(PortIP, Opts1),
-+ %% The first inet|inet6 and the last {ip, _} work,
-+ %% so overriding those in Opts
-+ Opts = [IPV | OptsClean] ++ [{ip, IPT}],
- SockOpts = lists:filter(fun({ip, _}) -> true;
- (inet6) -> true;
- (inet) -> true;
-@@ -103,11 +120,77 @@
- {ok, ListenSocket} ->
- accept(ListenSocket, Module, Opts);
- {error, Reason} ->
-- ?ERROR_MSG("Failed to open socket for ~p: ~p",
-- [{Port, Module, Opts}, Reason]),
-- error
-+ ReasonT = case Reason of
-+ eaddrnotavail -> "IP address not available: " ++ IPS;
-+ _ -> atom_to_list(Reason)
-+ end,
-+ ?ERROR_MSG("Failed to open socket:~n ~p~nReason: ~s",
-+ [{Port, Module, SockOpts}, ReasonT]),
-+ {error, ReasonT}
- end.
-
-+%% @spec (PortIP, Opts) -> {Port, IPT, IPS, IPV, OptsClean}
-+%% where
-+%% PortIP = Port | {Port, IPT | IPS}
-+%% Port = integer()
-+%% IPT = tuple()
-+%% IPS = string()
-+%% IPV = inet | inet6
-+%% Opts = [IPV | {ip, IPT} | atom() | tuple()]
-+%% OptsClean = [atom() | tuple()]
-+%% @doc Parse any kind of ejabberd listener specification.
-+%% The parsed options are returned in several formats.
-+%% OptsClean does not include inet/inet6 or ip options.
-+%% Opts can include the options inet6 and {ip, Tuple},
-+%% but they are only used when no IP address was specified in the PortIP.
-+%% The IP version (either IPv4 or IPv6) is inferred from the IP address type,
-+%% so the option inet/inet6 is only used when no IP is specified at all.
-+parse_listener_portip(PortIP, Opts) ->
-+ {IPOpt, Opts2} = strip_ip_option(Opts),
-+ {IPVOpt, OptsClean} = case lists:member(inet6, Opts2) of
-+ true -> {inet6, Opts2 -- [inet6]};
-+ false -> {inet, Opts2}
-+ end,
-+ {Port, IPT, IPS} = case PortIP of
-+ P when is_integer(P) ->
-+ T = get_ip_tuple(IPOpt, IPVOpt),
-+ S = inet_parse:ntoa(T),
-+ {P, T, S};
-+ {P, T} when is_integer(P) and is_tuple(T) ->
-+ S = inet_parse:ntoa(T),
-+ {P, T, S};
-+ {P, S} when is_integer(P) and is_list(S) ->
-+ [S | _] = string:tokens(S, "/"),
-+ {ok, T} = inet_parse:address(S),
-+ {P, T, S}
-+ end,
-+ IPV = case size(IPT) of
-+ 4 -> inet;
-+ 8 -> inet6
-+ end,
-+ {Port, IPT, IPS, IPV, OptsClean}.
-+
-+strip_ip_option(Opts) ->
-+ {IPL, OptsNoIP} = lists:partition(
-+ fun({ip, _}) -> true;
-+ (_) -> false
-+ end,
-+ Opts),
-+ case IPL of
-+ %% Only the first ip option is considered
-+ [{ip, T1} | _] when is_tuple(T1) ->
-+ {T1, OptsNoIP};
-+ [] ->
-+ {no_ip_option, OptsNoIP}
-+ end.
-+
-+get_ip_tuple(no_ip_option, inet) ->
-+ {0, 0, 0, 0};
-+get_ip_tuple(no_ip_option, inet6) ->
-+ {0, 0, 0, 0, 0, 0, 0, 0};
-+get_ip_tuple(IPOpt, _IPVOpt) ->
-+ IPOpt.
-+
- accept(ListenSocket, Module, Opts) ->
- case gen_tcp:accept(ListenSocket) of
- {ok, Socket} ->
-@@ -182,6 +265,7 @@
- end.
-
-
-+%% @spec (Port, Module, Opts) -> {ok, Pid} | {error, Error}
- start_listener(Port, Module, Opts) ->
- ChildSpec = {Port,
- {?MODULE, start, [Port, Module, Opts]},
-@@ -195,26 +279,49 @@
- supervisor:terminate_child(ejabberd_listeners, Port),
- supervisor:delete_child(ejabberd_listeners, Port).
-
--add_listener(Port, Module, Opts) ->
-+%% @spec (PortIP, Module, Opts) -> {ok, Pid} | {error, Error}
-+%% where
-+%% PortIP = {Port, IPT | IPS}
-+%% Port = integer()
-+%% IPT = tuple()
-+%% IPS = string()
-+%% IPV = inet | inet6
-+%% Module = atom()
-+%% Opts = [IPV | {ip, IPT} | atom() | tuple()]
-+%% @doc Add a listener and store in config if success
-+add_listener(PortIP, Module, Opts) ->
-+ case start_listener(PortIP, Module, Opts) of
-+ {ok, _Pid} ->
- 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(PortIP, 1, Ports),
-+ Ports2 = [{PortIP, Module, Opts} | Ports1],
- ejabberd_config:add_local_option(listen, Ports2),
-- start_listener(Port, Module, Opts).
-+ ok;
-+ {error, {already_started, _Pid}} ->
-+ {error, {already_started, PortIP}};
-+ {error, Error} ->
-+ {error, Error}
-+ end.
-
--delete_listener(Port) ->
-+%% @spec (PortIP) -> ok
-+%% where
-+%% PortIP = {Port, IPT | IPS}
-+%% Port = integer()
-+%% IPT = tuple()
-+%% IPS = string()
-+delete_listener(PortIP) ->
- Ports = case ejabberd_config:get_local_option(listen) of
- undefined ->
- [];
- Ls ->
- Ls
- end,
-- Ports1 = lists:keydelete(Port, 1, Ports),
-+ Ports1 = lists:keydelete(PortIP, 1, Ports),
- ejabberd_config:add_local_option(listen, Ports1),
-- stop_listener(Port).
-+ stop_listener(PortIP).
-
diff --git a/chat/ejabberd/patches/patch-ah b/chat/ejabberd/patches/patch-ah
deleted file mode 100644
index fdbb14c16bb..00000000000
--- a/chat/ejabberd/patches/patch-ah
+++ /dev/null
@@ -1,50 +0,0 @@
-$NetBSD: patch-ah,v 1.2 2009/03/22 10:39:44 martti Exp $
-
-Modified to use IPv6/v4 patch (https://support.process-one.net/browse/EJAB-389)
-
---- src/mod_proxy65/mod_proxy65_service.erl.orig 2009-03-12 08:41:02.000000000 +0000
-+++ src/mod_proxy65/mod_proxy65_service.erl 2009-03-22 10:27:50.000000000 +0000
-@@ -52,6 +52,7 @@
- name,
- stream_addr,
- port,
-+ ip,
- acl
- }).
-
-@@ -69,14 +70,14 @@
- gen_server:start_link({local, Proc}, ?MODULE, [Host, Opts], []).
-
- init([Host, Opts]) ->
-- {IP, State} = parse_options(Host, Opts),
-- NewOpts = [Host, {ip, IP} | Opts],
-- ejabberd_listener:add_listener(State#state.port, mod_proxy65_stream, NewOpts),
-+ State = parse_options(Host, Opts),
-+ NewOpts = [Host | Opts],
-+ ejabberd_listener:add_listener({State#state.port, State#state.ip}, mod_proxy65_stream, NewOpts),
- ejabberd_router:register_route(State#state.myhost),
- {ok, State}.
-
--terminate(_Reason, #state{myhost=MyHost, port=Port}) ->
-- catch ejabberd_listener:delete_listener(Port),
-+terminate(_Reason, #state{myhost=MyHost, port=Port, ip=IP}) ->
-+ catch ejabberd_listener:delete_listener({Port, IP}),
- ejabberd_router:unregister_route(MyHost),
- ok.
-
-@@ -202,12 +203,13 @@
- end,
- StrIP = inet_parse:ntoa(IP),
- StreamAddr = [{"jid", MyHost}, {"host", StrIP}, {"port", integer_to_list(Port)}],
-- {IP, #state{myhost = MyHost,
-+ #state{myhost = MyHost,
- serverhost = ServerHost,
- name = Name,
- port = Port,
-+ ip = IP,
- stream_addr = StreamAddr,
-- acl = ACL}}.
-+ acl = ACL}.
-
- get_my_ip() ->
- {ok, MyHostName} = inet:gethostname(),
diff --git a/chat/ejabberd/patches/patch-ai b/chat/ejabberd/patches/patch-ai
deleted file mode 100644
index a77f5de2720..00000000000
--- a/chat/ejabberd/patches/patch-ai
+++ /dev/null
@@ -1,158 +0,0 @@
-$NetBSD: patch-ai,v 1.2 2009/03/22 10:39:44 martti Exp $
-
-Modified to use IPv6/v4 patch (https://support.process-one.net/browse/EJAB-389)
-
---- src/web/ejabberd_web_admin.erl.orig 2009-03-12 08:41:02.000000000 +0000
-+++ src/web/ejabberd_web_admin.erl 2009-03-22 10:28:12.000000000 +0000
-@@ -1805,15 +1805,21 @@
- ok;
- {'EXIT', _Reason} ->
- error;
-+ {is_added, ok} ->
-+ ok;
-+ {is_added, {error, Reason}} ->
-+ {error, io_lib:format("~p", [Reason])};
- _ ->
- nothing
- end,
-+ %% TODO: This sorting does not work when [{{Port, IP}, Module, Opts}]
- NewPorts = lists:sort(
- rpc:call(Node, ejabberd_config, get_local_option, [listen])),
- [?XC("h1", ?T("Listened Ports at ") ++ atom_to_list(Node))] ++
- case Res of
- ok -> [?CT("Submitted"), ?P];
- error -> [?CT("Bad format"), ?P];
-+ {error, ReasonT} -> [?CT("Problem: "), ?C(ReasonT), ?P];
- nothing -> []
- end ++
- [?XAE("form", [{"action", ""}, {"method", "post"}],
-@@ -2051,58 +2057,76 @@
- [?XE("thead",
- [?XE("tr",
- [?XCT("td", "Port"),
-+ ?XCT("td", "IP"),
- ?XCT("td", "Module"),
- ?XCT("td", "Options")
- ])]),
- ?XE("tbody",
- lists:map(
-- fun({Port, Module, Opts} = _E) ->
-- SPort = integer_to_list(Port),
-+ fun({PortIP, Module, Opts} = _E) ->
-+ {_Port, SPort, _TIP, SIP, SSPort, OptsClean} =
-+ get_port_data(PortIP, Opts),
- SModule = atom_to_list(Module),
- %%ID = term_to_id(E),
- ?XE("tr",
-- [?XC("td", SPort),
-- ?XE("td", [?INPUT("text", "module" ++ SPort,
-- SModule)]),
-- ?XE("td", [?INPUTS("text", "opts" ++ SPort,
-- term_to_string(Opts), "40")]),
-- ?XE("td", [?INPUTT("submit", "add" ++ SPort,
-+ [?XAE("td", [{"size", "6"}], [?C(SPort)]),
-+ ?XAE("td", [{"size", "15"}], [?C(SIP)]),
-+ ?XE("td", [?INPUTS("text", "module" ++ SSPort,
-+ SModule, "15")]),
-+ ?XE("td", [?INPUTS("text", "opts" ++ SSPort,
-+ term_to_string(OptsClean), "40")]),
-+ ?XE("td", [?INPUTT("submit", "add" ++ SSPort,
- "Update")]),
-- ?XE("td", [?INPUTT("submit", "delete" ++ SPort,
-+ ?XE("td", [?INPUTT("submit", "delete" ++ SSPort,
- "Delete")])
- ]
- )
- end, Ports) ++
- [?XE("tr",
- [?XE("td", [?INPUTS("text", "portnew", "", "6")]),
-- ?XE("td", [?INPUT("text", "modulenew", "")]),
-- ?XE("td", [?INPUTS("text", "optsnew", "", "40")]),
-+ ?XE("td", [?INPUTS("text", "ipnew", "0.0.0.0", "15")]),
-+ ?XE("td", [?INPUTS("text", "modulenew", "", "17")]),
-+ ?XE("td", [?INPUTS("text", "optsnew", "[]", "40")]),
- ?XAE("td", [{"colspan", "2"}],
- [?INPUTT("submit", "addnew", "Add New")])
- ]
- )]
- )]).
-
-+get_port_data(PortIP, Opts) ->
-+ {Port, IPT, IPS, _IPV, OptsClean} = ejabberd_listener:parse_listener_portip(PortIP, Opts),
-+ SPort = io_lib:format("~p", [Port]),
-+
-+ SSPort = lists:flatten(
-+ lists:map(
-+ fun(N) -> io_lib:format("~.16b", [N]) end,
-+ binary_to_list(crypto:md5(SPort++IPS)))),
-+ {Port, SPort, IPT, IPS, SSPort, OptsClean}.
-
- node_ports_parse_query(Node, Ports, Query) ->
- lists:foreach(
-- fun({Port, _Module1, _Opts1}) ->
-- SPort = integer_to_list(Port),
-- case lists:keysearch("add" ++ SPort, 1, Query) of
-+ fun({PortIP, _Module1, Opts1}) ->
-+ {Port, _SPort, TIP, _SIP, SSPort, _OptsClean} =
-+ get_port_data(PortIP, Opts1),
-+ case lists:keysearch("add" ++ SSPort, 1, Query) of
- {value, _} ->
-+ PortIP2 = {Port, TIP},
- {{value, {_, SModule}}, {value, {_, SOpts}}} =
-- {lists:keysearch("module" ++ SPort, 1, Query),
-- lists:keysearch("opts" ++ SPort, 1, Query)},
-+ {lists:keysearch("module" ++ SSPort, 1, Query),
-+ lists:keysearch("opts" ++ SSPort, 1, Query)},
- Module = list_to_atom(SModule),
- {ok, Tokens, _} = erl_scan:string(SOpts ++ "."),
- {ok, Opts} = erl_parse:parse_term(Tokens),
-- rpc:call(Node, ejabberd_listener, delete_listener, [Port]),
-- rpc:call(Node, ejabberd_listener, add_listener, [Port, Module, Opts]),
-- throw(submitted);
-+ rpc:call(Node, ejabberd_listener, delete_listener,
-+ [PortIP2]),
-+ R=rpc:call(Node, ejabberd_listener, add_listener,
-+ [PortIP2, Module, Opts]),
-+ throw({is_added, R});
- _ ->
-- case lists:keysearch("delete" ++ SPort, 1, Query) of
-+ case lists:keysearch("delete" ++ SSPort, 1, Query) of
- {value, _} ->
-- rpc:call(Node, ejabberd_listener, delete_listener, [Port]),
-+ rpc:call(Node, ejabberd_listener, delete_listener,
-+ [PortIP]),
- throw(submitted);
- _ ->
- ok
-@@ -2112,17 +2136,28 @@
- case lists:keysearch("addnew", 1, Query) of
- {value, _} ->
- {{value, {_, SPort}},
-+ {value, {_, STIP}}, %% It is a string that may represent a tuple
- {value, {_, SModule}},
- {value, {_, SOpts}}} =
- {lists:keysearch("portnew", 1, Query),
-+ lists:keysearch("ipnew", 1, Query),
- lists:keysearch("modulenew", 1, Query),
- lists:keysearch("optsnew", 1, Query)},
-- Port = list_to_integer(SPort),
-+ {ok, Toks, _} = erl_scan:string(SPort ++ "."),
-+ {ok, Port2} = erl_parse:parse_term(Toks),
-+ {ok, ToksIP, _} = erl_scan:string(STIP ++ "."),
-+ STIP2 = case erl_parse:parse_term(ToksIP) of
-+ {ok, IPTParsed} -> IPTParsed;
-+ {error, _} -> STIP
-+ end,
- Module = list_to_atom(SModule),
- {ok, Tokens, _} = erl_scan:string(SOpts ++ "."),
- {ok, Opts} = erl_parse:parse_term(Tokens),
-- rpc:call(Node, ejabberd_listener, add_listener, [Port, Module, Opts]),
-- throw(submitted);
-+ {Port2, _SPort, IP2, _SIP, _SSPort, OptsClean} =
-+ get_port_data({Port2, STIP2}, Opts),
-+ R=rpc:call(Node, ejabberd_listener, add_listener,
-+ [{Port2, IP2}, Module, OptsClean]),
-+ throw({is_added, R});
- _ ->
- ok
- end.