docs/readme.mdwn
author Myhailo Danylenko <isbear@ukrpost.net>
Wed, 28 Nov 2012 20:17:53 +0200
changeset 146 04d19c9c1196
parent 144 690b5524b895
child 148 b222f4d111d9
permissions -rw-r--r--
Fix module loading problem


# Lua scripting for MCabber

This module creates lua 5.1 or 5.2 interpreter environment and puts some lua
functions inside for your code to interact with mcabber.

Module provides mcabber command `/lua5.1` or `/lua5.2` respectively and adds
an alias `/lua` for that command. This command evaluates argument as lua code in
created by module environment.

Note: If you load both versions - `lua5.1` and `lua5.2`, alias will point to
which was loaded last.

Lua functions, available in environment are described in api reference, built
with `docgen` help. It is also available online.

In `examples` dir there are some example scripts, that may be used as is or for
reference. See also `README` in `examples` dir.

# Installation

To install it, you need:

 * mcabber headers
 * liblua
 * glib
 * gmodule
 * docgen (optional, for documentation)
 * cmake
 * make
 * c compiler (gcc)
 * linker (binutils)

Then do:

    $ mkdir build
    $ cd build
    $ cmake ..
    $ make edit_cache
    $ make
    # make install

Debian users can instead of make install do:

    $ make package
    # dpkg -i mcabber-mod-lua5.?_*.deb

Users of other distributions can select appropriate package generator,
using cache editor.

# Building options

Through `make edit_cache` action you can adjust module parameters. Notably: if
you set `WANT_LUA52`, module will be built against lua5.2, even if lua5.1 is
present; you can disable aliasing `lua` command at module loading time by
unsetting `ENABLE_LUA_ALIAS`; you can adjust mcabber option names to be
version-specific, if you need both versions running simultaneously via
`OPT_MLUA_RC` and `OPT_MLUA_DEBUG`.

# License

This code underlies terms of GNU GPL v2 or later. You can find it in
file COPYING from this distribution or on a GNU web-site
<http://www.gnu.org/licenses/>.

# Contact

I will be happy to get feedback, patches, suggestions, etc.
You can send me email or contact via jabber <isbear@unixzone.org.ua>.

  -- Myhailo Danylenko <isbear@ukrpost.net>