Submitted By:            Armin K. <krejzi at email dot com>
Date:                    2014-07-14
Initial Package Version: 5.5.14
Upstream Status:         Rejected
Origin:                  Upstream Bugzilla
Description:             Adds Berkeley DB 6.1 support

--- a/configure	2014-06-25 17:45:34.000000000 +0200
+++ b/configure	2014-07-13 20:59:32.001642816 +0200
@@ -31367,8 +31367,13 @@
 
   dbdp4="/usr/local/BerkeleyDB.4."
   dbdp5="/usr/local/BerkeleyDB.5."
-  for i in $PHP_DB4 ${dbdp5}1 ${dbdp5}0 ${dbdp4}8 ${dbdp4}7 ${dbdp4}6 ${dbdp4}5 ${dbdp4}4 ${dbdp4}3 ${dbdp4}2 ${dbdp4}1 ${dbdp}0 /usr/local /usr; do
-    if test -f "$i/db5/db.h"; then
+  dbdp6="/usr/local/BerkeleyDB.6."
+  for i in $PHP_DB4 ${dbdp6}.1 ${dbdp6}.0 ${dbdp5}1 ${dbdp5}0 ${dbdp4}8 ${dbdp4}7 ${dbdp4}6 ${dbdp4}5 ${dbdp4}4 ${dbdp4}3 ${dbdp4}2 ${dbdp4}1 ${dbdp}0 /usr/local /usr; do
+    if test -f "$i/db6/db.h"; then
+      THIS_PREFIX=$i
+      THIS_INCLUDE=$i/db6/db.h
+      break
+    elif test -f "$i/db5/db.h"; then
       THIS_PREFIX=$i
       THIS_INCLUDE=$i/db5/db.h
       break
@@ -31376,6 +31381,14 @@
       THIS_PREFIX=$i
       THIS_INCLUDE=$i/db4/db.h
       break
+    elif test -f "$i/include/db6.1/db.h"; then
+      THIS_PREFIX=$i
+      THIS_INCLUDE=$i/include/db6.1/db.h
+      break
+    elif test -f "$i/include/db6.0/db.h"; then
+      THIS_PREFIX=$i
+      THIS_INCLUDE=$i/include/db6.0/db.h
+      break
     elif test -f "$i/include/db5.1/db.h"; then
       THIS_PREFIX=$i
       THIS_INCLUDE=$i/include/db5.1/db.h
@@ -31422,7 +31435,7 @@
   if test -z "$THIS_INCLUDE"; then
     as_fn_error $? "DBA: Could not find necessary header file(s)." "$LINENO" 5
   fi
-  for LIB in db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db; do
+  for LIB in db-6.1 db-6.0 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db; do
     if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
       lib_found="";
 
@@ -31452,7 +31465,7 @@
 /* end confdefs.h.  */
 
 #include "$THIS_INCLUDE"
-#if DB_VERSION_MAJOR == 4 || (4 == 4 && DB_VERSION_MAJOR == 5)
+#if DB_VERSION_MAJOR == 4 || (4 == 4 && DB_VERSION_MAJOR == 5) || (4 == 4 && DB_VERSION_MAJOR == 6)
             yes
 #endif
 
--- a/ext/dba/config.m4	2014-06-25 15:06:23.000000000 +0200
+++ b/ext/dba/config.m4	2014-07-13 20:59:41.164810766 +0200
@@ -362,7 +362,7 @@
       break
     fi
   done
-  PHP_DBA_DB_CHECK(4, db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
+  PHP_DBA_DB_CHECK(4, db-6.1 db-6.0 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
 fi
 PHP_DBA_STD_RESULT(db4,Berkeley DB4)
 
