openbsd-ports/devel/tkcvs/patches/patch-tkcvs_doinstall
2007-10-26 20:44:35 +00:00

134 lines
3.4 KiB
Plaintext

$OpenBSD: patch-tkcvs_doinstall,v 1.1 2007/10/26 20:44:35 ajacoutot Exp $
--- tkcvs/doinstall.orig Tue Jan 9 22:17:52 1996
+++ tkcvs/doinstall Fri Oct 26 22:41:26 2007
@@ -2,10 +2,10 @@
#
# $Id: patch-tkcvs_doinstall,v 1.1 2007/10/26 20:44:35 ajacoutot Exp $
#
-
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
# Some rational and reasonable defaults.
-INSTALLDIR=/usr/local/lib
+INSTALLDIR=/usr/local/libdata
BINDIR=/usr/local/bin
MANDIR=/usr/local/man/mann
@@ -14,22 +14,32 @@ 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 wish8.4`
+if [ ! -f ${WISH} ]
+then
+ WISH=`which wish4.2`
+fi
+if [ ! -f ${WISH} ]
+then
WISH=`which wish4.1`
fi
-if [ ! -f $WISH ]; then
+if [ ! -f ${WISH} ]
+then
+ WISH=`which wish4.0`
+fi
+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
+for GDIR in /usr/include/X11/bitmaps /usr/openwin/include/X11/bitmaps /usr/X11/include/bitmaps /usr/X11R6/include/bitmaps /usr/include/bitmaps /usr/local/include/bitmaps
do
if [ -d "$GDIR" ]; then
break
@@ -46,15 +56,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 +72,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 +104,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