#! /bin/sh /usr/share/dpatch/dpatch-run
## 302-scripts-comply-with-FHS.dpatch by  <kmccarty@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Put data files under @DATADIR@ and assume $CERN is @PREFIX@ by default
## DP: in scripts.  (These values are filled in from add-ons/Makefile.)
## DP: Also some other improvements.

@DPATCH@
diff -urNad cernlib-2005.05.09.dfsg~/src/graflib/dzdoc/dzedit/dzedit.script cernlib-2005.05.09.dfsg/src/graflib/dzdoc/dzedit/dzedit.script
--- cernlib-2005.05.09.dfsg~/src/graflib/dzdoc/dzedit/dzedit.script	1996-05-05 11:16:16.000000000 -0400
+++ cernlib-2005.05.09.dfsg/src/graflib/dzdoc/dzedit/dzedit.script	2005-12-13 10:07:57.712733227 -0500
@@ -13,9 +13,9 @@
  
   SHOPT="d:h:v:"
 #SEQ,GETOPTD.
-                          drv="X11" ; hst="0"
-  [ -z "$CERN"       ] && CERN="/cern"
-  [ -z "$CERN_LEVEL" ] && ver="pro" || ver="$CERN_LEVEL"
+                          drv="X11" ; hst=""
+  [ -z "$CERN"       ] && CERN="@PREFIX@"
+  [ -z "$CERN_LEVEL" ] && ver="." || ver="$CERN_LEVEL"
  
   while [ $# -gt 0 ]
   do case $1 in
@@ -35,12 +35,12 @@
 #    inlib $GKS_INLIB
      GDIR=$CERN/gks/$ver/bin
   fi
-  if [ "$drv" = "X11" ] ; then
-     DISPLAY="$hst:0" ; export DISPLAY
+  if [ "$drv" = "X11" -a -n "$hst" ] ; then
+     DISPLAY="$hst:0.0" ; export DISPLAY
   fi
-  if [ "$ver" != "pro" ] ; then
+  if [ "$ver" != "." ] ; then
      echo
      echo " Calling $ver version of dzedit-$drv..."
      echo
   fi
-  $GDIR/dze$drv $*
+exec $GDIR/dze$drv "$@"
