# Jabber Server Daemon



## Ruler2112 (Jan 19, 2010)

I'm rebuilding an internal server that's been crashing every few days.  (It runs RedHat 9, which was cutting edge when the box was built, if that tells you how long it's been going.)  I've installed FBSD8 and finally managed to get the system installed and started loading software on it to do what we need it to.  However, when compiling ejabberd, it's compiling X as a dependency!!!  I don't need, nor do I necessarily want X on this box and found something online which suggests the dependency on X is a 'recommended' one.  I'm seriously considering wiping out the box and starting over with a different jabber daemon such as jabberd14 or jabberd2, but am in need of some information.  I've searched, but have yet to find anything and was hoping somebody here has experience with one or the other and can provide advice.

I need the ability to create shared rosters - does either of these daemons support this?

ejabberd has a nice web interface; does either of the others have a similar interface available?  I know webmin has a jabberd module, but I don't know either what it allows you to control or what daemon it expects.  I really don't mind doing configuration manually, but would rather have a web interface.  (Just because I'm lazy and prone to typos.  )


Thanks in advance for any help.


----------



## Ruler2112 (Jan 20, 2010)

OK, I've discovered that the X and Java dependencies are because of erlang.  I poked around the Makefile in that port and discovered that there are WITH_JAVA, WITHOUT_JAVA, WITH_X11, and WITHOUT_X11 options that can be set.  After looking at the Porter's Reference, I added some lines that I feel should allow these options to be set.  Indeed, after [cmd=]make rmconfig;make[/cmd], the configuration screen displaying the available options came up.  However, no matter what I select, it still insists on building jdk16.  (I broke out of it at this point - I really don't want either Java or X11.  I don't see where the X11 override would have any more success than the Java one.)

Here's the hunk of the Makefile I changed with changed lines having a comment after them:


```
PORTNAME=       erlang
PORTVERSION=    r13b03
PORTEPOCH=      2
# PORTEPOCH used to be 1 - dunno if this matters
CATEGORIES=     lang parallel
MASTER_SITES=   http://www.erlang.org/download/        \
                ftp://ftp.erlang.org/pub/download/     \
                http://www.erlang.org/download/        \
                http://erlang.stacken.kth.se/download/ \
                http://www.csd.uu.se/ftp/mirror/erlang/download/
DISTNAME=       otp_src_R13B03
DISTFILES=      ${DISTNAME}${EXTRACT_SUFX} ${ERLANG_MAN} ${ERLANG_DOCS}
DIST_SUBDIR=    erlang
EXTRACT_ONLY=   ${DISTNAME}${EXTRACT_SUFX}

PATCH_SITES=    http://www.erlang.org/download/

MAINTAINER=     olgeni@FreeBSD.org
COMMENT=        A functional programming language from Ericsson

CONFLICTS?=     erlang-lite-r[0-9]*

SUB_FILES=      pkg-message
SUB_LIST=       TOOLS_VSN=${TOOLS_VSN}

OPTIONS= JAVA "Enable Java applications" Off \
         X11 "Enable X11 support" Off \
         WX "Enable WX Extensions" Off \
         ODBC "Enable ODBC" Off
#None of these 4 OPTION lines were here before

# The Java applications that are part of the Erlang distribution are
# not strictly necessary - it is included for completeness sake. A
# problem with the Erlang build procedure is that it only checks if
# javac is in the regular path - and then assumes that all of the jdk
# utilities is in the path as well. The only way to make sure that
# this is the case (that I could think of at least) was to make sure
# ${JAVA_HOME}/bin is added to the PATH, using the *_ENV macros.

.if !defined(WITHOUT_JAVA)
USE_JAVA=       yes
JAVA_VERSION=   1.4+
# Make sure ${JAVA_HOME}/bin is in the path
CONFIGURE_ENV+= PATH=${PATH}:${JAVA_HOME}/bin
MAKE_ENV+=      PATH=${PATH}:${JAVA_HOME}/bin
SCRIPT_ENV+=    PATH=${PATH}:${JAVA_HOME}/bin
.else
USE_JAVA=       no
.endif
# Added the whole ELSE block - makes no difference.  Intentionally put BS in that should cause a syntax error and it's never reached.

.if !defined(WITHOUT_X11)
USE_TK_RUN=     yes
.if !defined(WITHOUT_WX)
USE_WX=         2.8+
WX_COMPS=       wx contrib
WX_UNICODE=     yes
CONFIGURE_ARGS+=        --with-wx-config=${WX_CONFIG}
.endif
.endif

USE_GMAKE=      yes
USE_PERL5=      yes
USE_RC_SUBR=    epmd.sh
GNU_CONFIGURE=  yes
ONLY_FOR_ARCHS= i386 amd64 sparc64
REINPLACE_ARGS= -i
MAKE_JOBS_UNSAFE=       yes

.include <bsd.port.pre.mk>

.if !defined(WITHOUT_ODBC)
DRIVER_MANAGER?=        iodbc
.if ${DRIVER_MANAGER} == "unixodbc"
LIB_DEPENDS+=           odbc.1:${PORTSDIR}/databases/unixODBC
.else # assume we're using iodbc
LIB_DEPENDS+=           iodbc.3:${PORTSDIR}/databases/libiodbc
.endif
.endif

ERLANG_MAN=     otp_doc_man_R13B03.tar.gz
.if !defined(NOPORTDOCS)
ERLANG_DOCS=    otp_doc_html_R13B03.tar.gz
.endif
ERLANG_PLIST=   ${WRKDIR}/pkg-plist

# enabling --enable-smp-support crashes the OS when
# net_kernel:start([node_name, shortnames]) invoked repeatedly

CONFIGURE_ARGS+=        --enable-threads --enable-dynamic-ssl-lib --enable-sctp

 #--enable-smp-support
#Not really sure what net_kernel:start([node_name, shortnames])  involves, but I don't want my box crashing.

CFLAGS+=        -I${LOCALBASE}/include
LDFLAGS+=       -L${LOCALBASE}/lib
CONFIGURE_ENV+= CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
PLIST_SUB+=     ERTS_VSN=${ERTS_VSN} TOOLS_VSN=${TOOLS_VSN}

.if ${ARCH} == i386
MAKE_ARGS+=     ARCH=x86
.endif
```


Does anybody have any ideas?  I'm way out of my range here...

Also, this thread should probably be moved into the ports forum - could a moderator please do this for me?


----------



## Ruler2112 (Jan 20, 2010)

Found a reference in the port reference that some variables, namely USE_*, don't work as expected if put in before .include <bsd.port.pre.mk>  I moved them after this line and it had no effect.  Still poking around...


----------



## Ruler2112 (Jan 20, 2010)

I found a solution to this.  Turns out that the aforementioned .include was in the wrong place in the original Makefile.  I moved it up before the big block of comments regarding java and added another option to control the enabling of SMP code.  Here's a diff of my Makefile compared to the original in the port net-im/erlang:


```
10,11c10,11
< PORTEPOCH=    2
< CATEGORIES=   lang parallel
---
> PORTEPOCH=    1
> CATEGORIES=   lang parallel java
32,39d31
< OPTIONS= JAVA "Enable Java applications" Off \
<          X11 "Enable X11 support" Off \
<          WX "Enable WX Extensions" Off \
<          ODBC "Enable ODBC" Off \
<          SMP "Enable SMP - may crash the OS!" Off
<
< .include <bsd.port.pre.mk>
<
74a67,68
> .include <bsd.port.pre.mk>
>
93d86
< .if !defined(WITHOUT_SMP)
95,97d87
< .else
< CONFIGURE_ARGS+=      --enable-threads --enable-dynamic-ssl-lib --enable-sctp
< .endif
```


----------



## Ruler2112 (Jan 20, 2010)

The build just finished and it appears to have compiled and installed successfully.  How would I go about submitting this as a suggested change to the port?  It enhances functionality and allows a much cleaner install of the software involved for those who do not want X11/Java.  (I'm excited - this is the first time I've done something that I feel is worthy of being included as a change to the distribution!  )


----------



## DutchDaemon (Jan 20, 2010)

Discuss with "MAINTAINER="


----------



## Ruler2112 (Jan 21, 2010)

Thanks DD - e-mail sent.


----------

