The Berkeley DB package contains programs and utilities used by many other applications for database related functions.
There are instructions to build this package in the BLFS book if you need to build the RPC server or additional language bindings. The additional language bindings will require additional packages to be installed. See http://www.linuxfromscratch.org/blfs/view/svn/server/databases.html#db for suggested installation instructions.
Also, GDBM could be used in place of Berkeley DB to satisfy Man-DB. However, since Berkeley DB is considered a core part of the LFS build, it will not be listed as a dependency for any package in the BLFS book. Likewise, many hours go into testing LFS with Berkeley DB installed, not with GDBM. If you fully understand the risks versus benefits of using GDBM and wish to use it anyway, see the BLFS instructions located at http://www.linuxfromscratch.org/blfs/view/svn/general/gdbm.html
Patch the package to eliminate potential trap events:
patch -Np1 -i ../db-4.4.20-fixes-1.patch
Prepare Berkeley DB for compilation:
cd build_unix && ../dist/configure --prefix=/usr --enable-compat185 --enable-cxx
The meaning of the configure options:
This option enables building Berkeley DB 1.85 compatibility API.
This option enables building C++ API libraries.
Compile the package:
make
It is not possible to test the package meaningfully, because that would involve building TCL bindings. TCL bindings cannot be built properly now because TCL is linked against Glibc in /tools, not against Glibc in /usr.
Install the package:
make docdir=/usr/share/doc/db-4.4.20 install
The meaning of the make parameter:
This variable specifies the correct place for the documentation.
Fix the ownerships of the installed files:
chown -v root:root /usr/bin/db_* \ /usr/lib/libdb* /usr/include/db* && chown -Rv root:root /usr/share/doc/db-4.4.20