Table of Contents
Installing from source
Building Prosody from source isn't difficult, but it certainly isn't as simple as using one of our ready-made packages.
Why might you want to build from source? Well it's certainly the easiest way to get hacking on Prosody. Or perhaps there isn't a package for your system yet, or perhaps you want to contribute a package. Alternatively you may simply want more control over how and where Prosody is installed on your system.
There are many different kinds of systems, all configured in different ways. No single set of instructions will work for all, though the steps outlined here should be a good guide for most cases. If you are having trouble getting it to work, feel free to let us know your problem, and we'll try to help however we can!
If you are developing packages, or even if you aren't, there are some additional tips to accompany this article that may be useful in our documentation for packagers.
This guide assumes that you are using the command-line on a GNU/Linux or similar system.
Fetching the source
First of all, make a directory where we will work on Prosody:
mkdir prosody-build cd prosody-build
Extract it, and move into the newly extracted directory:
tar xzf prosody-0.9.12.tar.gz cd prosody-0.9.12
Direct from our source repository
All daily development occurs in a source repository, powered by Mercurial. If you have Mercurial - 'hg' - installed then you can simply fetch the source through:
hg clone https://hg.prosody.im/trunk prosody-trunk
The above will create a new directory, 'prosody-trunk' containing the latest development code. The neat thing about using hg is that if you want to pull down our latest changes then all you need to do is switch into this directory and run:
hg pull -u
There are a couple of libraries which Prosody needs installed before you can build it. These are:
- lua5.1: The Lua 5.1 interpreter
- liblua5.1: Lua 5.1 library
- libssl 0.9.8 or later: OpenSSL
- libidn11: GNU libidn library, version 1.1
These can be installed on Debian/Ubuntu by running
apt-get build-dep prosody or by installing the packages
On Mandriva try:
urpmi lua liblua-devel libidn-devel libopenssl-devel
On Mac OS X, if you have MacPorts installed, you can try:
sudo port install lua lua-luasocket lua-luasec lua-luaexpat
On other systems… good luck, but please let us know of the best way of getting the dependencies for your system and we can add it here.
The first step of building is to run the configure script. This creates a file called 'config.unix' which is used by the next step to control aspects of the build process.
All options to configure can be seen by running
Sometimes you won't need to pass any parameters to configure, but on most systems you shall.
To make this a little easier, there are a few presets which configure accepts. You can load a preset using:
Where PRESET can currently be one of: 'debian', 'macosx' or (in 0.8 and later) 'freebsd'
Once you have run configure successfully, then you can simply run:
If you do happen to have problems at this stage, it is most likely due to the build process not finding the dependencies. Ensure you have them installed, and in the standard library paths for your system.
For more help, just ask
At this stage you should be able to run Prosody simply with:
There is no problem with this, it is actually the easiest way to do development, as it doesn't spread parts around your system, and you can keep multiple versions around in their own directories without conflict.
Should you wish to install it system-wide however, simply run:
sudo make install
…it will install into /usr/local/ by default. To change this you can pass to the initial ./configure using the 'prefix' option, or edit config.unix directly. If the new path doesn't require root permission to write to, you also won't need (or want) to use 'sudo' in front of the 'make install'.
Have fun, and see you on Jabber!