#!/bin/bash
#
###############################################################################
# The following steps need to be executed AS SUPERUSER if you haven't been
# running the script 'prepare-system.sh'.
###############################################################################
#
# Add the following lines to your /etc/apt/sources.list file. 
# for the wxWidgets/wxPython repository at apt.wxwidgets.org
#
#    deb http://apt.wxwidgets.org/ etch-wx main
#    deb-src http://apt.wxwidgets.org/ etch-wx main
#
# then run (as root or with sudo)
#  apt-get update
#  apt-get install ocaml curl graphviz
#  curl -x ifcache.ujf-grenoble.fr:3128 http://apt.wxwidgets.org/key.asc | sudo apt-key add -
#  apt-get install python-wxgtk2.8 python-wxtools python-wxaddons wx2.8-i18n
#              python-celementtree
#
# Without modifying sources.list, one can simply replace the two last statement
# by  apt-get install wxpython pyopengl

# end of preparation section
###############################################################################

###############################################################################
# begin download and installation section
###############################################################################

# export proxy for Institut Fourier
export http_proxy=ifcache.ujf-grenoble.fr:3128

# create a directory and cd into it
mkdir VeriTools
cd VeriTools

# retrieve tools from Pascal's repository
/usr/bin/wget http://www-verimag.imag.fr/~plafourc/teaching/avispa-package-1.0_Linux-i686.tgz
/usr/bin/wget http://www-verimag.imag.fr/~plafourc/teaching/proverif1.14pl2.tar.gz
/usr/bin/wget http://www-verimag.imag.fr/~plafourc/teaching/scyther-1.0-beta7.tgz

# inflate the archive
tar zxf avispa-package-1.0_Linux-i686.tgz
tar zxf proverif1.14pl2.tar.gz
tar zxf scyther-1.0-beta7.tgz


#
# build Proverif
#
cd proverif1.14pl2
./build
###############################################################################

###############################################################################
# set environment variables and global variables
###############################################################################
#
cd ..
# Proverif
export PATH=$PATH:$PWD/proverif1.14pl2/
#
# for Scyther
#
export PATH=$PATH:$PWD/scyther/
#
# for AVISPA
#
export AVISPA_PACKAGE=$PWD/avispa-1.0/
export PATH=$PATH:$AVISPA_PACKAGE 

