--- Config.orig	2010-02-22 13:43:01.247512371 +0100
+++ Config	2010-02-22 13:47:49.048414822 +0100
@@ -27,31 +27,31 @@
 
 ############################################################################
 # Location of compiler
-CC           = gcc
+#CC           = gcc
 # Location of make program (GNU make required)
 MAKE         = gmake
 # Location of install program (GNU install or compatible required)
 INSTALL      = install
 
 # Base Compiler options for GCC (use CPPFLAGS and LDFLAGS if passed in)
-ifdef CPPFLAGS
-  BASECFLAGS   = $(CPPFLAGS)
+ifdef PORTCFLAGS
+  BASECFLAGS   = $(PORTCFLAGS)
 else
   BASECFLAGS   = -Wall -g -O2
 endif
 ifdef INCLUDES
   BASECFLAGS += $(INCLUDES)
 endif
-ifdef LDFLAGS
- BASELDFLAGS  = $(LDFLAGS)
+ifdef PORTLDFLAGS
+ BASELDFLAGS  = $(PORTLDFLAGS)
 else
  BASELDFLAGS  = -g
 endif
 
 # Minimal libraries needed by Linux
-BASE_LIBS    = -lcrypt -lutil
+#BASE_LIBS    = -lcrypt -lutil
 # FreeBSD needs some extra libraries:
-# BASE_LIBS   = -lcrypt -liconv -lutil
+BASE_LIBS   = -lcrypt -liconv -lutil
 # Solaris needs even more libararies:
 # BASE_LIBS   = -lcrypt -lxnet -lnsl -lsocket
 
@@ -71,9 +71,9 @@
 # which points to ../../imap/c-client. This just reduces the amount of
 # noise output on each line when building the package.
 #
-CCLIENT_DIR=../c-client
-CCLIENT_INCLUDE=-I $(CCLIENT_DIR)
-CCLIENT_LIBS=./$(CCLIENT_DIR)/c-client.a
+#CCLIENT_DIR=../c-client
+#CCLIENT_INCLUDE=-I $(CCLIENT_DIR)
+#CCLIENT_LIBS=./$(CCLIENT_DIR)/c-client.a
 
 #
 # Following works with imap-devel RPM package from Redhat 7.
@@ -92,12 +92,14 @@
 # Following works with the mail/cclient port from FreeBSD
 #
 #CCLIENT_INCLUDE = -I/usr/local/include/c-client
+CCLIENT_INCLUDE = -I${LOCALBASE}/include/c-client
 #CCLIENT_LIBS    = -L/usr/local/lib -lc-client4
+CCLIENT_LIBS     = -L${LOCALBASE}/lib -lc-client4
 #
 # Complication:
 #   The FreeBSD port uses PAM and optionally SSL if built WITH_SSL=yes.
 #
-#CCLIENT_SSL_ENABLE  = true
+CCLIENT_SSL_ENABLE  = true
 #CCLIENT_KERB_ENABLE = true
 
 ############################################################################
@@ -111,7 +113,7 @@
 Z_LIBS    = -lz
 
 # LDAP (required if LDAP_ENABLE set)
-LDAP_INCLUDE =
+LDAP_INCLUDE = -I${LOCALBASE}/include
 LDAP_LIBS    = -lldap
 
 # Pam (required if CCLIENT_PAM_ENABLE set)
@@ -140,12 +142,12 @@
 # DB definitions (required if SESSION_CACHE_ENABLE set)
 #
 # Following suitable for Redhat Linux which has DB 3 preinstalled
-DB_INCLUDE=
-DB_LIBS=-ldb
+#DB_INCLUDE=
+#DB_LIBS=-ldb
 
 # Following suitable for FreeBSD with DB 4 package installed
-#DB_INCLUDE=-I/usr/local/include/db4
-#DB_LIBS=-L/usr/local/lib -ldb4
+DB_INCLUDE=-I/usr/local/include/db42
+DB_LIBS=-L/usr/local/lib -ldb-4.2
 
 ############################################################################
 
@@ -166,7 +168,7 @@
 # Default configuration and permissions does not allow prayer user to
 # update prayer configuration file.
 
-PREFIX    = /usr/local/prayer
+PREFIX    = %%PREFIX%%/prayer
 RO_USER   = root
 RO_GROUP  = prayer
 
@@ -181,6 +183,6 @@
 PRIVATE_FILE = 0640
 
 # Location of configuration files and binaries
-PRAYER_CONFIG_FILE   = ${PREFIX}/etc/prayer.cf
-BIN_DIR              = ${PREFIX}/sbin
-ACCOUNTD_CONFIG_FILE = ${PREFIX}/etc/prayer-accountd.cf
+PRAYER_CONFIG_FILE   = %%PREFIX%%/etc/prayer/prayer.cf
+BIN_DIR              = %%PREFIX%%/sbin
+ACCOUNTD_CONFIG_FILE = %%PREFIX%%/etc/prayer/accountd.cf
