$OpenBSD: patch-check_postgres_pl,v 1.3 2015/07/18 22:59:01 sthen Exp $
--- check_postgres.pl.orig	Tue Jun 30 09:58:51 2015
+++ check_postgres.pl	Sat Jul 18 16:57:07 2015
@@ -878,12 +878,9 @@ if (! $opt{'no-check_postgresrc'}) {
     elsif (exists $ENV{HOME} and -e "$ENV{HOME}/.check_postgresrc") {
         $rcfile = "$ENV{HOME}/.check_postgresrc";
     }
-    elsif (-e '/etc/check_postgresrc') {
-        $rcfile = '/etc/check_postgresrc';
+    elsif (-e '${SYSCONFDIR}/check_postgresrc') {
+        $rcfile = '${SYSCONFDIR}/check_postgresrc';
     }
-    elsif (-e '/usr/local/etc/check_postgresrc') {
-        $rcfile = '/usr/local/etc/check_postgresrc';
-    }
 }
 ## We need a temporary hash so that multi-value options can be overridden on the command line
 my %tempopt;
@@ -2074,7 +2071,7 @@ sub build_symlinks {
             next;
         }
 
-        if (symlink $0, $file) {
+        if (symlink '${TRUEPREFIX}/bin/check_postgres.pl', $file) {
             print msgn('symlink-create', $file);
         }
         else {
