2004-04-26 00:57:46 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
## ================================================================
|
|
|
|
## Logtalk - Open source object-oriented logic programming language
|
2007-11-06 01:50:09 +00:00
|
|
|
## Release 2.30.7
|
2004-08-16 17:41:11 +01:00
|
|
|
##
|
2007-01-10 12:46:10 +00:00
|
|
|
## Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
2007-06-12 11:39:47 +01:00
|
|
|
## ================================================================
|
2004-08-16 17:41:11 +01:00
|
|
|
|
2004-04-26 00:57:46 +01:00
|
|
|
echo
|
2004-11-29 20:36:31 +00:00
|
|
|
echo "This script copies the Logtalk user-modifiable files and directories"
|
|
|
|
echo "to the user home directory. The location can be set by the environment"
|
2007-06-12 11:39:47 +01:00
|
|
|
echo "variable \$LOGTALKUSER (defaults to \"~/logtalk\" when the variable is not"
|
2004-11-29 20:36:31 +00:00
|
|
|
echo "defined)"
|
2004-04-26 00:57:46 +01:00
|
|
|
echo
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
if ! [ "$LOGTALKHOME" ]; then
|
|
|
|
echo "The environment variable LOGTALKHOME should be defined first!"
|
|
|
|
echo "Trying default Logtalk installation directories..."
|
|
|
|
if [ -d "/usr/local/share/logtalk" ]; then
|
|
|
|
LOGTALKHOME=/usr/local/share/logtalk
|
|
|
|
echo "Using Logtalk installation at \"/usr/local/share/logtalk\""
|
|
|
|
elif [ -d "/usr/share/logtalk" ]; then
|
|
|
|
LOGTALKHOME=/usr/share/logtalk
|
|
|
|
echo "Using Logtalk installation at \"/usr/share/logtalk\""
|
|
|
|
elif [ -d "/opt/local/share/logtalk" ]; then
|
|
|
|
LOGTALKHOME=/opt/local/share/logtalk
|
|
|
|
echo "Using Logtalk installation at \"/opt/local/share/logtalk\""
|
|
|
|
elif [ -d "/opt/share/logtalk" ]; then
|
|
|
|
LOGTALKHOME=/opt/share/logtalk
|
|
|
|
echo "Using Logtalk installation at \"/opt/share/logtalk\""
|
|
|
|
else
|
|
|
|
echo "Unable to locate Logtalk installation directory!"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "After the script completion, you must set the environment variable"
|
|
|
|
echo "LOGTALKHOME pointing to \"$LOGTALKHOME\"."
|
2004-11-29 20:36:31 +00:00
|
|
|
echo
|
2007-06-12 11:39:47 +01:00
|
|
|
elif ! [ -d "$LOGTALKHOME" ]; then
|
2005-12-24 18:00:21 +00:00
|
|
|
echo "The environment variable LOGTALKHOME points to a non-existing directory!"
|
|
|
|
echo "Its current value is: $LOGTALKHOME"
|
|
|
|
echo "The variable must be set to your Logtalk installation directory!"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2005-04-23 00:57:45 +01:00
|
|
|
if ! [ "$LOGTALKUSER" ]
|
2005-02-10 00:02:06 +00:00
|
|
|
then
|
|
|
|
LOGTALKUSER=$HOME/logtalk
|
|
|
|
echo "After the script completion, you must set the environment variable"
|
2007-06-12 11:39:47 +01:00
|
|
|
echo "LOGTALKUSER pointing to \"$LOGTALKUSER\"."
|
2004-11-29 20:36:31 +00:00
|
|
|
echo
|
2005-02-10 00:02:06 +00:00
|
|
|
fi
|
|
|
|
|
2005-04-23 00:57:45 +01:00
|
|
|
if [ -d "$LOGTALKUSER" ]
|
2005-02-10 00:02:06 +00:00
|
|
|
then
|
2007-11-06 01:50:09 +00:00
|
|
|
date=`eval date \"+%Y-%m-%d-%H%M%S\"`
|
2006-11-07 17:11:47 +00:00
|
|
|
mv $LOGTALKUSER "$LOGTALKUSER backup $date"
|
2007-06-12 11:39:47 +01:00
|
|
|
echo "Created a backup of the existing \"$LOGTALKUSER\" directory."
|
2004-04-26 00:57:46 +01:00
|
|
|
echo
|
|
|
|
fi
|
2005-02-10 00:02:06 +00:00
|
|
|
|
|
|
|
echo "Copying Logtalk files and directories..."
|
2005-04-23 00:57:45 +01:00
|
|
|
mkdir -p "$LOGTALKUSER"/configs
|
|
|
|
mkdir -p "$LOGTALKUSER"/contributions
|
|
|
|
mkdir -p "$LOGTALKUSER"/examples
|
|
|
|
mkdir -p "$LOGTALKUSER"/libpaths
|
|
|
|
mkdir -p "$LOGTALKUSER"/library
|
|
|
|
mkdir -p "$LOGTALKUSER"/xml
|
|
|
|
cp -RL "$LOGTALKHOME"/configs "$LOGTALKUSER"/
|
|
|
|
cp -RL "$LOGTALKHOME"/contributions "$LOGTALKUSER"/
|
|
|
|
cp -RL "$LOGTALKHOME"/examples "$LOGTALKUSER"/
|
|
|
|
cp -RL "$LOGTALKHOME"/libpaths "$LOGTALKUSER"/
|
2006-11-07 17:11:47 +00:00
|
|
|
sed 's_\$LOGTALKUSER_'$LOGTALKUSER'_' "$LOGTALKUSER"/libpaths/libpaths.pl > "$LOGTALKUSER"/libpaths/libpaths_no_env_var.pl
|
2005-04-23 00:57:45 +01:00
|
|
|
cp -RL "$LOGTALKHOME"/library "$LOGTALKUSER"/
|
|
|
|
cp -RL "$LOGTALKHOME"/xml "$LOGTALKUSER"/
|
|
|
|
chmod -R u+w "$LOGTALKUSER"
|
2005-12-24 18:00:21 +00:00
|
|
|
rm -f "$LOGTALKUSER"/xml/lgt2*
|
|
|
|
rm -f "$LOGTALKUSER"/xml/logtalk.dtd
|
|
|
|
rm -f "$LOGTALKUSER"/xml/logtalk.xsd
|
2006-11-07 17:11:47 +00:00
|
|
|
ln -sf "$LOGTALKHOME"/BIBLIOGRAPHY.bib "$LOGTALKUSER"/BIBLIOGRAPHY.bib
|
|
|
|
ln -sf "$LOGTALKHOME"/CUSTOMIZE.txt "$LOGTALKUSER"/CUSTOMIZE.txt
|
|
|
|
ln -sf "$LOGTALKHOME"/INSTALL.txt "$LOGTALKUSER"/INSTALL.txt
|
|
|
|
ln -sf "$LOGTALKHOME"/LICENSE.txt "$LOGTALKUSER"/LICENSE.txt
|
|
|
|
ln -sf "$LOGTALKHOME"/QUICK_START.txt "$LOGTALKUSER"/QUICK_START.txt
|
|
|
|
ln -sf "$LOGTALKHOME"/README.txt "$LOGTALKUSER"/README.txt
|
|
|
|
ln -sf "$LOGTALKHOME"/RELEASE_NOTES.txt "$LOGTALKUSER"/RELEASE_NOTES.txt
|
|
|
|
ln -sf "$LOGTALKHOME"/UPGRADING.txt "$LOGTALKUSER"/UPGRADING.txt
|
2005-04-23 00:57:45 +01:00
|
|
|
ln -sf "$LOGTALKHOME"/manuals "$LOGTALKUSER"/manuals
|
2006-03-26 18:31:34 +01:00
|
|
|
ln -sf "$LOGTALKHOME"/wenv "$LOGTALKUSER"/wenv
|
2005-12-24 18:00:21 +00:00
|
|
|
ln -sf "$LOGTALKHOME"/xml/lgt2html.sh "$LOGTALKUSER"/xml/lgt2html
|
|
|
|
ln -sf "$LOGTALKHOME"/xml/lgt2pdf.sh "$LOGTALKUSER"/xml/lgt2pdf
|
|
|
|
ln -sf "$LOGTALKHOME"/xml/lgt2xml.sh "$LOGTALKUSER"/xml/lgt2xml
|
|
|
|
ln -sf "$LOGTALKHOME"/xml/logtalk.dtd "$LOGTALKUSER"/xml/logtalk.dtd
|
2007-06-12 11:39:47 +01:00
|
|
|
ln -sf "$LOGTALKHOME"/xml/logtalk.rng "$LOGTALKUSER"/xml/logtalk.rng
|
2005-12-24 18:00:21 +00:00
|
|
|
ln -sf "$LOGTALKHOME"/xml/logtalk.xsd "$LOGTALKUSER"/xml/logtalk.xsd
|
|
|
|
echo "Finished copying Logtalk files and directories."
|
2005-02-10 00:02:06 +00:00
|
|
|
echo
|
2007-06-12 11:39:47 +01:00
|
|
|
echo "You may need to edit the \"$LOGTALKUSER/libpaths/libpaths.pl\""
|
|
|
|
echo "file to match your Prolog compiler and operating-system requirements or"
|
|
|
|
echo "to add your own library paths."
|
2005-02-10 00:02:06 +00:00
|
|
|
echo
|
|
|
|
echo "You may want to customize the default Logtalk compiler flags by editing"
|
|
|
|
echo "the configuration file for your Prolog compiler found in the directory"
|
2007-06-12 11:39:47 +01:00
|
|
|
echo "\"$LOGTALKUSER/configs\"."
|
|
|
|
echo "For more information on customizing Logtalk and your working environment,"
|
|
|
|
echo "consult the \"$LOGTALKUSER/CUSTOMIZE.txt\" file."
|
2005-02-10 00:02:06 +00:00
|
|
|
echo
|