--- a/sqlgrey	2012-08-24 18:05:39.000000000 -0700
+++ b/sqlgrey	2012-08-24 18:07:09.000000000 -0700
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!@PREFIX@/bin/perl -w
 
 # sqlgrey: a postfix greylisting policy server using an SQL backend
 # based on postgrey
@@ -56,11 +56,11 @@
 # defaults
 my %dflt;
 $dflt{loglevel}           = 2; # used for $dflt{log} entries in read_conffile()
-$dflt{user}               = 'sqlgrey';
-$dflt{group}              = 'sqlgrey';
+$dflt{user}               = '@SQLGREYUSER@';
+$dflt{group}              = '@SQLGREYGROUP@';
 $dflt{inet}               = '2501';
-$dflt{pidfile}            = '/var/run/sqlgrey.pid';
-$dflt{conf_dir}           = '/etc/sqlgrey';
+$dflt{pidfile}            = '@PREFIX@/var/run/@NAME@/sqlgrey.pid';
+$dflt{conf_dir}           = '@PREFIX@/etc/sqlgrey';
 $dflt{reconnect_delay}    = 5;            # 5 minutes
 $dflt{max_connect_age}    = 24;           # 24 hours
 $dflt{awl_age}            = 60;           # 60 days
@@ -103,7 +103,7 @@
 	     };
 
 # Default configuration file
-my $config_file              = '/etc/sqlgrey/sqlgrey.conf';
+my $config_file              = '@PREFIX@/etc/sqlgrey/sqlgrey.conf';
 
 # whitelist files
 my $stat_ip_whitelist_file   = $dflt{conf_dir} . '/clients_ip_whitelist';
@@ -2703,7 +2703,7 @@
         close(STDERR);
 	# Ugly hack to prevent perl from complaining
 	# 'warning: Filehandle STDERR reopened as FILE only \
-	# for input at /usr/bin/sqlgrey line 717, <FILE> line 57'
+	# for input at @PREFIX@/bin/sqlgrey line 717, <FILE> line 57'
 	open(STDIN,'</dev/null');
 	open(STDOUT,'>/dev/null');
 	open(STDERR,'>/dev/null');
@@ -2787,15 +2787,15 @@
  -k, --kill                 kill a running sqlgrey
                             (identified by 'pidfile' content)
  -f, --configfile=FILE      read config from FILE
-                            (default /etc/sqlgrey/sqlgrey.conf)
+                            (default @PREFIX@/etc/sqlgrey/sqlgrey.conf)
                             expecting config_param=value lines,
                             - spaces are ignored,
                             - '#' is used for comments
 
-See the default config file at /etc/sqlgrey/sqlgrey.conf for runtime parameters.
+See the default config file at @PREFIX@/etc/sqlgrey/sqlgrey.conf for runtime parameters.
 If you got sqlgrey from sources, read the HOWTO file in the compressed archive.
 If it came prepackaged, look into the documentation tree for this file:
-/usr/share/doc/sqlgrey-<version>/ on most Linux distributions for example.
+@PREFIX@/share/doc/sqlgrey-<version>/ on most Linux distributions for example.
 
 =head1 DESCRIPTION
 
@@ -2903,7 +2903,7 @@
 =item *
 
 Start by adding check_policy_service after reject_unauth_destination in
-/etc/postfix/main.cf :
+@PREFIX@/etc/postfix/main.cf :
 
  smtpd_recipient_restrictions =
                ...
@@ -2927,7 +2927,7 @@
 If you want to disable greylisting for some users you can configure
 Postfix like this:
 
-/etc/postfix/sqlgrey_recipient_access:
+@PREFIX@/etc/postfix/sqlgrey_recipient_access:
   i_like_spam@ee.ethz.ch                OK
 
 Then you'll add a check_recipient_access in main.cf before the
@@ -2935,8 +2935,8 @@
  smtpd_recipient_restrictions =
        ...
        reject_unauth_destination
-       check_client_access    hash:/etc/postfix/sqlgrey_client_access
-       check_recipient_access hash:/etc/postfix/sqlgrey_recipient_access
+       check_client_access    hash:@PREFIX@/etc/postfix/sqlgrey_client_access
+       check_recipient_access hash:@PREFIX@/etc/postfix/sqlgrey_recipient_access
        check_policy_service inet:127.0.0.1:10023
 
 =head1 SEE ALSO