Subject: pkg/23296: mail/postfix needs a db
To: None <gnats-bugs@gnats.netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 10/28/2003 13:56:36
>Number:         23296
>Category:       pkg
>Synopsis:       mail/postfix needs a db
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 28 21:57:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6.1_STABLE
>Organization:
http://bsd.reedmedia.net/
>Environment:
	
	
>Description:
I had fixed this long ago and forgot about it.
Building postfix under Linux using db installed from pkgsrc
does:

 No <db.h> include file found.
 Install the appropriate db*-devel package first.
 See the RELEASE_NOTES file for more information.
 *** Error code 1

Postfix's makedefs assumes that /usr/include/db.h or /usr/include/db/db.h
and libdb exist on a Linux 2.x system. Note that glibc doesn't
provide db.h or libdb anymore. And even SleepyCat wants newer db used.
(So what provides /usr/include/db.h or /usr/include/db/db.h?)

This PR is very similar to my PR pkg/19277 (which I reopened).

>How-To-Repeat:
	
>Fix:
The following gives some ideas. Also please look at my PR pkg/19277.
I wonder if their should be some option for choosing the database used by
Postfix.

? mail/postfix/patches/patch-ai
Index: mail/postfix/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/postfix/Makefile,v
retrieving revision 1.104
diff -b -u -r1.104 Makefile
--- mail/postfix/Makefile	2003/10/03 15:04:52	1.104
+++ mail/postfix/Makefile	2003/10/28 21:47:12
@@ -25,6 +25,9 @@
 CCARGS+=	-DDEF_NEWALIAS_PATH=\"${PREFIX}/bin/newaliases\"
 CCARGS+=	-DDEF_COMMAND_DIR=\"${PREFIX}/sbin\"
 CCARGS+=	-DDEF_DAEMON_DIR=\"${LIBEXECDIR}\"
+# maybe make db customizable like exim
+CCARGS+=	${BUILDLINK_CPPFLAGS.db3}
+AUXLIBS+=	-ldb3
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -179,4 +182,7 @@
 do-install:
 	(cd ${WRKSRC} && ${SETENV} config_directory="${SHAREDIR}" ${SH} postfix-install -non-interactive)
 
+#.include "../../databases/db4/buildlink2.mk"
+#.include "../../databases/db/buildlink2.mk"
+.include "../../databases/db3/buildlink2.mk"
 .include "../../mk/bsd.pkg.mk"
Index: mail/postfix/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/mail/postfix/distinfo,v
retrieving revision 1.48
diff -b -u -r1.48 distinfo
--- mail/postfix/distinfo	2003/10/03 15:04:52	1.48
+++ mail/postfix/distinfo	2003/10/28 21:47:12
@@ -10,3 +10,4 @@
 SHA1 (patch-af) = 4d3a6c21d284dce1c75dcd4fc537af17a28a5e66
 SHA1 (patch-ag) = 7c59f4bee987dedc2fd5f193a8d5c980ac09ae82
 SHA1 (patch-ah) = 6beedd15ee3a7cfd46cf3ed0b9ee579b9906300b
+SHA1 (patch-ai) = c2c58cd7ba57d7da4d21f0b92e837d9f504a83c1

and patch-ai

--- makedefs.orig	2003-01-23 05:45:02.000000000 -0800
+++ makedefs	2003-10-28 12:51:01.000000000 -0800
@@ -179,17 +179,19 @@
 		if [ -f /usr/include/db.h ]
 		then
 		    : we are all set
+		    SYSLIBS="-ldb"
 		elif [ -f /usr/include/db/db.h ]
 		then
 		    CCARGS="$CCARGS -I/usr/include/db"
-		else
-		    # No, we're not going to try db1 db2 db3 etc.
-		    # On a properly installed system, Postfix builds
-		    # by including <db.h> and by linking with -ldb
-		    echo "No <db.h> include file found." 1>&2
-		    echo "Install the appropriate db*-devel package first." 1>&2
-		    echo "See the RELEASE_NOTES file for more information." 1>&2
-		    exit 1
+		    SYSLIBS="-ldb"
+#		else
+#		    # No, we're not going to try db1 db2 db3 etc.
+#		    # On a properly installed system, Postfix builds
+#		    # by including <db.h> and by linking with -ldb
+#		    echo "No <db.h> include file found." 1>&2
+#		    echo "Install the appropriate db*-devel package first." 1>&2
+#		    echo "See the RELEASE_NOTES file for more information." 1>&2
+#		    exit 1
 		fi
 		# GDBM locks the DBM .pag file after open. This breaks postmap.
 		# if [ -f /usr/include/gdbm-ndbm.h ]
@@ -201,7 +203,7 @@
 		#     CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H='<gdbm/ndbm.h>'"
 		#     GDBM_LIBS=gdbm
 		# fi
-		SYSLIBS="-ldb"
+#		SYSLIBS="-ldb"
 		for name in nsl resolv $GDBM_LIBS
 		do
 		    for lib in /usr/lib64 /lib64 /usr/lib /lib
>Release-Note:
>Audit-Trail:
>Unformatted: