Bug 11349

Summary: Building rpm-3.0.4 with Berkeley db-3.0.55 from sleepycat.com
Product: [Retired] Red Hat Linux Reporter: David D. Kilzer <ddkilzer>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-05-10 19:27:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David D. Kilzer 2000-05-10 19:07:33 UTC
I foolishly thought that I could compile Berkeley db-3.0.55 from
sleepycat.com with db-185 compatibility under Solaris 2.7 for use with
rpm-3.0.4.  In order to do this, I had to patch configure.in to look for a
new function name and patch lib/dbindex.h to define a macro to enable the
db-185 feature for db-3.0.55.

With the following patch, rpm-3.0.4 builds and links against db-3.0.55
using gcc-2.95.2.  Unforutnately, a bug in db-3.0.55 (which I did not care
to track down) prevented me from using it, so I switched back to db-2.7.7.

I hope this patch will be useful.

diff -u rpm-3.0.4/configure.in.orig rpm-3.0.4/configure.in
--- rpm-3.0.4/configure.in.orig Wed Mar 15 06:29:09 2000
+++ rpm-3.0.4/configure.in      Thu Apr 13 11:40:55 2000
@@ -311,7 +311,8 @@
 AC_CHECK_FUNC(dbopen, [],
   AC_CHECK_LIB(db1, dbopen, [LIBS="$LIBS -ldb1"],
     AC_CHECK_LIB(db, dbopen, [LIBS="$LIBS -ldb"],
-       AC_MSG_ERROR([sorry rpm requires a db-1.85 API])))
+      AC_CHECK_LIB(db, __db185_open, [LIBS="$LIBS -ldb"],
+        AC_MSG_ERROR([sorry rpm requires a db-1.85 API]))))
            )

 AC_CHECK_FUNC(fork, [], [echo "using vfork() instead of fork()";
diff -u rpm-3.0.4/lib/dbindex.h.orig rpm-3.0.4/lib/dbindex.h
--- rpm-3.0.4/lib/dbindex.h.orig        Wed Oct 20 16:40:10 1999
+++ rpm-3.0.4/lib/dbindex.h     Thu Apr 13 15:25:26 2000
@@ -5,6 +5,7 @@
 #include <db1/db.h>
 #else
 #ifdef HAVE_DB_185_H
+#define DB_LIBRARY_COMPATIBILITY_API
 #include <db_185.h>
 #else
 #include <db.h>

Comment 1 Jeff Johnson 2000-05-10 19:27:59 UTC
There's an alignment patch from sleepycat that you will need as well.
That patch is also in the db3-3.0.55-xx package, available from Raw Hide,
but you will almost certainly have to dink with paths etc, as we (Red Hat)
are currently betwixt and between db2 and db3 (and glibc-2.1.x glibc-2.2,
and ...)

There's also a portability problem with solaris bsearch that you will need to
apply to rpm-3.0.4 sources. The patch is in lib/depends.c
alFileSatisfiesDepend(struct availableList * al,
        const char * keyType, const char * fileName)
{
    int i;
    const char * dirName;
    const char * baseName;
    struct dirInfo dirNeedle;
    struct dirInfo * dirMatch;

    if (al->numDirs == 0)       /* Solaris 2.6 bsearch sucks down on this. */
        return NULL;

Hope this helps. Send mail to <jbj> if you have questions.