2002-03-22 02:42:54 +03:00
#!/bin/sh
#fist version March 2002, Herb Lewis
2006-02-24 03:30:09 +03:00
DESTDIR = $1
DATDIR = ` echo $2 | sed 's/\/\//\//g' `
SRCDIR = $3 /
shift
shift
shift
2002-03-22 02:42:54 +03:00
2006-02-24 03:30:09 +03:00
case $0 in
*uninstall*)
if test ! -d " $DESTDIR / $DATDIR " ; then
echo " Directory $DESTDIR / $DATDIR does not exist! "
echo "Do a " make installmsg" or " make install" first. "
exit 1
fi
mode = 'uninstall'
; ;
*) mode = 'install' ; ;
esac
2002-03-22 02:42:54 +03:00
2006-02-25 20:58:52 +03:00
for f in $SRCDIR /codepages/*.dat; do
FNAME = " $DESTDIR / $DATDIR /`basename $f ` "
2006-02-24 03:30:09 +03:00
if test " $mode " = 'install' ; then
2006-02-25 20:58:52 +03:00
echo " Installing $f as $FNAME "
cp " $f " " $FNAME "
2006-03-03 20:00:56 +03:00
if test ! -f " $FNAME " ; then
2006-02-24 03:30:09 +03:00
echo " Cannot install $FNAME . Does $USER have privileges? "
exit 1
fi
2006-02-25 20:58:52 +03:00
chmod 0644 " $FNAME "
2006-02-24 03:30:09 +03:00
elif test " $mode " = 'uninstall' ; then
echo " Removing $FNAME "
rm -f " $FNAME "
2006-03-03 20:00:56 +03:00
if test -f " $FNAME " ; then
2006-02-24 03:30:09 +03:00
echo " Cannot remove $FNAME . Does $USER have privileges? "
exit 1
fi
else
echo " Unknown mode, $mode . Script called as $0 "
exit 1
fi
2002-03-22 02:42:54 +03:00
done
2006-02-24 03:30:09 +03:00
if test " $mode " = 'install' ; then
cat << EOF
2002-03-22 02:42:54 +03:00
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
2006-02-24 03:30:09 +03:00
The dat files have been installed. You may uninstall the dat files
using the command "make uninstalldat" or "make uninstall" to uninstall
binaries, man pages, dat files, and shell scripts.
2002-03-22 02:42:54 +03:00
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
EOF
2006-02-24 03:30:09 +03:00
else
cat << EOF
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
The dat files have been removed. You may restore these files using
the command "make installdat" or "make install" to install binaries,
man pages, modules, dat files, and shell scripts.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
EOF
fi
2002-03-22 02:42:54 +03:00
exit 0