The "duplicate RPM" thing is most likely because there are 32-bit and 64-bit development packages installed. This is perfectly legal, but RPM doesn't make it easy to see a package's architecture. You can run this form of RPM to display the name and the architecture of all packages:
Code:
rpm -qa --qf "%{n}-%{arch}\n"
The original error is a 32-/64-bit mismatch error- Linking 64-bit objects and finding 32-bit db library is the most likely case.
Centos/Red Hat like to put 64-bit libs in /usr/lib64 and 32-bit libs in /usr/lib. On a 64-bit machine gcc with no -m flag will produce 64-bit object files, but we can clearly see that the linker is looking in /usr/lib and not liking what it finds.
Gcc and the linker are usually smart enough to look in the right place for libraries, so somewhere in what you're doing you're telling the linker to look in /usr/lib instead of /usr/lib64. This could be your --libdir setting in OpenLDAP's configure, or it could be your LDFLAGS environment variable.
One alternative is to disable back-bdb and back-hdb during the configure phase (--disable-bdb --disable-hdb). Instead, enable back-mdb (it is actually enabled by default) and get a screamingly fast database that doesn't require a bunch of arcane cache configuration directives. OpenLDAP won't look for Berkeley DB at all.
Another alternative is to stop messing with all that and just download one of our (free) Symas OpenLDAP Silver packages. We're still at 2.4.32 for Centos/Red Hat and it'll be a few more days before we release a 2.4.33 package.
Hope this helps,
-Matt
Matthew Hardin
Symas - The LDAP Guys
http://www.symas.com