2003-09-24 05:27:39 +04:00
#!/bin/sh
# first version (Sept 2003) written by Shiro Yamada <shiro@miraclelinux.com>
# based on the first verion (March 2002) of installdat.sh written by Herb Lewis
2006-02-24 03:30:09 +03:00
DESTDIR = $1
MSGDIR = ` echo $2 | sed 's/\/\//\//g' `
SRCDIR = $3 /
shift
shift
shift
2003-09-24 05:27:39 +04:00
2006-02-24 03:30:09 +03:00
case $0 in
*uninstall*)
if test ! -d " $DESTDIR / $MSGDIR " ; then
echo " Directory $DESTDIR / $MSGDIR does not exist! "
echo "Do a " make installmsg" or " make install" first. "
exit 1
fi
mode = 'uninstall'
; ;
*) mode = 'install' ; ;
esac
2003-09-24 05:27:39 +04:00
2006-02-25 20:58:52 +03:00
for f in $SRCDIR /po/*.msg; do
FNAME = " $DESTDIR / $MSGDIR /`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
2003-09-24 05:27:39 +04:00
done
2006-02-24 03:30:09 +03:00
if test " $mode " = 'install' ; then
cat << EOF
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
The SWAT msg files have been installed. You may uninstall the msg files using
the command "make uninstallmsg" or "make uninstall" to uninstall binaries, man
pages, msg files, and shell scripts.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
EOF
else
cat << EOF
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
The SWAT msg files have been removed. You may restore these files using the
command "make installmsg" or "make install" to install binaries, man pages,
modules, msg files, and shell scripts.
2003-09-24 05:27:39 +04:00
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
EOF
2006-02-24 03:30:09 +03:00
fi
2003-09-24 05:27:39 +04:00
exit 0