Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 2008 01:06:17 -0500
From:      "RandomUser" <rannumgen@globaleyes.net>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   ports/126085: news/inn update make environment to allow for Berkeley DB4+
Message-ID:  <1217397977.1915@FreeBSD2.LocalNET10>
Resent-Message-ID: <200807300610.m6U6A3XZ099588@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         126085
>Category:       ports
>Synopsis:       news/inn update make environment to allow for Berkeley DB4+
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 30 06:10:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     RandomUser
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
>Environment:


System: FreeBSD 7.0-STABLE #1: Mon Jul 28 20:15:23 CDT 2008 



>Description:


By reinstating the configure patch (for DB) and modifying it for DB4 it is
possible to use BerkeyleyDB4 with INN. A minor patch to "ovdb_stat.c" was
necessary for DB4. IGNORE the Makefile patches to the OPTIONS - they are not
needed for DB4 (I was just "cheating" so I wouldn't have to go through the
OPTIONS again). The Makefile patches for DB4 were extensive and should be
reviewed. You might be better at turning them into a more generic method.

I have rebuilt my HISTORY files (tradspool) without any problems, and have
received INNXMIT transmissions/articles without any problems. I should find
out this weekend if there will be any problems with OVDB.

P.S. Makefile mods for Options can be ignored.

P.S.S. Am using db4-4.0.14_1,1


>How-To-Repeat:





>Fix:


--- Makefile.diffs begins here ---
--- Makefile.orig	2007-10-07 00:45:00.000000000 -0500
+++ Makefile	2008-06-27 16:39:43.000000000 -0500
@@ -33,10 +33,10 @@
 		TCL		"Embedded TCL support"				Off	\
 		KERBEROS	"Enable Kerberos auth support"			Off	\
 		SASL		"Enable SASL support (for imapfeed auth)"	Off	\
-		TAGGED_HASH	"Use tagged hash table for history"		Off	\
+		TAGGED_HASH	"Use tagged hash table for history"		On	\
 		LARGE_FILES	"Support for files larger than 2GB"		Off	\
 		KEYWORDS	"Automatic keyword generation support"		On	\
-		BERKELEYDB	"Enable BerkeleyDB (for ovdb overview method)"	Off
+		BERKELEYDB	"Enable BerkeleyDB (for ovdb overview method)"	On
 
 VARBASE?=	/var
 
@@ -56,7 +56,8 @@
 			--enable-ipv6
 
 .include <bsd.port.pre.mk>
-
+.warning "WITH_BDB_VER:${WITH_BDB_VER}"
+.warning "WITH_BERKELEYDB=${WITH_BERKELEYDB}"
 .if defined(WITH_BERKELEYDB)
 CONFIGURE_ARGS+=	--with-berkeleydb
 .    if !defined(WITH_BDB_VER)
@@ -64,14 +65,19 @@
 .    endif
 .    if (${WITH_BDB_VER} == 3) || (${WITH_BDB_VER} == 4) || (${WITH_BDB_VER} == 41)
 LIB_DEPENDS+=		db${WITH_BDB_VER}:${PORTSDIR}/databases/db${WITH_BDB_VER}
+.    elif ${WITH_BDB_VER} == 42
+LIB_DEPENDS+=	db-4.2.2:${PORTSDIR}/databases/db${WITH_BDB_VER}
+.    elif ${WITH_BDB_VER} == 44
+LIB_DEPENDS+=	db-4.4.0:${PORTSDIR}/databases/db${WITH_BDB_VER}
 .    elif ${WITH_BDB_VER} == 2
 BROKEN=		Does not compile with db2
 .    else
 BROKEN=		Unknown BerkeleyDB version
 .    endif
 CONFIGURE_ENV+=		DB_VER=db${WITH_BDB_VER}
-CONFIGURE_ARGS+=	--with-berkeleydb=${LOCALBASE}
+CONFIGURE_ARGS+=	--with-berkeleydb=yes
 .endif
+.warning "Berkeley DB LIB_DEPENDS: ${LIB_DEPENDS}"
 
 .if defined(WITH_KERBEROS)
 .    if exists(${LOCALBASE}/bin/krb5-config)

--- Makefile.diffs ends here ---

--- patch-configure begins here ---
--- configure.orig	2006-03-19 22:14:57.000000000 -0600
+++ configure	2008-06-27 16:37:55.000000000 -0500
@@ -7584,6 +7584,7 @@
 
 echo $ac_n "checking if BerkeleyDB is desired""... $ac_c" 1>&6
 echo "configure:7587: checking if BerkeleyDB is desired" >&5
+echo "--- initial BERKELEY_DB_DIR: $BERKELEY_DB_DIR" >&5
 if test x"$BERKELEY_DB_DIR" = xno ; then
     echo "$ac_t""no" 1>&6
     BERKELEY_DB_LDFLAGS=
@@ -7605,8 +7606,18 @@
         done
     fi
     if test x"$BERKELEY_DB_DIR" = xyes ; then
-        for v in db43 db42 db41 db4 db3 db2 ; do
+#20080627
+        for v in db44 db43 db42 db41 db4 db3 db2 ; do
             if test -d "/usr/local/include/$v" ; then
+                for z in db44 db43 db42; do
+                    BERKELEY_DB_LDFLAGS="-L/usr/local/lib/$z"
+                    BERKELEY_DB_CFLAGS="-I/usr/local/include/$z"
+                    MAJMINSPLIT=`/bin/echo "$z"|awk '{MAJOR=substr($1,3,1);MINOR=substr($1,4,1);print MAJOR"."MINOR}'`
+                    BERKELEY_DB_LIB="-ldb-$MAJMINSPLIT"
+                    echo "$ac_t""FreeBSD locations" 1>&6
+                    break 2
+                done
+#20080627
                 BERKELEY_DB_LDFLAGS="-L/usr/local/lib"
                 BERKELEY_DB_CFLAGS="-I/usr/local/include/$v"
                 BERKELEY_DB_LIB="-l$v"
@@ -7634,6 +7645,9 @@
         BERKELEY_DB_LIB="-ldb"
         echo "$ac_t""$BERKELEY_DB_DIR" 1>&6
     fi
+echo "BERKELEY_DB_LDFLAGS: $BERKELEY_DB_LDFLAGS" >&5
+echo "BERKELEY_DB_CFLAGS:  $BERKELEY_DB_CFLAGS" >&5
+echo "BERKELEY_DB_LIB:     $BERKELEY_DB_LIB" >&5
     cat >> confdefs.h <<\EOF
 #define USE_BERKELEY_DB 1
 EOF
@@ -8072,7 +8086,7 @@
 fi
 rm -f conftest*
 test "$ac_cv_search_krb5_parse_name" = "no" && for i in krb5; do
-LIBS="-l$i $LIBS -lk5crypto -lcom_err $ac_func_search_save_LIBS"
+LIBS="-l$i $LIBS  -lcom_err $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 8078 "configure"
 #include "confdefs.h"
@@ -8103,10 +8117,10 @@
   test "$ac_cv_search_krb5_parse_name" = "none required" || LIBS="$ac_cv_search_krb5_parse_name $LIBS"
   KRB5_LIB=$LIBS
                 KRB5_AUTH="auth_krb5"
-     KRB5_LIB="$KRB5_LDFLAGS $KRB5_LIB -lk5crypto -lcom_err"
+     KRB5_LIB="$KRB5_LDFLAGS $KRB5_LIB  -lcom_err"
      
      
-     for ac_hdr in et/com_err.h
+     for ac_hdr in com_err.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6

--- patch-configure ends here ---

--- patch-configure.removed begins here ---
--- configure.orig	Mon Mar 20 04:14:57 2006
+++ configure	Sat May  6 02:32:58 2006
@@ -7604,36 +7604,9 @@
 	    done
         done
     fi
-    if test x"$BERKELEY_DB_DIR" = xyes ; then
-        for v in db43 db42 db41 db4 db3 db2 ; do
-            if test -d "/usr/local/include/$v" ; then
-                BERKELEY_DB_LDFLAGS="-L/usr/local/lib"
-                BERKELEY_DB_CFLAGS="-I/usr/local/include/$v"
-                BERKELEY_DB_LIB="-l$v"
-                echo "$ac_t""FreeBSD locations" 1>&6
-                break
-            fi
-        done
-        if test x"$BERKELEY_DB_LIB" = x ; then
-            for v in db43 db42 db41 db4 db3 db2 ; do
-                if test -d "/usr/include/$v" ; then
-                    BERKELEY_DB_CFLAGS="-I/usr/include/$v"
-                    BERKELEY_DB_LIB="-l$v"
-                    echo "$ac_t""Linux locations" 1>&6
-                    break
-                fi
-            done
-            if test x"$BERKELEY_DB_LIB" = x ; then        
-                BERKELEY_DB_LIB=-ldb
-                echo "$ac_t""trying -ldb" 1>&6
-            fi
-        fi
-    else
         BERKELEY_DB_LDFLAGS="-L$BERKELEY_DB_DIR/lib"
-        BERKELEY_DB_CFLAGS="-I$BERKELEY_DB_DIR/include"
-        BERKELEY_DB_LIB="-ldb"
-        echo "$ac_t""$BERKELEY_DB_DIR" 1>&6
-    fi
+        BERKELEY_DB_CFLAGS="-I$BERKELEY_DB_DIR/include/${DB_VER}"
+        BERKELEY_DB_LIB="-l${DB_VER}"
     cat >> confdefs.h <<\EOF
 #define USE_BERKELEY_DB 1
 EOF

--- patch-configure.removed ends here ---

--- patch-ovdb_stat.c begins here ---
--- frontends/ovdb_stat.c.orig	2006-03-19 22:14:57.000000000 -0600
+++ frontends/ovdb_stat.c	2008-07-01 20:00:23.000000000 -0500
@@ -266,12 +266,12 @@
  { INT32, F(st_nobjects),      -1, -1,           "Current objects" },
  { INT32, F(st_maxnobjects),   -1, -1,           "Maximum objects" },
 #endif
- { INT32, F(st_nconflicts),    -1, -1,           "Lock conflicts" },
+ { INT32, F(st_lock_wait),    -1, -1,           "Lock conflicts" },
  { INT32, F(st_nrequests),     -1, -1,           "Lock requests" },
  { INT32, F(st_nreleases),     -1, -1,           "Lock releases" },
  { DIFF32, F(st_nrequests), F(st_nreleases), F(st_ndeadlocks), "Outstanding locks" },
 #if DB_VERSION_MAJOR >= 4 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 0)
- { INT32, F(st_nnowaits),      -1, -1,           "Lock requests that would have waited" },
+ { INT32, F(st_lock_nowait),      -1, -1,           "Lock requests that would have waited" },
 #endif
  { INT32, F(st_ndeadlocks),    -1, -1,           "Deadlocks" },
 #if DB_VERSION_MAJOR >= 4

--- patch-ovdb_stat.c ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1217397977.1915>