τBerkeleyDB




Berkeley DB Reference Guide:
Installation Guide: Install on UNIX

Install on UNIX

This Temporal Subsystem supports BerkeleyDB 3.2.9a, which has been tested. It also may support other 3.x.x versions. The package is downloadable here.

Currently, this package is only working under UNIX systems, specifically Fedora 7 on 32-bit architectures, though it will probably work on previous versions of Fedora as well as other versions of Unix.

Below the original BerkeleyDB system is called BDB for short. The Temporal Subsystem Package for BerkeleyDB is called TBDB.

Installing TBDB requires installation of Beecrypt (a cryptography toolkit), which can be downloaded http://sourceforge.net/projects/beecrypt. The steps below will ensure that Beecrypt has been properly installed before installation of TBDB.

We recommend making a source directory <SOURCE_DIR> (e.g., /home/mike/tbdbSOURCE) for installation, putting the BDB source tree, Beecrypt toolkit and TBDB package in the same source directory. There are also two directories (perhaps one directory serving two purposes) for the installed beecrypt and τBerkerly DB installation, <BEECRYPT_DIR> and <TBDB_DIR>. For our example, we'll use /usr/local/beecrypt and /usr/local/tbdb, respectively.

We first give the steps to install the system, then give the steps to later uninstall it. All indicated commands are a single line each.

INSTALL TBDB 3.2.9
**********************

  1. Download the BDB 3.2.9 package from http://www.oracle.com/technology/software/products/berkeley-db/index.html. If you have already installed a copy of the BDB, you don't have to download it again; jump to step (3).
  2. Untar the BDB source tree to the source directory:

    tar -C <SOURCE_DIR> -xvf db-3.2.9.tar.gz

    where <SOURCE_DIR> is replaced by the path to the source directory for installation. For example,

    tar -C /home/mike/tbdbSOURCE -xvf db-3.2.9.tar.gz

    This will create a directory, e.g. /home/mike/tbdbSOURCE/db-3.2.9/.

  3. Retrieve TBDB package ( tbdb-install.tar.gz).
  4. Untar the TBDB package to the source directory:

    tar -C <SOURCE_DIR> -xvf tbdb-install.tar.gz

    For example,

    tar -C /home/mike/tbdbSOURCE -xvf tbdb-install.tar.gz

    This will create a directory, e.g. /home/mike/tbdbSOURCE/tbdb-install/.

  5. Download Beecrypt package from http://sourceforge.net/projects/beecrypt. If you have already installed a copy of the Beecrypt you don't have to download it again; jump to step (11).
  6. Untar Beecrypt source tree to the source directory:

    tar -C <SOURCE_DIR> -xvf beecrypt-4.1.2.tar.gz

    For example,

    tar -C /home/mike/tbdbSOURCE -xvf beecrypt-4.1.2.tar.gz

    This will create a directory, e.g. /home/mike/tbdbSOURCE/beecrypt-4.1.2/.

  7. Go to the Beecrypt source directory. For example,

    cd /home/mike/tbdbSOURCE/beecrypt-4.1.2

  8. Configure the path of Beecrypt installation using the Beecrypt destination,<BEECRYPT_DIR>.

    ./configure --prefix=<BEECRYPT_DIR>

    For example,

    [beecrypt-4.1.2]$ ./configure --prefix=/usr/local/beecrypt

    If the prefix directory requires superuser access to create and write, then be sure to execute step 10 as superuser. Otherwise, use a prefix that the user has permission to create.

  9. Build Beecrypt library by

    [beecrypt-4.1.2]$ make

  10. Install Beecrypt library by

    [beecrypt-4.1.2]$ make install

    This will create another directory, e.g. /usr/local/beecrypt/.

    Note that this step may generate errors if you don't have write permission to various system directories such as /usr/lib/. However, these errors will not affect the installation or running of TBDB.

  11. Go into the <SOURCE_DIR> directory and then into the tbdb-install subdirectory. For example,

    cd /home/mike/tbdbSOURCE/tbdb-install

  12. The installation takes parameters for the paths to Berkeley DB source tree, Beecrypt header files, and libraries. The following are examples of these parameters.
    Parameter Name Parameter Value Example
    BDBVER 3 BDBVER=3
    BDBORIG <BDB_SRC_TREE_DIR> BDBORIG=/home/mike/tbdbSOURCE/db-3.2.9
    BEEHEADER <BEECRYPT_HEADER_DIR> BEEHEADER=
    /usr/local/beecrypt/include/beecrypt
    BEELIB <BEECRYPT_LIB_DIR> BEELIB=
    /usr/local/beecrypt/lib

    Run

    make -n source BDBVER=3 BDBORIG=<BDB_SRC_TREE_DIR>
    BEEHEADER= <BEECRYPT_HEADER_DIR> BEELIB=<BEECRYPT_LIB_DIR>

    to check the list of changes that TBDB package installation script will do to the original BerkeleyDB source tree, where <BDB_SRC_TREE_DIR> is replaced with the path to the original BerkeleyDB source tree. <BEECRYPT_HEADER_DIR> is replaced by the path to the Beecrypt header file directory. <BEECRYPT_LIB_DIR> is replaced by the path to the Beecrypt library directory. For example,

    [tbdb-install]$ make -n source BDBVER=3 BDBORIG=/home/mike/tbdbSOURCE/db-3.2.9 BEEHEADER=/usr/local/beecrypt/include/beecrypt BEELIB=/usr/local/beecrypt/lib

    We emphasize that the actual installation occurs in the next step (without "-n").

  13. Run

    make source BDBVER=3 BDBORIG=<BDB_SRC_TREE_DIR> BEEHEADER=<BEECRYPT_HEADER_DIR> BEELIB=<BEECRYPT_LIB_DIR>

    to patch the Temporal Subsystem into a copy of the original BerkeleyDB source tree. For example,

    [tbdb-install]$ make source BDBVER=3 BDBORIG=/home/mike/tbdbSOURCE/db-3.2.9 BEEHEADER=/usr/local/beecrypt/include/beecrypt BEELIB=/usr/local/beecrypt/lib

    Note: comments to the user printed by make are preceeded by "===>".

    At this point, db-3.2.9 has been installed and now supports temporal databases. The patched version will be in <SOURCE_DIR>/TBDB/.

  14. Go into the tBDB build directory. For example,

    cd /home/mike/tbdbSOURCE/TBDB/build_unix

  15. Run

    [TBDB/build_unix]$ make distclean

    to clean the old configurations. If "make" complains about no Makefile exists, that means we don't have old configurations left, you can just ignore the complaint.

  16. Configure the BerkeleyDB system with

    ../dist/configure <OPTIONS>

    (Run

    ../dist/configure --help

    for the detail of <OPTIONS>. All the options available in BerkeleyDB are still applicable in TBDB. In particular, --prefix should indicate where the system should be placed, in this case, <TBDB_DIR>.)

    For example,

    [TBDB/build_unix]$ ../dist/configure --prefix=/usr/local/tbdb

  17. Build the BerkeleyDB with Temporal Subsystem by

    [TBDB/build_unix]$ make

    This will, among other things, link in Beecrypt.

  18. Install the BerkeleyDB with Temporal Subsystem by

    [TBDB/build_unix]$ make install

    This will create the installed version of τBerkeley DB in the destination directory <TBDB_DIR>, which in our example is /usr/local/tbdb.

  19. Run some simple test cases of the temporal support by

    [TBDB/build_unix]$ make temporal_test

    The final test result will be given after the testcases are done. A message of "Final result: SUCCESSFUL :-)" is expected. If not, something is wrong.

  20. At this point, as desired, the original <SOURCE_DIR>/db-3.2.9 and <SOURCE_DIR>/tbdb-install directories can be deleted. For example,

    cd /home/mike/tbdbSOURCE

    rm -fr db-3.2.9 tbdb-install

We provide an initial script ( tbdb-install.script ) that can be edited with these steps. This script may be helpful for your installation.

UNINSTALL BDB 3.2.9
**********************

Uninstalling TBDB does not need Beecrypt parameters because uninstallation simply recover the original BDB files and does not need Beecrypt support. Unistallation follows steps below.

  1. Go into the BDB build_unix directory. For example,

    cd /home/mike/tbdbSOURCE/db-3.2.9/build_unix

  2. Run

    make distclean

    to clean all configurations for temporal support.

  3. Reconfigure the BerkeleyDB by

    ../dist/configure <OPTIONS>

    (Run

    ../dist/configure --help

    for the detail of <OPTIONS>).

  4. Build the original BerkeleyDB by

    make

  5. Install the original BerkeleyDB by

    make install

At this point, only the original Berkeley DB remains.




Developed by the TAU Project, Computer Science Department, University of Arizona