[dovecot-cvs] dovecot INSTALL,1.8,1.9 configure.in,1.105,1.106 dovecot-example.conf,1.54,1.55

cras at procontrol.fi cras at procontrol.fi
Fri Mar 7 01:20:18 EET 2003


Update of /home/cvs/dovecot
In directory danu:/tmp/cvs-serv13378

Modified Files:
	INSTALL configure.in dovecot-example.conf 
Log Message:
Added PostgreSQL support, patch by Alex Howansky



Index: INSTALL
===================================================================
RCS file: /home/cvs/dovecot/INSTALL,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- INSTALL	18 Feb 2003 19:09:18 -0000	1.8
+++ INSTALL	6 Mar 2003 23:20:16 -0000	1.9
@@ -88,6 +88,7 @@
   --with-ldap             Build with LDAP support
   --with-vpopmail         Build with vpopmail support (default)
   --with-static-userdb    Build with static userdb support (default)
+  --with-pgsql            Build with PostgreSQL support
 
 Specify which authentication modules to use. Disabling them give you a few
 bytes smaller binary, but not much else.
@@ -107,8 +108,13 @@
 db-ldap.c userdb-ldap.c passdb-ldap.c -o ldap.so \
 ../lib-settings/libsettings.a -lldap
 
+gcc -shared -fPIC -DUSERDB_PGSQL -DPASSDB_PGSQL \
+-I../.. -I../lib -I../lib-settings -I/usr/include/postgresql \
+db-pgsql.c userdb-pgsql.c passdb-pgsql.c -o pgsql.so \
+../lib-settings/libsettings.a -L/usr/lib/postgresql -lpq
+
 gcc -shared -fPIC -DUSERDB_VPOPMAIL -DPASSDB_VPOPMAIL -I../.. -I../lib \
 userdb-vpopmail.c passdb-vpopmail.c -o vpopmail.so -lvpopmail
 
-Including libsettings.a in ldap.so is kind of annoying, but it's not
-currently needed elsewhere in dovecot-auth.
+Including libsettings.a in ldap.so and pgsql.so is kind of annoying, but it's
+not needed elsewhere in dovecot-auth.

Index: configure.in
===================================================================
RCS file: /home/cvs/dovecot/configure.in,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- configure.in	25 Feb 2003 20:58:36 -0000	1.105
+++ configure.in	6 Mar 2003 23:20:16 -0000	1.106
@@ -115,6 +115,15 @@
 	fi,
 	want_static_userdb=yes)
 
+AC_ARG_WITH(pgsql,
+[  --with-pgsql            Build with PostgreSQL support],
+	if test x$withval = xno; then
+		want_pgsql=no
+	else
+		want_pgsql=yes
+	fi,
+	want_pgsql=no)
+
 AC_ARG_WITH(cyrus-sasl2,
 [  --with-cyrus-sasl2      Build with Cyrus SASL 2 library support],
 	if test x$withval = xno; then
@@ -769,6 +778,38 @@
 	])
 fi
 
+if test $want_pgsql = yes; then
+	# based on code from PHP
+	for i in /usr /usr/local /usr/local/pgsql; do
+		for j in include include/pgsql include/postgres include/postgresql ""; do
+			if test -r "$i/$j/libpq-fe.h"; then
+			PGSQL_INC_BASE=$i
+			PGSQL_INCLUDE=$i/$j
+		fi
+		done
+		for j in lib lib/pgsql lib/postgres lib/postgresql ""; do
+			if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then
+				PGSQL_LIBDIR=$i/$j
+			fi
+		done
+	done
+
+	old_LIBS=$LIBS
+	LIBS="$LIBS -L$PGSQL_LIBDIR"
+
+	AC_CHECK_LIB(pq, PQconnectdb, [
+		AC_CHECK_HEADER($PGSQL_INCLUDE/libpq-fe.h, [
+			AUTH_CFLAGS="$AUTH_CFLAGS -I$PGSQL_INCLUDE"
+			PASSDB_LIBS="$PASSDB_LIBS -L$PGSQL_LIBDIR -lpq"
+			AC_DEFINE(USERDB_PGSQL,, Build with PostgreSQL support)
+			AC_DEFINE(PASSDB_PGSQL,, Build with PostgreSQL support)
+			userdb="$userdb pgsql"
+			passdb="$passdb pgsql"
+		])
+	])
+	LIBS=$old_LIBS
+fi
+
 if test $want_vpopmail = yes; then
 	vpopmail_home="`echo ~vpopmail`"
 	vpop_libdeps="$vpopmail_home/etc/lib_deps"
@@ -825,6 +866,7 @@
 
 AM_CONDITIONAL(AUTH_MODULES, test "$auth_modules" = "yes")
 
+AC_SUBST(AUTH_CFLAGS)
 AC_SUBST(PASSDB_LIBS)
 
 dnl **

Index: dovecot-example.conf
===================================================================
RCS file: /home/cvs/dovecot/dovecot-example.conf,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- dovecot-example.conf	23 Feb 2003 21:06:57 -0000	1.54
+++ dovecot-example.conf	6 Mar 2003 23:20:16 -0000	1.55
@@ -362,6 +362,7 @@
 #   static uid=<uid> gid=<gid> home=<dir template>: static settings
 #   vpopmail: vpopmail library
 #   ldap <config path>: LDAP, see doc/dovecot-ldap.conf
+#   pgsql <config path>: a PostgreSQL database, see doc/dovecot-pgsql.conf
 auth_userdb = passwd
 
 # Where password database is kept:
@@ -371,6 +372,7 @@
 #   passwd-file <path>: passwd-like file with specified location
 #   vpopmail: vpopmail authentication
 #   ldap <config path>: LDAP, see doc/dovecot-ldap.conf
+#   pgsql <config path>: a PostgreSQL database, see doc/dovecot-pgsql.conf
 auth_passdb = pam
 
 # Executable location




More information about the dovecot-cvs mailing list