- postgresql version 7.3 or later
- glib2.0 or later
- gtk-2.6 or later to compile gtk
- libxml2 (2.6 or later)
For Debian distributions
The requirements for bond can be installed through the following. Search for the most up-to-date development versions of each library, using the following command;
apt-cache search lib-filename
Once you have found the correct version, install it by doing the following:
apt-get install lib-filename
These need to be done for the following packages, which are all available on Debian:
- scons nb: typing ‘scons -v’ will give the version of scons. It must be version 96 of later
- libc6-dev nb: this needs to be installed for any of the c libraries to work
NOTE: These are the names of the packages stored in Debian. But search for these versions before attempting to install them. Package names may vary over different linux distributions. If the version is not current, download the correct package and type:
dkpg -i filename.deb
Once unpackaged, check that it is there using the search and then install.
First of all, a general knowledge of UNIX (Linux) and SQL are necessary to develop applications with Bond. The README file in bond/bond/README contains more up to date information on installation and I recommend you read this first, the information here isn’t kept as well up to date. Glade is also a helpful tool for creating graphical user interfaces (GUI’s) for applications.
Compiling Bond and BondDB
Bond is dependant on BondDB, PostgreSQL development libraries, GTK development libraries (GLib), and libxml2 (2.6 or later). Most of these packages you can get from your distribution. Under Debian the packages you’re looking for are postgresql-dev, libgtk2.0-dev, python2.2-dev libglib1.2-dev, libxml2-dev and scons(a replacement for make). To compile bonddb you need scons installed. Scons requires Python 2.2 and scons 0.96 or higher. Type ‘scons -v’ to find which version of scons is installed in your system.
You need to compile and install BondDB before you can install Bond. Refer to the README files in both bond and bonddb compiling instructions.
After installing BondDB, the same process is used to install Bond.
You also need to make certain that /usr/local/lib is mentoned in the /etc/ld.so.conf file. If it doesnt, add this to the file. If the file doesnt exist create it. Then run ldconfig.
Testing the installation
A number of test programs reside in the src directories. dbtest in BondDB, testbond, testsoldier and bondfrontend in Bond. Use these test applications to check if the libraries work correctly.
Each test program has a corresponding appname.conf file which is its configuration file. These can be located in the current directory, /etc/bond/ or in /usr/local/etc/bond. In this file the database to connect to, bond xml file to load and other features are specified. Bond now has DTD validation so a program can be set to use validation if requested in the corresponding .conf file.
Creating a Postgres user and Database
Before creating a database, you must create a postgres user. This can be done by becoming a the root user, then typing ‘su postgres’ to become the root postgres user. From here you can create postgres users using ‘createuser username’ or delete postgres users using ‘dropuser username’. Once a user has been created, exit from postgres and root, and start the installation testing by creating a postgres database using the following commands in the BondDB directory:
<i>createdb testbond #creates a new database called dbtest<br> psql -f createtestdb.sql testbond #populates the database</i>
Once the database has been setup, modify the configuration files (.conf) in the src directory of both Bond and BondDB to use the correct host,database and username:
db_host = localhost<br> db_username = postgresuser<br> db_password = postgrespass<br> db_name = testbond<br>
Start running the tests by specifying the test number to run on the command line. For example: ./dbtest 1. Most tests should say TEST PASSED, otherwise TEST FAILED if something went wrong. testsoldier and bondfrontend are not command line tests, but fully fledged applications you can run for a more comprehensive test. If you run it and lots of windows pop up with information in the widgets you know everything is working well. Bond has another test program, testxml in the uigtk directory, to test just the graphical user interface part of Bond.