How do I compile mod_shared_roster_ldap

Hi there,

After doing some trawling of this site and Google in general, I have realised that I don't know how to compile erlang modules.

Off this website, I got a hint of a build.sh script. No such script came with mod_shared_roster_ldap. Not too daunted, I tried:
erl -pa /usr/lib/erlang/lib/ejabberd-1.1.2/ebin -pz -make mod_shared_roster_ldap.erl

Ok, so that did not work 'cause it gave me a couple of errors. I am running ejabberd on Debian as an 'out-the-box' .deb from the stable branch; so to compile this module, I needed to download the source. Still not intimidated :-) I downloaded the source, and now I have the include files needed by this module. So, there are a couple of questions:

1) How do I specify the include files on the erl command line (I did a man or erl, but that mentions nothing of the -pa or -pz options).

2) Knowing nothing of erlang, I have no idea how this module is supposed to work, and it looks like the documentation on it is scant on this site too. I'm needing to provide shared rosters to all my ldap (OpenLdap) users.

Any help would be appreciated.
Kindest,
zinkeldonk

Compile with erlc. You need ejabberd include files.

To compile this module you need the Erlang compiler and the ejabberd header files (included in the source package). You don't need to compile ejabberd (but you can to get 3 points of experience ;)

Download, compile and install:

$ wget http://realloc.spb.ru/files/ejabberd/mod_shared_roster_ldap.erl
$ erlc -I ../ejabberd-2.0.0/src/ mod_shared_roster_ldap.erl
./mod_shared_roster_ldap.erl:19: Warning: behaviour gen_mod undefined
./mod_shared_roster_ldap.erl:289: Warning: variable 'User' is unused
$ sudo cp mod_shared_roster_ldap.beam /var/lib/ejabberd/ebin/

Notice that the compilation reports warnings, not errors. The paths in your system may vary.

Now configure ejabberd in /etc/ejabberd/ejabberd.cfg
To enable the module and configure some of its options, add it in the 'modules' section, like all the other modules:

{modules, [
  {mod_shared_roster_ldap,
   [{ldap_base, ""},
    {ldap_groupattr, "cn"},
    {ldap_groupdesc, "cn"},
    {ldap_memberattr, "uniqueMember"},
    {ldap_memberattr_format, "uid=%u*"},
    {ldap_filter, "(uniqueMember=*)}
   ]
  },
  ...
]}.

Take care with the file syntax. I can't help with the particular module options because I never used it. There are some comments in the mod_shared_roster_ldap page

Syndicate content