Fix correct commit hash for release 0.7.0 of openXC7
[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 groff # tex-live
14
15 # Make sure to use the flex included with tasyagle
16 apt-get remove flex
17
18 mkdir -p /home/$SUDO_USER/src
19 cd /home/$SUDO_USER/src
20 git clone https://git.libre-soc.org/git/tas-yagle.git
21 cd tas-yagle
22
23 # Specify installation dir
24 installDir="/usr/local"
25 installDir=$installDir ./build.sh
26
27 cd /home/$SUDO_USER/src
28 chown -R $SUDO_USER .
29 chgrp -R $SUDO_USER .
30
31 STRING="source $installDir/bin/avt_env.sh"
32 if grep -q "$STRING" /home/$SUDO_USER/.bashrc ; then
33 echo 'avt_env.sh already in .bashrc'
34 else
35 # Default .bashrc usually has a check if shell is
36 # interactive, so adding at the start is a workaround
37 echo 'Adding avt_env.sh to .bashrc'
38 sed -i "1i $STRING" /home/$SUDO_USER/.bashrc
39 chown -R $SUDO_USER /home/$SUDO_USER/.bashrc
40 chgrp -R $SUDO_USER /home/$SUDO_USER/.bashrc
41 fi
42
43 # Compile the documentation and example
44 echo "Entering bash as $SUDO_USER to reload .bashrc and compile docs!"
45 runuser $SUDO_USER -c "/bin/bash << EOF
46 . ~/.bashrc
47 cd /home/$SUDO_USER/src/tas-yagle/distrib/docxml2
48 make
49 cd /home/$SUDO_USER/src/tas-yagle/distrib/share/tutorials/hitas/inv
50 ./db.tcl
51 EOF"
52
53 echo "Finished tas-yagle compilation, make sure to source .bashrc!"