Hint for installing Berkeley DB 5.3.28

"Alec Bloss" ([email protected] via blfs-dev Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.beyond.devel
Message-ID <[email protected]>
Since this software package is no longer in the book and is listed as deprecated, but some applications may still need it, I've written instructions on how to build Berkely DB for LFS as it's no longer entirely straightforward and I just spent a few hours figuring it out myself. The instructions in BLFS 12.0 don't work anymore either, so I think this hint is necessary for those who need BDB.

I've attached it as a txt file - if that doesn't come through, please reply and let me know. Released as public domain.

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-dev
Unsubscribe: See the above information page
Berkeley_DB_procedure.txt (text/plain, 3 KB)
Berkeley DB 5.3.28

Tested on LFS 12.3 system. Given that Berkeley DB is listed as deprecated in LFS/BLFS, I had to spend a bit of time getting this to work (the instructions in 12.0 don't work out of the box anymore). Most distros aren't adopting Berkeley DB version 6.x as the licensing changed somewhere in that series. I need BDB still for apt-ftparchive, but there are some other applications where BDB is still used. Here's how I got it working on LFS. Note: This hint works with GCC 14, but will likely NOT work on GCC 15 without some modifications.

I don't generally recommend nabbing stuff from a distro as that can potentially lead to issues on LFS systems, but in this case, the Debian patches are necessary (both for security and build-time issues) and work properly, so call this a one-off exception.

You'll need the following files:

http://ftp.debian.org/debian/pool/main/d/db5.3/db5.3_5.3.28+dfsg2-9.debian.tar.xz

http://ftp.debian.org/debian/pool/main/d/db5.3/db5.3_5.3.28+dfsg2.orig.tar.xz

Extract both tarballs. You should have two folders, `db-5.3.28` and `debian`. cd into the `db-5.3.28` folder.

The first step is to apply the patches.

patch -p1 < ../debian/patches/0015-Add-missing-includes.patch
patch -p1 < ../debian/patches/001-checkpoint-opd-deadlock.patch
patch -p1 < ../debian/patches/002-versioned_symbols.patch
patch -p1 < ../debian/patches/003-jni_javac.patch
patch -p1 < ../debian/patches/004-tclsleep.patch
patch -p1 < ../debian/patches/005-pg_crypt_size.patch
patch -p1 < ../debian/patches/006-mutex_alignment.patch
patch -p1 < ../debian/patches/007-link-sql-libs.patch
patch -p1 < ../debian/patches/008-autoconf-in-lang-sql-sqlite.patch
patch -p1 < ../debian/patches/009-java-10.patch
patch -p1 < ../debian/patches/010-__atomic_compare_exchange.patch
patch -p1 < ../debian/patches/011-Use-one-object-for-shqueue.h-test.patch
patch -p1 < ../debian/patches/012-Don-t-expo-progname-symbol.patch
patch -p1 < ../debian/patches/014-implicit-int.patch
patch -p1 < ../debian/patches/CVE-2017-10140-cwd-db_config.patch
patch -p1 < ../debian/patches/CVE-2019-8457.patch
patch -p1 < ../debian/patches/gcc-14.patch
patch -p1 < ../debian/patches/mmap_extend-mode-requires-page-aligned-extends.patch

Since we've touched the *.m4 files, we need to regenerate configure:

cd dist
./s_config

You can safely ignore warnings about outdated macros.

Next, we need to run configure

cd ../build_unix

make clean

../dist/configure --prefix=/usr --disable-option-checking --disable-silent-rules --disable-maintainer-mode --disable-dependency-tracking --enable-cxx --enable-compat185 --disable-java --disable-sql --disable-stl --enable-dbm --with-mutex=POSIX/pthreads/library

Now to install - we don't want the static libraries so we do this in a couple steps. First we install to a temp directory, then copy the needed parts to their final places, and finally run ldconfig to update the loader cache.

make -j1 install DESTDIR=$(pwd)/temp

cp -av temp/usr/bin/* /usr/bin/

cp -av temp/usr/lib/*.so /usr/lib/

cp -av temp/usr/include/*.h /usr/include/

ldconfig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.