ports/128467: [patch] databases/php4-dba: change Berkeley DB detection to USE_BDB.
Scot W. Hetzel
swhetzel at gmail.com
Wed Oct 29 23:20:01 UTC 2008
>Number: 128467
>Category: ports
>Synopsis: [patch] databases/php4-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:20:00 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/php4/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/php4-dba install databases/db44.
>How-To-Repeat:
install any of the db4* ports except db44, and then build databases/php4-dba, selecting DB4 from the options menu, and without setting WITH_DB4_VER.
The port will install databases/db44, even though there is an existing version of Berkley DB installed.
>Fix:
The attached patch changes lang/php4/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/php4/Makefile.ext
databases/php4-dba/files/patch-config.m4
Patch attached with submission follows:
Index: databases/php4-dba/files/patch-config.m4
===================================================================
RCS file: /home/ncvs/ports/databases/php4-dba/files/patch-config.m4,v
retrieving revision 1.4
diff -u -r1.4 patch-config.m4
--- databases/php4-dba/files/patch-config.m4 17 Feb 2007 10:19:17 -0000 1.4
+++ databases/php4-dba/files/patch-config.m4 29 Oct 2008 17:33:23 -0000
@@ -1,34 +1,23 @@
---- config.m4.orig Tue Nov 28 12:41:35 2006
-+++ config.m4 Sat Feb 17 11:13:51 2007
-@@ -205,6 +205,22 @@
+--- config.m4-orig 2006-11-28 05:41:35.000000000 -0600
++++ config.m4 2008-10-29 12:32:36.000000000 -0500
+@@ -201,9 +201,9 @@
+ if test "$withval" != "no"; then
+ PHP_DBA_STD_BEGIN
+ for i in $withval /usr/local/BerkeleyDB.4.2 /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.0 /usr/local /usr; do
+- if test -f "$i/db4/db.h"; then
++ if test -f "$i/BDB_INCLUDE_DIR/db.h"; then
THIS_PREFIX=$i
- THIS_INCLUDE=$i/db4/db.h
+- THIS_INCLUDE=$i/db4/db.h
++ THIS_INCLUDE=$i/BDB_INCLUDE_DIR/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/db.h"; then
THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db4/db.h
-@@ -223,7 +239,7 @@
+@@ -223,7 +223,7 @@
break
fi
done
- PHP_DBA_DB_CHECK(4, 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-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db41 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
])
AC_DBA_STD_RESULT(db4,Berkeley DB4)
Index: lang/php4/Makefile.ext
===================================================================
RCS file: /home/ncvs/ports/lang/php4/Makefile.ext,v
retrieving revision 1.41
diff -u -r1.41 Makefile.ext
--- lang/php4/Makefile.ext 23 Sep 2008 05:40:46 -0000 1.41
+++ lang/php4/Makefile.ext 29 Oct 2008 17:24:57 -0000
@@ -387,24 +387,10 @@
CONFIGURE_ARGS+=--without-cdb
. endif
. if defined(WITH_DB4)
-WITH_DB4_VER?= 44
-. 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.4.0:${PORTSDIR}/databases/db44
-. endif
-. endif
-. endif
-. endif
+USE_BDB= yes
+INVALID_BDB_VER= 2 3
+OBSOLETE_BDB_VAR= WITH_DB4_VER
+#WITH_BDB_VER?= 44+
CONFIGURE_ARGS+=--with-db4=${LOCALBASE}
. endif
. if defined(WITH_GDBM)
@@ -418,6 +404,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} == "domxml"
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list