Merge branch 'rebar' into 3.0.x

This commit is contained in:
Evgeniy Khramtsov 2013-05-28 00:12:00 +10:00
commit e4ec23919d
356 changed files with 2835 additions and 22211 deletions

20
.gitignore vendored
View File

@ -16,23 +16,3 @@
/doc/*.toc
/doc/contributed_modules.tex
/doc/version.tex
/src/*.beam
/src/*.so
/src/*.so.dSYM
/src/*/*.beam
/src/*/Makefile
/src/Makefile
/src/XmppAddr.asn1db
/src/XmppAddr.erl
/src/XmppAddr.hrl
/src/aclocal.m4
/src/autom4te.cache
/src/config.log
/src/config.status
/src/ejabberd.init
/src/ejabberdctl.example
/src/eldap/ELDAPv3.asn1db
/src/eldap/ELDAPv3.erl
/src/eldap/ELDAPv3.hrl
/src/eldap/eldap_filter_yecc.erl
/src/epam

238
Makefile.in Normal file
View File

@ -0,0 +1,238 @@
REBAR = @REBAR@
INSTALL = @INSTALL@
SED = @SED@
ERL = @ERL@
prefix = @prefix@
exec_prefix = @exec_prefix@
DESTDIR =
# /etc/ejabberd/
ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
# /sbin/
SBINDIR = $(DESTDIR)@sbindir@
# /lib/ejabberd/
EJABBERDDIR = $(DESTDIR)@libdir@/ejabberd
# /share/doc/ejabberd
PACKAGE_TARNAME = @PACKAGE_TARNAME@
datarootdir = @datarootdir@
DOCDIR = $(DESTDIR)@docdir@
# /usr/lib/ejabberd/ebin/
BEAMDIR = $(EJABBERDDIR)/ebin
# /usr/lib/ejabberd/include/
INCLUDEDIR = $(EJABBERDDIR)/include
# /usr/lib/ejabberd/priv/
PRIVDIR = $(EJABBERDDIR)/priv
# /usr/lib/ejabberd/priv/bin
PBINDIR = $(PRIVDIR)/bin
# /usr/lib/ejabberd/priv/lib
SODIR = $(PRIVDIR)/lib
# /usr/lib/ejabberd/priv/msgs
MSGSDIR = $(PRIVDIR)/msgs
# /var/lib/ejabberd/
SPOOLDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
# /var/lock/ejabberdctl
CTLLOCKDIR = $(DESTDIR)@localstatedir@/lock/ejabberdctl
# /var/lib/ejabberd/.erlang.cookie
COOKIEFILE = $(SPOOLDIR)/.erlang.cookie
# /var/log/ejabberd/
LOGDIR = $(DESTDIR)@localstatedir@/log/ejabberd
INSTALLUSER=@INSTALLUSER@
# if no user was enabled, don't set privileges or ownership
ifeq ($(INSTALLUSER),)
O_USER=
G_USER=
CHOWN_COMMAND=echo
CHOWN_OUTPUT=/dev/null
INIT_USER=root
else
O_USER=-o $(INSTALLUSER)
G_USER=-g $(INSTALLUSER)
CHOWN_COMMAND=chown
CHOWN_OUTPUT=&1
INIT_USER=$(INSTALLUSER)
endif
all: deps src
deps:
$(REBAR) get-deps
src:
$(REBAR) compile
translations:
contrib/extract_translations/prepare-translation.sh -updateall
doc:
echo making $$target in doc; \
(cd doc && $(MAKE) $$target) || exit 1
edoc:
$(ERL) -noinput +B -eval \
'case edoc:application(ejabberd, ".", []) of ok -> halt(0); error -> halt(1) end.'
install: all
#
# Configuration files
$(INSTALL) -d -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
$(SED) -e "s*{{rootdir}}*@prefix@*" \
-e "s*{{installuser}}*@INSTALLUSER@*" \
-e "s*{{libdir}}*@libdir@*" \
-e "s*{{sysconfdir}}*@sysconfdir@*" \
-e "s*{{localstatedir}}*@localstatedir@*" \
-e "s*{{docdir}}*@docdir@*" \
-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
#
# Administration script
[ -d $(SBINDIR) ] || $(INSTALL) -d -m 755 $(SBINDIR)
$(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
#
# Init script
$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*" \
-e "s*@installuser@*$(INIT_USER)*" ejabberd.init.template \
> ejabberd.init
chmod 755 ejabberd.init
#
# Binary Erlang files
$(INSTALL) -d $(BEAMDIR)
$(INSTALL) -m 644 ebin/*.app $(BEAMDIR)
$(INSTALL) -m 644 ebin/*.beam $(BEAMDIR)
$(INSTALL) -m 644 deps/*/ebin/*.app $(BEAMDIR)
$(INSTALL) -m 644 deps/*/ebin/*.beam $(BEAMDIR)
rm -f $(BEAMDIR)/configure.beam
#
# ejabberd header files
$(INSTALL) -d $(INCLUDEDIR)
$(INSTALL) -m 644 include/*.hrl $(INCLUDEDIR)
$(INSTALL) -m 644 deps/*/include/*.hrl $(INCLUDEDIR)
#
# Binary C programs
$(INSTALL) -d $(PBINDIR)
$(INSTALL) -m 750 $(O_USER) tools/captcha.sh $(PBINDIR)
#
# Binary system libraries
$(INSTALL) -d $(SODIR)
#$(INSTALL) -m 644 priv/lib/*.so $(SODIR)
$(INSTALL) -m 644 deps/*/priv/lib/*.so $(SODIR)
#
# Translated strings
$(INSTALL) -d $(MSGSDIR)
$(INSTALL) -m 644 priv/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) ; }
#
# ejabberdctl lock directory
$(INSTALL) -d -m 750 $(O_USER) $(CTLLOCKDIR)
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(CTLLOCKDIR) >$(CHOWN_OUTPUT)
chmod -R 750 $(CTLLOCKDIR)
#
# Log directory
$(INSTALL) -d -m 750 $(O_USER) $(LOGDIR)
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
chmod -R 750 $(LOGDIR)
#
# Documentation
$(INSTALL) -d $(DOCDIR)
$(INSTALL) -m 644 doc/dev.html $(DOCDIR)
$(INSTALL) -m 644 doc/guide.html $(DOCDIR)
$(INSTALL) -m 644 doc/*.png $(DOCDIR)
$(INSTALL) -m 644 doc/*.txt $(DOCDIR)
[ -f doc/guide.pdf ] \
&& $(INSTALL) -m 644 doc/guide.pdf $(DOCDIR) \
|| echo "No doc/guide.pdf was built"
$(INSTALL) -m 644 COPYING $(DOCDIR)
uninstall: uninstall-binary
uninstall-binary:
rm -f $(SBINDIR)/ejabberdctl
rm -fr $(DOCDIR)
rm -f $(BEAMDIR)/*.beam
rm -f $(BEAMDIR)/*.app
rm -fr $(BEAMDIR)
rm -f $(INCLUDEDIR)/*.hrl
rm -fr $(INCLUDEDIR)
rm -fr $(PBINDIR)
rm -f $(SODIR)/*.so
rm -fr $(SODIR)
rm -f $(MSGSDIR)/*.msgs
rm -fr $(MSGSDIR)
rm -fr $(PRIVDIR)
rm -fr $(EJABBERDDIR)
uninstall-all: uninstall-binary
rm -rf $(ETCDIR)
rm -rf $(EJABBERDDIR)
rm -rf $(SPOOLDIR)
rm -rf $(CTLLOCKDIR)
rm -rf $(LOGDIR)
clean:
$(REBAR) clean
clean-rel:
rm -rf rel/ejabberd
distclean: clean clean-rel
rm -f config.status
rm -f config.log
rm -rf autom4te.cache
rm -rf deps
rm -rf ebin
rm -f Makefile
rm -f vars.config
rm -f src/ejabberd.app.src
[ ! -f ../ChangeLog ] || rm -f ../ChangeLog
rel: all
$(REBAR) generate
TAGS:
etags *.erl
Makefile: Makefile.in
deps := $(filter-out deps/riak_pb/ebin, $(wildcard deps/*/ebin))
erlang.plt:
-dialyzer --build_plt --output_plt erlang.plt \
--apps kernel stdlib sasl crypto public_key ssl mnesia \
inets odbc tools compiler erts webtool runtime_tools asn1 \
observer xmerl et gs wx syntax_tools $(deps)
plt: erlang.plt
dialyzer: plt
-dialyzer --plt erlang.plt --add_to_plt --output_plt ejabberd.plt \
--get_warnings -o dialyzer.log ebin
.PHONY: src doc edoc dialyzer Makefile TAGS clean clean-rel distclean rel plt \
install uninstall uninstall-binary uninstall-all translations

4
README
View File

@ -14,8 +14,6 @@ To compile ejabberd you need:
- OpenSSL 0.9.8 or higher, for STARTTLS, SASL and SSL encryption.
- Zlib 1.2.3 or higher, for Stream Compression support
(XEP-0138). Optional.
- Erlang mysql library. Optional. MySQL authentication/storage.
- Erlang pgsql library. Optional. PostgreSQL authentication/storage.
- PAM library. Optional. For Pluggable Authentication Modules (PAM).
- GNU Iconv 1.8 or higher, for the IRC Transport
(mod_irc). Optional. Not needed on systems with GNU Libc.
@ -25,7 +23,7 @@ To compile ejabberd you need:
1. Compile and install on *nix systems
To compile ejabberd, go to the directory src/ and execute the commands:
To compile ejabberd execute the commands:
./configure
make

File diff suppressed because it is too large Load Diff

266
configure.ac Normal file
View File

@ -0,0 +1,266 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.53)
AC_PACKAGE_VERSION(3.0.0)
AC_INIT(ejabberd, 3.0.0, [ejabberd@process-one.net], [ejabberd])
# Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_SED
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
# Checks Erlang runtime and compiler
AC_ERLANG_NEED_ERL
AC_ERLANG_NEED_ERLC
# Checks and sets ERLANG_ROOT_DIR and ERLANG_LIB_DIR variable
# AC_ERLANG_SUBST_ROOT_DIR
# AC_ERLANG_SUBST_LIB_DIR
#locating escript
AC_PATH_PROG([ESCRIPT], [escript], [])
#locating rebar
AC_PATH_PROG([REBAR], [rebar], [./rebar])
#locating make
AC_CHECK_PROG([MAKE], [make], [make], [])
if test "x$ESCRIPT" = "x"; then
AC_MSG_ERROR(['escript' was not found])
fi
if test "x$MAKE" = "x"; then
AC_MSG_ERROR(['make' was not found])
fi
# Change default prefix
AC_PREFIX_DEFAULT(/)
AC_ARG_ENABLE(hipe,
[AC_HELP_STRING([--enable-hipe], [compile natively with HiPE, not recommended (default: no)])],
[case "${enableval}" in
yes) hipe=true ;;
no) hipe=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-hipe) ;;
esac],[hipe=false])
AC_ARG_ENABLE(roster_gateway_workaround,
[AC_HELP_STRING([--enable-roster-gateway-workaround], [turn on workaround for processing gateway subscriptions (default: no)])],
[case "${enableval}" in
yes) roster_gateway_workaround=true ;;
no) roster_gateway_workaround=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-roster-gateway-workaround) ;;
esac],[roster_gateway_workaround=false])
AC_ARG_ENABLE(flash_hack,
[AC_HELP_STRING([--enable-flash-hack], [support Adobe Flash client XML (default: no)])],
[case "${enableval}" in
yes) flash_hack=true ;;
no) flash_hack=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-flash-hack) ;;
esac],[flash_hack=false])
AC_ARG_ENABLE(transient_supervisors,
[AC_HELP_STRING([--enable-transient_supervisors], [use Erlang supervision for transient process (default: no)])],
[case "${enableval}" in
yes) transient_supervisors=true ;;
no) transient_supervisors=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-transient_supervisors) ;;
esac],[transient_supervisors=false])
AC_ARG_ENABLE(full_xml,
[AC_HELP_STRING([--enable-full-xml], [use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)])],
[case "${enableval}" in
yes) full_xml=true ;;
no) full_xml=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-full-xml) ;;
esac],[full_xml=false])
AC_ARG_ENABLE(mssql,
[AC_HELP_STRING([--enable-mssql], [use Microsoft SQL Server database (default: no, requires --enable-odbc)])],
[case "${enableval}" in
yes) db_type=mssql ;;
no) db_type=generic ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mssql) ;;
esac],[db_type=generic])
AC_ARG_ENABLE(tools,
[AC_HELP_STRING([--enable-tools], [build development tools (currently the ejabberd profiler only, default: no)])],
[case "${enableval}" in
yes) tools=true ;;
no) tools=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
esac],[tools=false])
AC_ARG_ENABLE(all,
[AC_HELP_STRING([--enable-all], [same as --enable-nif --enable-mysql --enable-pgsql --enable-pam --enable-zlib --enable-stun --enable-riak --enable-json --enable-iconv --enable-debug --enable-pubsub-ng --enable-http (useful for Dialyzer checks, default: no)])],
[case "${enableval}" in
yes) nif=true mysql=true pgsql=true pam=true zlib=true stun=true riak=true json=true iconv=true debug=true pubsub_ng=true http=true ;;
no) nif=false mysql=false pgsql=false pam=false zlib=false stun=false riak=false json=false iconv=false debug=false pubsub_ng=false http=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;;
esac],[])
AC_ARG_ENABLE(nif,
[AC_HELP_STRING([--enable-nif], [replace some functions with C equivalents. Requires Erlang R13B04 or higher (default: no)])],
[case "${enableval}" in
yes) nif=true ;;
no) nif=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-nif) ;;
esac],[if test "x$nif" = "x"; then nif=false; fi])
AC_ARG_ENABLE(mysql,
[AC_HELP_STRING([--enable-mysql], [enable MySQL support (default: no)])],
[case "${enableval}" in
yes) mysql=true ;;
no) mysql=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mysql) ;;
esac],[if test "x$mysql" = "x"; then mysql=false; fi])
AC_ARG_ENABLE(pgsql,
[AC_HELP_STRING([--enable-pgsql], [enable PostgreSQL support (default: no)])],
[case "${enableval}" in
yes) pgsql=true ;;
no) pgsql=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pgsql) ;;
esac],[if test "x$pgsql" = "x"; then pgsql=false; fi])
AC_ARG_ENABLE(pam,
[AC_HELP_STRING([--enable-pam], [enable PAM support (default: no)])],
[case "${enableval}" in
yes) pam=true ;;
no) pam=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pam) ;;
esac],[if test "x$pam" = "x"; then pam=false; fi])
AC_ARG_ENABLE(zlib,
[AC_HELP_STRING([--enable-zlib], [enable Stream Compression (XEP-0138) using zlib (default: yes)])],
[case "${enableval}" in
yes) zlib=true ;;
no) zlib=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-zlib) ;;
esac],[if test "x$zlib" = "x"; then zlib=true; fi])
AC_ARG_ENABLE(stun,
[AC_HELP_STRING([--enable-stun], [enable STUN support (default: no)])],
[case "${enableval}" in
yes) stun=true ;;
no) stun=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-stun) ;;
esac],[if test "x$stun" = "x"; then stun=false; fi])
AC_ARG_ENABLE(riak,
[AC_HELP_STRING([--enable-riak], [enable Riak support (default: no)])],
[case "${enableval}" in
yes) riak=true ;;
no) riak=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-riak) ;;
esac],[if test "x$riak" = "x"; then riak=false; fi])
AC_ARG_ENABLE(json,
[AC_HELP_STRING([--enable-json], [enable JSON support for mod_bosh (default: no)])],
[case "${enableval}" in
yes) json=true ;;
no) json=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-json) ;;
esac],[if test "x$json" = "x"; then json=false; fi])
AC_ARG_ENABLE(iconv,
[AC_HELP_STRING([--enable-iconv], [enable iconv support (default: yes)])],
[case "${enableval}" in
yes) iconv=true ;;
no) iconv=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-iconv) ;;
esac],[if test "x$iconv" = "x"; then iconv=true; fi])
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug], [enable debug information (default: yes)])],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],[if test "x$debug" = "x"; then debug=true; fi])
AC_ARG_ENABLE(pubsub_ng,
[AC_HELP_STRING([--enable-pubsub-ng], [enable PubSub NG (default: no)])],
[case "${enableval}" in
yes) pubsub_ng=true ;;
no) pubsub_ng=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pubsub-ng) ;;
esac],[if test "x$pubsub_ng" = "x"; then pubsub_ng=false; fi])
AC_ARG_ENABLE(http,
[AC_HELP_STRING([--enable-http], [build external HTTP libraries ('ibrowse' and 'lhttpc', default: no)])],
[case "${enableval}" in
yes) http=true ;;
no) http=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-http) ;;
esac],[if test "x$http" = "x"; then http=false; fi])
AC_CONFIG_FILES([Makefile
vars.config
src/ejabberd.app.src])
ENABLEUSER=""
AC_ARG_ENABLE(user,
[AS_HELP_STRING([--enable-user[[[[=USER]]]]], [allow this system user to start ejabberd (default: no)])],
[case "${enableval}" in
yes) ENABLEUSER=`whoami` ;;
no) ENABLEUSER="" ;;
*) ENABLEUSER=$enableval
esac],
[])
if test "$ENABLEUSER" != ""; then
echo "allow this system user to start ejabberd: $ENABLEUSER"
AC_SUBST([INSTALLUSER], [$ENABLEUSER])
fi
AC_ERLANG_CHECK_LIB([sasl], [],
[AC_MSG_ERROR([Erlang application 'sasl' was not found])])
AC_ERLANG_CHECK_LIB([crypto], [],
[AC_MSG_ERROR([Erlang application 'crypto' was not found])])
AC_ERLANG_CHECK_LIB([public_key], [],
[AC_MSG_ERROR([Erlang application 'public_key' was not found])])
AC_ERLANG_CHECK_LIB([ssl], [],
[AC_MSG_ERROR([Erlang application 'ssl' was not found])])
AC_ERLANG_CHECK_LIB([mnesia], [],
[AC_MSG_ERROR([Erlang application 'mnesia' was not found])])
AC_ERLANG_CHECK_LIB([inets], [],
[AC_MSG_ERROR([Erlang application 'inets' was not found])])
AC_ERLANG_CHECK_LIB([odbc], [],
[AC_MSG_ERROR([Erlang application 'odbc' was not found])])
AC_ERLANG_CHECK_LIB([compiler], [],
[AC_MSG_ERROR([Erlang application 'compiler' was not found])])
if test "x$tools" = "xtrue"; then
AC_ERLANG_CHECK_LIB([tools], [],
[AC_MSG_ERROR([Erlang application 'tools' was not found])])
AC_ERLANG_CHECK_LIB([runtime_tools], [],
[AC_MSG_ERROR([Erlang application 'runtime_tools' was not found])])
fi
AC_SUBST(hipe)
AC_SUBST(roster_gateway_workaround)
AC_SUBST(flash_hack)
AC_SUBST(transient_supervisors)
AC_SUBST(full_xml)
AC_SUBST(nif)
AC_SUBST(db_type)
AC_SUBST(mysql)
AC_SUBST(pgsql)
AC_SUBST(pam)
AC_SUBST(zlib)
AC_SUBST(stun)
AC_SUBST(riak)
AC_SUBST(json)
AC_SUBST(iconv)
AC_SUBST(debug)
AC_SUBST(pubsub_ng)
AC_SUBST(http)
AC_SUBST(tools)
AC_OUTPUT

View File

@ -15,13 +15,13 @@ prepare_dirs ()
ERL=`which erl`
EJA_SRC_DIR=$EJA_DIR/src/
EJA_MSGS_DIR=$EJA_SRC_DIR/msgs/
EJA_MSGS_DIR=$EJA_DIR/priv/msgs/
EXTRACT_DIR=$EJA_DIR/contrib/extract_translations/
EXTRACT_ERL=$EXTRACT_DIR/extract_translations.erl
EXTRACT_BEAM=$EXTRACT_DIR/extract_translations.beam
SRC_DIR=$RUN_DIR/src
MSGS_DIR=$SRC_DIR/msgs
MSGS_DIR=$EJA_DIR/priv/msgs
if !([[ -n $EJA_DIR ]])
then
@ -288,8 +288,8 @@ translation_instructions ()
echo " $MSGS_PATH"
}
EJA_DIR=`pwd`/..
RUN_DIR=`pwd`/..
EJA_DIR=`pwd`
RUN_DIR=`pwd`
PROJECT=ejabberd
while [ $# -ne 0 ] ; do

View File

@ -386,10 +386,34 @@ Some options that you may be interested in modifying:
\titem{--enable-pam}
Enable the PAM authentication method (see section \ref{pam}).
\titem{--enable-odbc or --enable-mssql}
\titem{--enable-mssql}
Required if you want to use an external database.
See section~\ref{database} for more information.
\titem{--enable-tools}
Enable the use of development tools.
\titem{--enable-mysql}
Enable MySQL support (see section \ref{mysql}).
\titem{--enable-pgsql}
Enable PostgreSQL support (see section \ref{pgsql}).
\titem{--enable-zlib}
Enable Stream Compression (XEP-0138) using zlib.
\titem{--enable-stun}
Enable STUN support (see section \ref{stun}).
\titem{--enable-riak}
Enable Riak support.
\titem{--enable-iconv}
Enable iconv support. This is needed for \term{mod\_irc} (see seciont \ref{modirc}).
\titem{--enable-debug}
Compile with \term{+debug\_info} enabled.
\titem{--enable-full-xml}
Enable the use of XML based optimisations.
It will for example use CDATA to escape characters in the XMPP stream.
@ -1257,6 +1281,7 @@ The following authentication methods are supported by \ejabberd{}:
\ref{mssql} and \ref{odbc}.
\item anonymous --- See section~\ref{saslanonymous}.
\item pam --- See section~\ref{pam}.
\item riak --- See section~\ref{riak}.
\end{itemize}
Account creation is only supported by internal, external and odbc methods.
@ -1972,14 +1997,8 @@ For example:
\makesubsection{mysql}{MySQL}
\ind{MySQL}\ind{MySQL!schema}
Although this section will describe \ejabberd{}'s configuration when you want to
use the native MySQL driver, it does not describe MySQL's installation and
database creation. Check the MySQL documentation and the tutorial \footahref{http://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver}{Using ejabberd with MySQL native driver} for information regarding these topics.
Note that the tutorial contains information about \ejabberd{}'s configuration
which is duplicate to this section.
Moreover, the file mysql.sql in the directory src/odbc might be interesting for
you. This file contains the \ejabberd{} schema for MySQL. At the end of the file
There is a file \term{mysql.sql} in the directory \term{odbc}.
This file contains the \ejabberd{} schema for MySQL. At the end of the file
you can find information to update your database schema.
@ -1987,19 +2006,13 @@ you can find information to update your database schema.
\ind{MySQL!Driver Compilation}
You can skip this step if you installed \ejabberd{} using a binary installer or
if the binary packages of \ejabberd{} you are using include support for MySQL.
if the binary packages of \ejabberd{} you are using include support for ODBC.
\begin{enumerate}
\item First, install the \footahref{http://support.process-one.net/doc/display/CONTRIBS/Yxa}{Erlang
MySQL library}. Make sure the compiled files are in your Erlang path; you can
put them for example in the same directory as your \ejabberd{} .beam files.
\item Then, configure and install \ejabberd{} with ODBC support enabled (this is
also needed for native MySQL support!). This can be done, by using next
commands:
Use \term{--enable-mysql} configure option in order to build \ejabberd{} with
MySQL support:
\begin{verbatim}
./configure --enable-odbc && make install
./configure --enable-mysql && make install
\end{verbatim}
\end{enumerate}
\makesubsubsection{configuremysql}{Database Connection}
@ -2072,16 +2085,9 @@ that you cannot have several variants of the same module loaded!
\makesubsection{mssql}{Microsoft SQL Server}
\ind{Microsoft SQL Server}\ind{Microsoft SQL Server!schema}
Although this section will describe \ejabberd{}'s configuration when you want to
use Microsoft SQL Server, it does not describe Microsoft SQL Server's
installation and database creation. Check the MySQL documentation and the
tutorial \footahref{http://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver}{Using ejabberd with MySQL native driver} for information regarding these topics.
Note that the tutorial contains information about \ejabberd{}'s configuration
which is duplicate to this section.
Moreover, the file mssql.sql in the directory src/odbc might be interesting for
you. This file contains the \ejabberd{} schema for Microsoft SQL Server. At the end
of the file you can find information to update your database schema.
There is a file \term{mssql.sql} in the directory \term{odbc}.
This file contains the \ejabberd{} schema for Microsoft SQL Server. At the end of the file
you can find information to update your database schema.
\makesubsubsection{compilemssql}{Driver Compilation}
@ -2090,11 +2096,10 @@ of the file you can find information to update your database schema.
You can skip this step if you installed \ejabberd{} using a binary installer or
if the binary packages of \ejabberd{} you are using include support for ODBC.
If you want to use Microsoft SQL Server with ODBC, you need to configure,
compile and install \ejabberd{} with support for ODBC and Microsoft SQL Server
enabled. This can be done, by using next commands:
Use \term{--enable-mssql} configure option in order to build \ejabberd{} with
Microsoft SQL Server support:
\begin{verbatim}
./configure --enable-odbc --enable-mssql && make install
./configure --enable-mssql && make install
\end{verbatim}
@ -2139,13 +2144,7 @@ module loaded!
\makesubsection{pgsql}{PostgreSQL}
\ind{PostgreSQL}\ind{PostgreSQL!schema}
Although this section will describe \ejabberd{}'s configuration when you want to
use the native PostgreSQL driver, it does not describe PostgreSQL's installation
and database creation. Check the PostgreSQL documentation and the tutorial \footahref{http://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver}{Using ejabberd with MySQL native driver} for information regarding these topics.
Note that the tutorial contains information about \ejabberd{}'s configuration
which is duplicate to this section.
Also the file pg.sql in the directory src/odbc might be interesting for you.
There is a file \term{pg.sql} in the directory \term{odbc}.
This file contains the \ejabberd{} schema for PostgreSQL. At the end of the file
you can find information to update your database schema.
@ -2157,19 +2156,11 @@ You can skip this step if you installed \ejabberd{} using a binary installer or
if the binary packages of \ejabberd{} you are using include support for
PostgreSQL.
\begin{enumerate}
\item First, install the Erlang pgsql library from
\footahref{http://www.ejabberd.im/ejabberd-modules/}{ejabberd-modules SVN repository}.
Make sure the compiled
files are in your Erlang path; you can put them for example in the same
directory as your \ejabberd{} .beam files.
\item Then, configure, compile and install \ejabberd{} with ODBC support enabled
(this is also needed for native PostgreSQL support!). This can be done, by
using next commands:
Use \term{--enable-pgsql} configure option in order to build \ejabberd{} with
PostgreSQL support:
\begin{verbatim}
./configure --enable-odbc && make install
./configure --enable-pgsql && make install
\end{verbatim}
\end{enumerate}
\makesubsubsection{configurepgsql}{Database Connection}
@ -2236,31 +2227,6 @@ Keep in mind that you cannot have several variants of the same module loaded!
\makesubsection{odbc}{ODBC Compatible}
\ind{databases!ODBC}
Although this section will describe \ejabberd{}'s configuration when you want to
use the ODBC driver, it does not describe the installation and database creation
of your database. Check the documentation of your database. The tutorial \footahref{http://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver}{Using ejabberd with MySQL native driver} also can help you. Note that the tutorial
contains information about \ejabberd{}'s configuration which is duplicate to
this section.
\makesubsubsection{compileodbc}{Driver Compilation}
You can skip this step if you installed \ejabberd{} using a binary installer or
if the binary packages of \ejabberd{} you are using include support for
ODBC.
\begin{enumerate}
\item First, install the \footahref{http://support.process-one.net/doc/display/CONTRIBS/Yxa}{Erlang
MySQL library}. Make sure the compiled files are in your Erlang path; you can
put them for example in the same directory as your \ejabberd{} .beam files.
\item Then, configure, compile and install \ejabberd{} with ODBC support
enabled. This can be done, by using next commands:
\begin{verbatim}
./configure --enable-odbc && make install
\end{verbatim}
\end{enumerate}
\makesubsubsection{configureodbc}{Database Connection}
\ind{ODBC!Database Connection}

52
src/ejabberdctl.template → ejabberdctl.template Normal file → Executable file
View File

@ -7,12 +7,14 @@ ERL_MAX_PORTS=32000
ERL_PROCESSES=250000
ERL_MAX_ETS_TABLES=1400
SCRIPT_DIR=$(cd ${0%/*} && pwd)
# define default environment variables
NODE=ejabberd
HOST=localhost
ERLANG_NODE=$NODE@$HOST
ERL=@erl@
INSTALLUSER=@installuser@
ERL={{erl}}
INSTALLUSER={{installuser}}
# parse command line parameters
ARGS=
@ -33,7 +35,7 @@ done
# Define ejabberd variable if they have not been defined from the command line
if [ "$ETCDIR" = "" ] ; then
ETCDIR=@SYSCONFDIR@/ejabberd
ETCDIR={{sysconfdir}}/ejabberd
fi
if [ "$EJABBERD_CONFIG_PATH" = "" ] ; then
EJABBERD_CONFIG_PATH=$ETCDIR/ejabberd.cfg
@ -45,13 +47,13 @@ if [ -f "$EJABBERDCTL_CONFIG_PATH" ] ; then
. "$EJABBERDCTL_CONFIG_PATH"
fi
if [ "$LOGS_DIR" = "" ] ; then
LOGS_DIR=@LOCALSTATEDIR@/log/ejabberd
LOGS_DIR={{localstatedir}}/log/ejabberd
fi
if [ "$SPOOLDIR" = "" ] ; then
SPOOLDIR=@LOCALSTATEDIR@/lib/ejabberd
SPOOLDIR={{localstatedir}}/lib/ejabberd
fi
if [ "$EJABBERD_DOC_PATH" = "" ] ; then
EJABBERD_DOC_PATH=@DOCDIR@
EJABBERD_DOC_PATH={{docdir}}
fi
if [ "$ERLANG_NODE_ARG" != "" ] ; then
ERLANG_NODE=$ERLANG_NODE_ARG
@ -92,23 +94,25 @@ fi
ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES $ERL_OPTIONS"
# define additional environment variables
if [ "$EJABBERDDIR" = "" ] ; then
EJABBERDDIR=@LIBDIR@/ejabberd
fi
if [ "$EJABBERD_EBIN_PATH" = "" ] ; then
EJABBERD_EBIN_PATH=$EJABBERDDIR/ebin
fi
if [ "$EJABBERD_PRIV_PATH" = "" ] ; then
EJABBERD_PRIV_PATH=$EJABBERDDIR/priv
fi
if [ "$EJABBERD_BIN_PATH" = "" ] ; then
EJABBERD_BIN_PATH=$EJABBERD_PRIV_PATH/bin
fi
if [ "$EJABBERD_SO_PATH" = "" ] ; then
EJABBERD_SO_PATH=$EJABBERD_PRIV_PATH/lib
fi
if [ "$EJABBERD_MSGS_PATH" = "" ] ; then
EJABBERD_MSGS_PATH=$EJABBERD_PRIV_PATH/msgs
if [ "{{release}}" != "true" ] ; then
if [ "$EJABBERDDIR" = "" ] ; then
EJABBERDDIR={{libdir}}/ejabberd
fi
if [ "$EJABBERD_EBIN_PATH" = "" ] ; then
EJABBERD_EBIN_PATH=$EJABBERDDIR/ebin
fi
if [ "$EJABBERD_PRIV_PATH" = "" ] ; then
EJABBERD_PRIV_PATH=$EJABBERDDIR/priv
fi
if [ "$EJABBERD_BIN_PATH" = "" ] ; then
EJABBERD_BIN_PATH=$EJABBERD_PRIV_PATH/bin
fi
if [ "$EJABBERD_SO_PATH" = "" ] ; then
EJABBERD_SO_PATH=$EJABBERD_PRIV_PATH/lib
fi
if [ "$EJABBERD_MSGS_PATH" = "" ] ; then
EJABBERD_MSGS_PATH=$EJABBERD_PRIV_PATH/msgs
fi
fi
EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
@ -258,7 +262,7 @@ ctl ()
# using flock if available. Expects a linux-style
# flock that can lock a file descriptor.
MAXCONNID=100
CONNLOCKDIR=@LOCALSTATEDIR@/lock/ejabberdctl
CONNLOCKDIR={{localstatedir}}/lock/ejabberdctl
FLOCK='/usr/bin/flock'
if [ ! -x "$FLOCK" ] || [ ! -d "$CONNLOCKDIR" ] ; then
JOT='/usr/bin/jot'

View File

@ -27,7 +27,7 @@
-define(MYLANG, ejabberd_config:get_mylang()).
-define(MSGS_DIR, <<"msgs">>).
-define(MSGS_DIR, filename:join(["priv", "msgs"])).
-define(CONFIG_PATH, <<"ejabberd.cfg">>).
@ -59,27 +59,3 @@
-type scram() :: #scram{}.
-define(SCRAM_DEFAULT_ITERATION_COUNT, 4096).
%% ---------------------------------
%% Logging mechanism
-define(PRINT(Format, Args), io:format(Format, Args)).
-define(DEBUG(Format, Args),
ejabberd_logger:debug_msg(?MODULE, ?LINE, Format,
Args)).
-define(INFO_MSG(Format, Args),
ejabberd_logger:info_msg(?MODULE, ?LINE, Format, Args)).
-define(WARNING_MSG(Format, Args),
ejabberd_logger:warning_msg(?MODULE, ?LINE, Format,
Args)).
-define(ERROR_MSG(Format, Args),
ejabberd_logger:error_msg(?MODULE, ?LINE, Format,
Args)).
-define(CRITICAL_MSG(Format, Args),
ejabberd_logger:critical_msg(?MODULE, ?LINE, Format,
Args)).

View File

@ -215,6 +215,8 @@
-define(NS_BOB, <<"urn:xmpp:bob">>).
-include("xml.hrl").
-define(STANZA_ERROR(Code, Type, Condition),
#xmlel{name = <<"error">>,
attrs = [{<<"code">>, Code}, {<<"type">>, Type}],
@ -617,19 +619,6 @@
-type(ljid() :: {binary(), binary(), binary()}).
-record(xmlel,
{
name = <<"">> :: binary(),
attrs = [] :: [attr()],
children = [] :: [xmlel() | cdata()]
}).
-type(cdata() :: {xmlcdata, CData::binary()}).
-type(attr() :: {Name::binary(), Value::binary()}).
-type(xmlel() :: #xmlel{}).
-record(iq, {id = <<"">> :: binary(),
type = get :: get | set | result | error,
xmlns = <<"">> :: binary(),

View File

@ -1,9 +1,4 @@
%%%-------------------------------------------------------------------
%%% File : stringprep_sup.erl
%%% Author : Mickael Remond <mremond@process-one.net>
%%% Description : Supervisor for the Stringprep worker.
%%% Created : 29 Jun 2007 by Mickael Remond <mremond@process-one.net>
%%%
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2013 ProcessOne
%%%
@ -22,24 +17,20 @@
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
%%% 02111-1307 USA
%%%
%%%-------------------------------------------------------------------
%%%----------------------------------------------------------------------
-define(PRINT(Format, Args), io:format(Format, Args)).
-module(stringprep_sup).
-define(DEBUG(Format, Args),
ejabberd_logger:debug_msg(?MODULE, ?LINE, Format, Args)).
-behaviour(supervisor).
-define(INFO_MSG(Format, Args),
ejabberd_logger:info_msg(?MODULE, ?LINE, Format, Args)).
%% API
-export([start_link/0]).
-define(WARNING_MSG(Format, Args),
ejabberd_logger:warning_msg(?MODULE, ?LINE, Format, Args)).
%% Supervisor callbacks
-export([init/1]).
-define(ERROR_MSG(Format, Args),
ejabberd_logger:error_msg(?MODULE, ?LINE, Format, Args)).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
init([]) ->
StringPrep = {stringprep, {stringprep, start_link, []},
permanent, brutal_kill, worker, [stringprep]},
{ok, {{one_for_all, 10, 1}, [StringPrep]}}.
-define(CRITICAL_MSG(Format, Args),
ejabberd_logger:critical_msg(?MODULE, ?LINE, Format, Args)).

View File

View File

@ -273,15 +273,15 @@
Subscription_Options :: []}
).
-type(subscription()
:: {Subscription_State :: exmpp_pubsub:subscription_state(),
SubId :: exmpp_pubsub:subId(),
Resource :: undefined | xmpp_jid:resource_jid() | {'caps', xmpp_jid:resource_jid()},
Subscription_Options :: [] | pubsub_options:options_subscription()}
%% :: exmpp_pubsub:subscription_subscribed()
%% | exmpp_pubsub:subscription_pending()
%% | exmpp_pubsub:subscription_unconfigured()
).
%% -type(subscription()
%% :: {Subscription_State :: exmpp_pubsub:subscription_state(),
%% SubId :: exmpp_pubsub:subId(),
%% Resource :: undefined | xmpp_jid:resource_jid() | {'caps', xmpp_jid:resource_jid()},
%% Subscription_Options :: [] | pubsub_options:options_subscription()}
%% %% :: exmpp_pubsub:subscription_subscribed()
%% %% | exmpp_pubsub:subscription_pending()
%% %% | exmpp_pubsub:subscription_unconfigured()
%% ).
-type(subscriptions()
:: [exmpp_pubsub:subscription(),...]

View File

@ -2,6 +2,7 @@
%-include_lib("exmpp/include/exmpp.hrl").
%-include_lib("exmpp/include/exmpp_jid.hrl").
-include("logger.hrl").
-include("ejabberd.hrl").
-include("mod_roster.hrl").
-include("jlib.hrl").

View File

@ -76,10 +76,10 @@
-type(n0des() :: [Node::n0de(),...]).
-type(subscription()
:: {NodeIdx :: exmpp_pubsub:nodeIdx(),
Groups :: roster_groups()}
).
%% -type(subscription()
%% :: {NodeIdx :: exmpp_pubsub:nodeIdx(),
%% Groups :: roster_groups()}
%% ).
-type(subscriptions() :: [Subscription::subscription(),...]).

Some files were not shown because too many files have changed in this diff Show More