--- vncserver.orig	Thu Sep  4 06:04:39 2003
+++ vncserver	Wed Mar  3 21:41:54 2004
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
 #
 #  Copyright (C) 2002-2003 RealVNC Ltd.
 #  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
@@ -36,9 +36,9 @@
 $geometry = "1024x768";
 $depth = 16;
 $vncJavaFiles = (((-d "/usr/share/vnc/classes") && "/usr/share/vnc/classes") ||
-                 ((-d "/usr/local/vnc/classes") && "/usr/local/vnc/classes"));
+                 ((-d "@PREFIX@/vnc/classes") && "@PREFIX@/vnc/classes"));
 $vncUserDir = "$ENV{HOME}/.vnc";
-$xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority";
+$xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority" || "$vncUserDir/.Xauthority";
 
 $defaultXStartup
     = ("#!/bin/sh\n\n".
