$Id: README 1275 2009-07-14 10:22:04Z sion $

This code should work but is not fully tested

Introduction
------------
libksm (Key and Signature Manager) is an interface for programs that need access to the KASP database. It contains the logic for creating keys, allocating keys, calculating key rollover times etc.

Pre-requisites
--------------
1) Install MySQL or sqlite3 (and sqlite3-dev) (sqlite has had more testing for the alpha release, but both should work)
    If you are using MySQL then an empty schema needs to be created, plus a 
    user with full access to that schema (assuming that you don't want to use 
    the root account).

2) Install libxml2
(http://xmlsoft.org/)

3) If you wish to run the unit tests, install "CUnit"
(http://cunit.sourceforge.net).

Building the Software
---------------------

The following options can be passed to configure;

--prefix=<dir>      Installation directory. All files will be installed
                    relative to this path.

Sqlite3 is the default DB if neither or both are specified.
--with-sqlite3=<dir>  Look for sqlite3 in this dir (/usr/local/ is assumed if no <dir> is specified)
--with-mysql=<dir>  Path to your MySQL instalation; this also selects MySQL
                    as your database

The following must be specified for make check to run the unit tests
--with-cunit=<dir>  Path to your CUNIT installation
--with-dbname=      Name of test DB schema
--with-dbhost=      Machine where test DB is hosted
--with-dbpass=      Password for test DB access
--with-dbuser=      Username for test DB access

Unit tests
----------
Unit tests can be run using make check. 

At present one assert fails (as a reminder that we need more tests in that section).


Database Schemas
----------------
The unit tests will setup the database according to the options given to configure. To manually setup the schema then run one of:

utils/database_create.mysql
or
utils/database_create.sqlite3
