Submitted By: Mario Fetka (mario-fetka at gmx dot at)
Date: 2008-07-25
Initial Package Version: 2.2.2
Origin: me
Upstream Status: Unknown
Description: Add Support for berkerly db 4.5
 
diff -Naur reprepro-3.5.2.orig/configure.ac reprepro-3.5.2/configure.ac
--- reprepro-3.5.2.orig/configure.ac	2008-06-27 15:31:23.000000000 +0000
+++ reprepro-3.5.2/configure.ac	2008-07-25 20:41:48.000000000 +0000
@@ -26,7 +26,7 @@
 DBCPPFLAGS=""
 AH_TEMPLATE([LIBDB_VERSION],[variant of libdb used])
 AC_ARG_WITH(libdb,
-[  --with-libdb=path|4.4|4.3|3 Give prefix of libdb-4.3 or older version to use],[dnl
+[  --with-libdb=path|4.6|4.5|4.4|4.3|3 Give prefix of libdb-4.3 or older version to use],[dnl
 	case "$withval" in
 	no)
 	AC_MSG_ERROR(["Cannot compile without libdb"]);
@@ -40,6 +40,9 @@
 	4.4)
 	DB_WANT_VERSION=4.4
 	;;
+	4.5)
+	DB_WANT_VERSION=4.5
+	;;
 	4.6)
 	DB_WANT_VERSION=4.6
 	;;
@@ -83,6 +86,12 @@
 	elif test "$DB_WANT_VERSION" != "4.4" ; then
 		AC_MSG_ERROR([Found libdb major version $DB_VERSION_MAJOR.$DB_VERSION_MINOR, need $DB_WANT_VERSION])
 	fi
+elif test "x$DB_VERSION_MAJOR" = "x4" -a "x$DB_VERSION_MINOR" = "x5" ; then
+	if test "$DB_WANT_VERSION" = "any" ; then
+		DB_WANT_VERSION=4.5
+	elif test "$DB_WANT_VERSION" != "4.5" ; then
+		AC_MSG_ERROR([Found libdb major version $DB_VERSION_MAJOR.$DB_VERSION_MINOR, need $DB_WANT_VERSION])
+	fi
 elif test "x$DB_VERSION_MAJOR" = "x4" -a "x$DB_VERSION_MINOR" = "x6" ; then
 	if test "$DB_WANT_VERSION" = "any" ; then
 		DB_WANT_VERSION=4.6
@@ -91,7 +100,7 @@
 	fi
 else
 	AC_MSG_ERROR([Unsupported libdb major $DB_VERSION_MAJOR minor $DB_VERSION_MINOR
-Only 4.3 (stronly recommended) or 3.2 or 4.4 or 4.6 are supported])
+Only 4.3 (stronly recommended) or 3.2 or 4.4 or 4.5 or 4.6 are supported])
 fi
 
 # now we have a header with the expected version, check for the library:
@@ -102,6 +111,12 @@
 			DBLIBS="-ldb-4.6 $DBLIBS"
 	],[AC_MSG_ERROR(["no libdb-4.6 found"])],[$DBLIBS])
 ;;
+4.5)
+	AC_CHECK_LIB(db-4.5,db_create,[dnl
+			AC_DEFINE_UNQUOTED(AS_TR_CPP(LIBDB_VERSION),45)
+			DBLIBS="-ldb-4.5 $DBLIBS"
+	],[AC_MSG_ERROR(["no libdb-4.5 found"])],[$DBLIBS])
+;;
 4.4)
 	AC_CHECK_LIB(db-4.4,db_create,[dnl
 			AC_DEFINE_UNQUOTED(AS_TR_CPP(LIBDB_VERSION),44)
diff -Naur reprepro-3.5.2.orig/database.c reprepro-3.5.2/database.c
--- reprepro-3.5.2.orig/database.c	2008-06-06 21:00:21.000000000 +0000
+++ reprepro-3.5.2/database.c	2008-07-25 20:42:32.000000000 +0000
@@ -245,6 +245,8 @@
 
 #if LIBDB_VERSION == 46
 #define DB_OPEN(database,filename,name,type,flags) database->open(database,NULL,filename,name,type,flags,0664)
+#elif LIBDB_VERSION == 45
+#define DB_OPEN(database,filename,name,type,flags) database->open(database,NULL,filename,name,type,flags,0664)
 #elif LIBDB_VERSION == 44
 #define DB_OPEN(database,filename,name,type,flags) database->open(database,NULL,filename,name,type,flags,0664)
 #elif LIBDB_VERSION == 43