FG42/install.sh

82 lines
2.1 KiB
Bash
Raw Normal View History

2011-07-22 14:48:30 +01:00
#! /bin/bash
2011-12-05 18:36:03 +00:00
VERSION=$(emacs -l src/lib/version.el --eval "(princ (get_version))" --batch -Q)
2011-12-03 10:34:57 +00:00
# Gathering informations
2011-12-05 18:36:03 +00:00
echo -e "\n\tKuso IDE $VERSION copyright 2010-2011 Sameer Rahmani <lxsameer@gnu.org>\n\n"
2011-12-03 10:34:57 +00:00
echo "Enter requested informations. You can change it later in top"
echo -e "level customization.\n\n"
2011-12-05 11:06:21 +00:00
condition="1"
while [ "$condition" == "1" ] ; do
read -p "Do you want to install Kuso IDE as an stand alone application ([y]/n)? " standalone
if [ "$standalone" == "" -o "$standalone" == "y" ]
then
standalone="y"
dotemacs=~/.kuso
repo=~/.kuso.d
condition="0"
2011-12-05 15:36:23 +00:00
conffile=conf/dotkuso
2011-12-05 11:06:21 +00:00
fi
if [ "$standalone" == "n" ]
then
dotemacs=~/.emacs
repo=~/.emacs.d
condition="0"
2011-12-05 15:36:23 +00:00
conffile=conf/dotemacs
2011-12-05 11:06:21 +00:00
fi
done
2011-12-03 10:34:57 +00:00
read -p "Enter your full name: " fullname
read -p "Enter your email address: " mail
read -p "Where is your workspace directory[~/src/]: " workspace
# Validating informations
if [ "$workspace" == "" ]
then
2011-12-03 11:18:19 +00:00
workspace="$HOME/src/"
2011-12-03 10:34:57 +00:00
fi
2011-12-05 11:06:21 +00:00
addr=$HOME/.kuso.d
2011-07-29 12:37:34 +01:00
2011-12-03 10:34:57 +00:00
# Installing stage1
kusohome=`pwd`
2011-12-05 11:06:21 +00:00
mkdir -p $repo
if [ -e $dotemacs ]; then
2011-12-03 10:34:57 +00:00
echo "Backing up exists .emacs file . . ."
2011-12-05 11:06:21 +00:00
cp $dotemacs "$dotemacs.backup"
2011-07-22 14:48:30 +01:00
fi
2011-12-03 10:34:57 +00:00
echo "Copying files . . . "
2011-12-05 11:06:21 +00:00
cp conf/emacs.d/* $repo -r
2011-12-03 10:34:57 +00:00
mkdir -p $addr
2011-12-03 18:08:25 +00:00
mkdir -p $HOME/.tmp
2011-07-29 14:32:31 +01:00
cp conf/bin/pyemacs.sh $addr/ -r
2011-12-03 10:34:57 +00:00
chmod u+x $addr/pyemacs.sh
echo "Creating ~/.emacs"
2011-12-05 15:36:23 +00:00
cp $conffile $dotemacs
2011-12-05 13:59:14 +00:00
if [ "$standalone" == "y" ]
then
cp bin/kuso $repo
cp bin/kuso.desktop $HOME/.local/share/applications/
2011-12-05 15:11:36 +00:00
sed "s,--HOME--,$HOME,mg" -i $HOME/.local/share/applications/kuso.desktop
2011-12-05 13:59:14 +00:00
cp images/icon.svg $repo
fi
2011-12-03 10:34:57 +00:00
sed "s/--EMAIL--/$mail/mg" -i $dotemacs
sed "s/--FULLNAME--/$fullname/mg" -i $dotemacs
sed "s,--WORKSPACE--,$workspace,mg" -i $dotemacs
sed "s,--ADDR--,$addr,mg" -i $dotemacs
sed "s,--KUSOHOME--,$kusohome,mg" -i $dotemacs
2011-12-05 15:11:36 +00:00
echo "Copy the below code in your initial shell script:"
echo
echo "export PATH=\$PATH:$repo"
2011-12-03 11:18:19 +00:00
echo -e "\nInstallation finished."
2011-12-05 19:45:26 +00:00
echo "Restart the GNU/Emacs and make sure that all the requirements met."
echo
printf "\033[01;33mImportant Note:\033[00m Do NOT remove the Kuso IDE source."