ports/128468: [patch] databases/php5-dba: change Berkeley DB detection to USE_BDB.

Scot W. Hetzel swhetzel at gmail.com
Wed Oct 29 23:30:02 UTC 2008


>Number:         128468
>Category:       ports
>Synopsis:       [patch] databases/php5-dba: change Berkeley DB detection to USE_BDB.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 29 23:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Scot W. Hetzel
>Release:        8.0-CURRENT
>Organization:
>Environment:
FreeBSD hp010.hetzel.org 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Mon Oct 27 22:02:16 CDT 2008     root at hp010.hetzel.org:/usr/obj/usr/src/8x-zfs/sys/DV8135NR  amd64

>Description:
Currently, the lang/php5/Makefile.ext file is not able to detect the installed version of Berkeley DB.  Instead it depends on the user to set WITH_DB4_VER to the current version installed or letting the databases/php5-dba install databases/db46.

>How-To-Repeat:
install any of the db4* ports except db46, and then build databases/php5-dba, selecting DB4 from the options menu, and without setting WITH_DB4_VER.

The port will install databases/db46, even though there is an existing version of Berkley DB installed.
>Fix:
The attached patch changes lang/php5/Makefile.ext to use USE_BDB for detection of the installed Berkeley DB version, as well as patching ${WRKSRC}/config.m4 with the correct values obtained from BDB_LIB_NAME and BDB_INCLUDE_DIR.

Changed files:

lang/php5/Makefile.ext
databases/php5-dba/files/patch-config.m4

Patch attached with submission follows:

Index: databases/php5-dba/files/patch-config.m4
===================================================================
RCS file: /home/ncvs/ports/databases/php5-dba/files/patch-config.m4,v
retrieving revision 1.7
diff -u -r1.7 patch-config.m4
--- databases/php5-dba/files/patch-config.m4	2 May 2008 08:52:07 -0000	1.7
+++ databases/php5-dba/files/patch-config.m4	29 Oct 2008 17:03:34 -0000
@@ -1,33 +1,23 @@
---- config.m4.orig	2007-12-06 15:17:43.000000000 +0100
-+++ config.m4	2008-05-02 10:05:06.000000000 +0200
-@@ -280,6 +280,30 @@
+--- config.m4.orig	2007-12-06 08:17:43.000000000 -0600
++++ config.m4	2008-10-29 11:58:50.000000000 -0500
+@@ -276,9 +276,9 @@
+   PHP_DBA_STD_BEGIN
+   dbdp="/usr/local/BerkeleyDB.4."
+   for i in $PHP_DB4 ${dbdp}6 ${dbdp}5 ${dbdp}4 ${dbdp}3  ${dbdp}2 ${dbdp}1 ${dbdp}0 /usr/local /usr; do
+-    if test -f "$i/db4/db.h"; then
++    if test -f "BDB_INCLUDE_DIR/db.h"; then
        THIS_PREFIX=$i
-       THIS_INCLUDE=$i/db4/db.h
+-      THIS_INCLUDE=$i/db4/db.h
++      THIS_INCLUDE=BDB_INCLUDE_DIR/db.h
        break
-+    elif test -f "$i/include/db46/db.h"; then
-+      THIS_PREFIX=$i
-+      THIS_INCLUDE=$i/include/db46/db.h
-+      break
-+    elif test -f "$i/include/db45/db.h"; then
-+      THIS_PREFIX=$i
-+      THIS_INCLUDE=$i/include/db45/db.h
-+      break
-+    elif test -f "$i/include/db44/db.h"; then
-+      THIS_PREFIX=$i
-+      THIS_INCLUDE=$i/include/db44/db.h
-+      break
-+    elif test -f "$i/include/db43/db.h"; then
-+      THIS_PREFIX=$i
-+      THIS_INCLUDE=$i/include/db43/db.h
-+      break
-+    elif test -f "$i/include/db42/db.h"; then
-+      THIS_PREFIX=$i
-+      THIS_INCLUDE=$i/include/db42/db.h
-+      break
-+    elif test -f "$i/include/db41/db.h"; then
-+      THIS_PREFIX=$i
-+      THIS_INCLUDE=$i/include/db41/db.h
-+      break
      elif test -f "$i/include/db4.6/db.h"; then
        THIS_PREFIX=$i
-       THIS_INCLUDE=$i/include/db4.6/db.h
+@@ -306,7 +306,7 @@
+       break
+     fi
+   done
+-  PHP_DBA_DB_CHECK(4, 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, BDB_LIB_NAME, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
+ fi
+ PHP_DBA_STD_RESULT(db4,Berkeley DB4)
+ 
Index: lang/php5/Makefile.ext
===================================================================
RCS file: /home/ncvs/ports/lang/php5/Makefile.ext,v
retrieving revision 1.56
diff -u -r1.56 Makefile.ext
--- lang/php5/Makefile.ext	23 Sep 2008 05:41:43 -0000	1.56
+++ lang/php5/Makefile.ext	29 Oct 2008 16:53:33 -0000
@@ -310,7 +310,7 @@
 
 USE_PHP=	pdo
 USE_PHP_BUILD=	yes
-PHP_HEADER_DIRS=sqlite/src
+#PHP_HEADER_DIRS=sqlite/src
 .endif
 
 
@@ -502,32 +502,10 @@
 CONFIGURE_ARGS+=--without-cdb
 .	endif
 .	if defined(WITH_DB4)
-WITH_DB4_VER?=	46
-.		if ${WITH_DB4_VER} == 45
-LIB_DEPENDS+=	db-4.5.0:${PORTSDIR}/databases/db45
-.		else
-.		if ${WITH_DB4_VER} == 44
-LIB_DEPENDS+=	db-4.4.0:${PORTSDIR}/databases/db44
-.		else
-.		if ${WITH_DB4_VER} == 43
-LIB_DEPENDS+=	db-4.3.0:${PORTSDIR}/databases/db43
-.		else
-.		if ${WITH_DB4_VER} == 42
-LIB_DEPENDS+=	db-4.2.2:${PORTSDIR}/databases/db42
-.		else
-.		if ${WITH_DB4_VER} == 41
-LIB_DEPENDS+=	db41.1:${PORTSDIR}/databases/db41
-.		else
-.		if ${WITH_DB4_VER} == 4
-LIB_DEPENDS+=	db4.0:${PORTSDIR}/databases/db4
-.		else
-LIB_DEPENDS+=	db-4.6.0:${PORTSDIR}/databases/db46
-.		endif
-.		endif
-.		endif
-.		endif
-.		endif
-.		endif
+USE_BDB=		yes
+INVALID_BDB_VER=	2 3
+OBSOLETE_BDB_VAR=	WITH_DB4_VER
+#WITH_BDB_VER?=		46+
 CONFIGURE_ARGS+=--with-db4=${LOCALBASE}
 .	endif
 .	if defined(WITH_GDBM)
@@ -546,6 +524,13 @@
 .	if defined(WITHOUT_FLATFILE)
 CONFIGURE_ARGS+=--without-flatfile
 .	endif
+
+. if defined(WITH_DB4)
+post-patch:
+	${REINPLACE_CMD} -e "s!BDB_LIB_NAME!${BDB_LIB_NAME}!g" \
+		-e "s!BDB_INCLUDE_DIR!${BDB_INCLUDE_DIR:S,^${PREFIX}/,,}!g" \
+		${WRKSRC}/config.m4
+. endif
 .endif
 
 .if ${PHP_MODNAME} == "gd"


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



More information about the freebsd-ports-bugs mailing list