#!/bin/sh
#
# Script for installing missing extra packages on Debian Testing before install
# of McStas 2.0
#

if [ `cat /etc/debian_version` = "jessie/sid" ]; then

    ARCH=`arch`
    
    if [ $ARCH = "x86_64" ]; then 
	echo Architecture is 64bit
	ARCHDIR="amd64"
    else
	echo Architecture is 32bit
	ARCHDIR = "i386"
    fi
    
    cd $ARCHDIR
    
    echo Installing dependencies from the normal testing distribution
    echo
    apt-get -y install libterm-readkey-perl fftw2 libhdf4-0-alt libproj0 libopengl-perl freeglut3 libopengl-perl libproj0 libqhull5 proj-data
    echo
    echo Installing locally-provided support packages for McStas
    dpkg -i *.deb
    echo
    echo All steps done. To install McStas issue one of these commands:
    echo
    echo   apt-get install mcstas-suite
    echo   apt-get install mcstas-suite-perl
    echo   apt-get install mcstas-suite-python
else
    echo Sorry, your system is not jessie/sid - hence not supported by this script
fi


