diff -urN vpopmail.old/Makefile vpopmail/Makefile --- vpopmail.old/Makefile Wed Aug 25 17:09:45 2004 +++ vpopmail/Makefile Fri Sep 3 17:09:24 2004 @@ -93,7 +93,9 @@ # # PostgreSQL database configuration options # +# WITH_PGSQL_HOST - the hostname of the PostgreSQL server (localhost) # WITH_PGSQL_USER - the username for connecting to the PostgreSQL server (postgres) +# WITH_PGSQL_PASSWD - the password for connecting to the PostgreSQL server (secret) # WITH_PGSQL_DB - the name of the PostgreSQL database to use (vpopmail) # # Oracle database configuration options @@ -161,6 +163,7 @@ POSTGRESQL_PORT?= databases/postgresql7 LIB_DEPENDS+= pq.3:${PORTSDIR}/${POSTGRESQL_PORT} CONFIGURE_ARGS+= --enable-auth-module=pgsql +EXTRA_PATCHES+= ${PATCHDIR}/vpgsql.h.patch .if defined(WITH_PGSQL_LOG) CONFIGURE_ARGS+= --enable-pgsql-logging @@ -281,8 +284,14 @@ .if defined(WITH_PGSQL_DB) ${REINPLACE_CMD} -E -e "s/(#define DB.*)vpopmail(.*)/\1${WITH_PGSQL_DB}\2/" ${WRKSRC}/vpgsql.h .endif +.if defined(WITH_PGSQL_HOST) + ${REINPLACE_CMD} -E -e "s/(#define DBHOST.*)localhost(.*)/\1${WITH_PGSQL_HOST}\2/" ${WRKSRC}/vpgsql.h +.endif .if defined(WITH_PGSQL_USER) - ${REINPLACE_CMD} -E -e "s/(#define PG_CONNECT.*)postgres(.*)/\1${WITH_PGSQL_USER}\2/" ${WRKSRC}/vpgsql.h + ${REINPLACE_CMD} -E -e "s/(#define DBUSER.*)postgres(.*)/\1${WITH_PGSQL_USER}\2/" ${WRKSRC}/vpgsql.h +.endif +.if defined(WITH_PGSQL_PASSWD) + ${REINPLACE_CMD} -E -e "s/(#define DBPASSWD.*)secret(.*)/\1${WITH_PGSQL_PASSWD}\2/" ${WRKSRC}/vpgsql.h .endif .endif .if defined(WITH_ORACLE) diff -urN vpopmail.old/files/vpgsql.h.patch vpopmail/files/vpgsql.h.patch --- vpopmail.old/files/vpgsql.h.patch Thu Jan 1 09:00:00 1970 +++ vpopmail/files/vpgsql.h.patch Fri Sep 3 17:03:04 2004 @@ -0,0 +1,14 @@ +--- vpgsql.h.orig Fri Sep 3 16:57:54 2004 ++++ vpgsql.h Fri Sep 3 17:00:19 2004 +@@ -23,7 +23,10 @@ + + /* Edit to match your set up */ + #define DB "vpopmail" +-#define PG_CONNECT "user=postgres dbname=" DB ++#define DBHOST "localhost" ++#define DBUSER "postgres" ++#define DBPASSWD "secret" ++#define PG_CONNECT "host=" DBHOST " user=" DBUSER " password=" DBPASSWD " dbname=" DB + + // char replacing spaces and dashes + #define SQL_DOT_CHAR '_'