Contents |
[edit] Prerequisites
Bongo has a few dependencies that should be available with any recent Linux distribution. To build from source, you'll need the development packages as well.
- cmake
- Bison 1.875
- gettext
- OpenLDAP
- GNUTLS (don't forget gnutls-bin)
- Popt
- Python >= 2.3
- Python Devel
- Doxygen
- Libtool
- Flex
- LXML Python library
- GMime >= 2.0
Apache is recommended for Dragonfly and Hawkeye: it's not necessary, but it runs a lot faster under mod_python.
In addition, if you can install the CLucene, SQLite and Curl libraries, and their development headers, you'll find the compilation is a lot quicker, and the resulting binaries will operate against the package libraries.
[edit] Distribution-specific commands for fulfilling dependencies.
[edit] Debian and Ubuntu
$ sudo apt-get install automake1.9 bison \ build-essential curl doxygen flex gettext gnutls-bin ldapscripts \ ldap-utils libclucene0ldbl libclucene-dev libcurl4-gnutls-dev \ libgcrypt11-dev libgmime-2.0-2-dev libgnutls-dev libldap2-dev \ libpopt-dev libsqlite3-dev libtool pkg-config python python2.4-dev \ python-dev python-lxml slapd sqlite3 subversion libgmime libgmime-dev
- Note: You will be prompted to configure LDAP server. For testing purposes, default answers should be fine.
[edit] Fedora
yum install cmake bison gettext zlib gnutls-devel \ popt-devel python-devel pkgconfig gcc-c++ doxygen flex sqlite-devel curl-devel \ python-lxml gmime gmime-devel unixODBC unixODBC-devel check libical \ libical-devel sqlite-devel update-alternatives
[edit] openSUSE
[edit] 11.1
sudo zypper install cmake subversion doxygen gettext gettext-devel / gmime gmime-devel gnutls gnutls-devel curl curl-devel sqlite / sqlite-devel libical libical-devel python python-devel doxygen dot / gcc make gcc-c++ popt openldap2 openldap2-devel python-lxml / unixODBC unixODBC-devel
[edit] Get the code
If you want to use a version of the code which is known to be reasonable, check the Releases page and download the latest one.
If you want the absolute latest version (which may not necessarily be stable), run the following command to checkout the latest code from the Subversion repository.
svn checkout http://svn.gna.org/svn/bongo/trunk bongo
This will check out the current development branch of Bongo.
[edit] Create a user
Bongo can be run as root, but for security reasons it is best to run it as its own unprivileged user. You can create a 'bongo' user using your distribution's administration tools, usually by executing the following as root:
useradd bongo
[edit] Build the code
This command line assumes you created a user named 'bongo'. If you want to run as root, leave out the "-DBONGO_USER=bongo" argument
We also recommend that you install to a place such as /usr/local/bongo, so that the installation is self-contained.
Once you’ve checked out Bongo, you’ll see a source tree which looks something like this:
$ ls ABOUT-NLS cmake COPYING import INSTALL po TODO AUTHORS CMakeLists.txt doxygen include man README zoneinfo ChangeLog config.h.cmake HACKING init NEWS src
The first thing we should do is create a new directory to do our build in: this stops all our build files from littering the source tree.
$ mkdir build $ cd build/
Now we need to configure the build. There are two ways of doing this, and you could use both! Let’s start with the initial configuration.
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/bongo -DBONGO_USER=bongo -DCMAKE_BUILD_TYPE=Debug -DDEBUG=On
The first argument points to the Bongo source directory. Because we made a ‘build’ directory in the source tree and went into it, we’re just pointing at our parent directory. Then come some other options. Every option is prefixed with “-D”, and some of them are CMake options and others are Bongo options. In full:
- CMAKE_INSTALL_PREFIX: where we want to install to. I use /tmp/build for testing, and /usr/local/bongo when I want to run it in production.
- BONGO_USER: which user you want Bongo to run as. I use my user account for testing, “bongo” for production. You can also run as “root” if brave (not recommended!)
- CMAKE_BUILD_TYPE: set this to Debug to generate information for gdb, otherwise leave this option out.
- DEBUG: enable code paths which generate debugging messages. Both this option and the previous are for either advanced users or developers, really.
There are other options to the Bongo build, but these are the main ones. However, once you’ve configured Bongo, you may want to tweak something: perhaps turn on debugging, or change one of the file paths, or something different. The easiest way to do that is simply:
$ ccmake ./
Note that it’s “ccmake”, not “cmake”. This starts an interactive application where you can change each configuration item. You point it at the build directory, not the source, and it gives you all the various tweakable options. You’ll see that they are the same options that we pass to cmake - and indeed, you can pass them to cmake! There’s even an advanced mode with even more knobs (press ‘t’). When you’re done, press ‘c’ to configure the build and then ‘q’ to quit.
Once you have configured the build, you have access to the usual make commands:
$ make $ make install $ make clean
The first builds Bongo, the second installs it to your prefix, the last removes the built files.
[edit] Next steps
Once you have installed Bongo, you can continue on to configuring Bongo!
