$OpenBSD: patch-tkcvs_doinstall,v 1.2 2009/03/13 13:36:57 sthen Exp $
--- tkcvs/doinstall.orig	Tue Jan  9 21:17:52 1996
+++ tkcvs/doinstall	Fri Mar 13 13:28:27 2009
@@ -2,39 +2,32 @@
 #
 # $Id: patch-tkcvs_doinstall,v 1.2 2009/03/13 13:36:57 sthen Exp $
 #
-
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALBASE}/bin
 # Some rational and reasonable defaults.
 
-INSTALLDIR=/usr/local/lib
-BINDIR=/usr/local/bin
-MANDIR=/usr/local/man/mann
+INSTALLDIR=${LOCALBASE}/libdata
+BINDIR=${LOCALBASE}/bin
+MANDIR=${LOCALBASE}/man/mann
 
 INSTALL_PROG=./install-sh
 
 # This must be an X based editor -- do NOT use vi except via an xterm
 # or shelltool.
 
-EDITOR=nedit
+EDITOR=xedit
 
 # Find a Tk interpreter.
  
-WISH=`which wish4.0`
-if [ ! -f $WISH ]; then
-  WISH=`which wish4.1`
-fi
-if [ ! -f $WISH ]; then
+WISH=${MODTK_BIN}
+if [ ! -f ${WISH} ]
+then
   echo "I cant find a Tk interpreter on your system"
   exit 1
 fi
 
 # Find where the global bitmaps are.
 
-for GDIR in /usr/include/X11/bitmaps /usr/openwin/include/X11/bitmaps /usr/X11/include/bitmaps /usr/include/bitmaps /usr/local/include/bitmaps
-do
-  if [ -d "$GDIR" ]; then
-    break
-  fi
-done
+GDIR=${X11BASE}/include/X11/bitmaps
 if [ ! -d "$GDIR" ]; then
   echo "Enter the directory where your X11 bitmaps are stored:"
   GDIR=`line`
@@ -46,15 +39,15 @@ fi
 
 # Find out where we want the system installed.
 
-if [ ! -d "$INSTALLDIR" ]; then
+if [ ! -d "${DESTDIR}$INSTALLDIR" ]; then
   echo "Enter the top level installation directory:"
   INSTALLDIR=`line`
-  mkdir -p $INSTALLDIR
-  if [ ! -d $INSTALLDIR ]; then
+  mkdir -p ${DESTDIR}$INSTALLDIR
+  if [ ! -d ${DESTDIR}$INSTALLDIR ]; then
     echo "I cant create that directory"
     exit 1
   fi
-  if [ ! -w $INSTALLDIR ]; then
+  if [ ! -w ${DESTDIR}$INSTALLDIR ]; then
     echo "I cant write to that directory"
     exit 1
   fi
@@ -62,25 +55,25 @@ fi
 
 # Some directories we have to create.
 
-LDIR=${INSTALLDIR}/bitmaps
+LDIR=${INSTALLDIR}/tkcvs/bitmaps
 TCDIR=${INSTALLDIR}/tkcvs
-mkdir -p $LDIR $TCDIR
+mkdir -p ${DESTDIR}$LDIR ${DESTDIR}$TCDIR
 for dir in $LDIR $TCDIR
 do
-  if [ ! -d $dir ]; then
+  if [ ! -d ${DESTDIR}$dir ]; then
     echo "I cant create the directory $dir"
     exit 1
   fi
 done
 
-if [ ! -d "$BINDIR" ]; then
+if [ ! -d ${DESTDIR}"$BINDIR" ]; then
   echo "Enter the directory where you want the programs to be stored:"
   BINDIR=`line`
-  if [ ! -d "$BINDIR" ]; then
+  if [ ! -d ${DESTDIR}"$BINDIR" ]; then
     echo "I cant find that directory"
     exit 1
   fi
-  if [ ! -w "$BINDIR" ]; then
+  if [ ! -w ${DESTDIR}"$BINDIR" ]; then
     echo "I cant write to that directory" 
     exit 1 
   fi
@@ -94,21 +87,21 @@ do
       -e "/GDIR/ s;;$GDIR;g" \
       -e "/EDITOR/ s;;$EDITOR;g" \
       -e "/TCDIR/ s;;$TCDIR;g" ${file}.blank >$file
-    $INSTALL_PROG -m 555 $file $BINDIR
+    $INSTALL_PROG -m 555 $file ${DESTDIR}$BINDIR
     rm -f $file
   fi
 done
 
 for f in *.n ../tkdiff/*.n
 do
-        $INSTALL_PROG -m 444 $f $MANDIR
+        $INSTALL_PROG -m 444 $f ${DESTDIR}$MANDIR
 done
 for f in *.tcl
 do
-        $INSTALL_PROG -m 444 $f $TCDIR
+        $INSTALL_PROG -m 444 $f ${DESTDIR}$TCDIR
 done
 for f in ../bitmaps/*.xbm
 do
-        $INSTALL_PROG -m 444 $f $LDIR
+        $INSTALL_PROG -m 444 $f ${DESTDIR}$LDIR
 done
-$INSTALL_PROG -m 444 tclIndex $TCDIR
+$INSTALL_PROG -m 444 tclIndex ${DESTDIR}$TCDIR
