tasyagle-install: Added check with .bashrc, commented out doc generation
[dev-env-setup.git] / tasyagle-install
1 #!/bin/sh
2
3 if [ "$EUID" -ne 0 ]
4 then echo "Please run as root"
5 exit
6 fi
7
8 apt-get install -y quilt tcsh swig libedit-dev tcl8.6-dev \
9 libmotif-dev libxpa1 libxt-dev libxpm-dev \
10 default-jre-headless default-jdk-headless \
11 libncurses5 libedit-dev \
12 libsaxon-java libsaxonb-java libservlet3.1-java fop\
13 # tex-live
14
15 mkdir -p /home/$SUDO_USER/src
16 cd /home/$SUDO_USER/src
17 git clone https://git.libre-soc.org/git/tas-yagle.git
18 cd tas-yagle
19
20 # Specify installation dir
21 installDir="/usr/local" ./build.sh
22
23 cd /home/$SUDO_USER/src
24 chown -R $SUDO_USER .
25 chgrp -R $SUDO_USER .
26
27 STRING="source /usr/local/avt_env.sh"
28 if grep -q "$STRING" /home/$SUDO_USER/.bashrc ; then
29 echo 'avt_env.sh already in .bashrc'
30 else
31 echo 'Adding avt_env.sh to .bashrc'
32 echo "$STRING" >> /home/$SUDO_USER/.bashrc
33 chown -R $SUDO_USER /home/$SUDO_USER/.bashrc
34 chgrp -R $SUDO_USER /home/$SUDO_USER/.bashrc
35 fi
36
37
38 # Compile the documentation
39 # source the file, otherwise can't compile docs...
40 # TODO: source doesn't work within script, do manually as normal user
41 # for now
42 #source /home/$SUDO_USER/.bashrc
43 #cd tas-yagle/distrib/docxml2
44 #make
45
46 cd /home/$SUDO_USER/src
47 chown -R $SUDO_USER .
48 chgrp -R $SUDO_USER .