install_kspectrum1.3.bash (1638B)
1 #!/bin/bash 2 FOLDER='kspectrum1.3' 3 ARCHIVE='kspectrum1.3.tgz' 4 5 LOCAL=$('pwd') 6 7 minimum_version=2 8 # Since Chet Ramey is constantly adding features to Bash, 9 # you may set $minimum_version to 2.XX, 3.XX, or whatever is appropriate. 10 E_BAD_VERSION=80 11 12 if [ "$BASH_VERSION" \< "$minimum_version" ] 13 then 14 echo "This script works only with Bash, version $minimum or greater." 15 echo "Upgrade strongly recommended." 16 exit $E_BAD_VERSION 17 fi 18 19 if [ -e $FOLDER ] 20 then 21 echo "Directory already exists:" 22 echo $FOLDER 23 echo "Please erase it and try again" 24 exit 0 25 else 26 if [ ! -f $ARCHIVE ] 27 then 28 echo "$ARCHIVE does not exists in the current directory" 29 echo "installation failed" 30 exit 0 31 else 32 echo "+ Uncompressing file $ARCHIVE..." 33 tar -zxvf ${ARCHIVE} > /dev/null 34 echo "...done" 35 echo "The archive was extracted in: ./"$FOLDER 36 cd $FOLDER/data 37 #ln -s ../includes/formats.inc . 38 #ln -s ../includes/max.inc . 39 40 echo "" 41 echo "+ Compiling program make_composition.exe" 42 ./f0 43 44 if [ ! -f make_composition.exe ] 45 then 46 echo 'Error: make_composition.exe could not be compiled' 47 else 48 echo "" 49 echo "+ Running program make_composition.exe" 50 ./make_composition.exe 51 fi 52 echo "" 53 echo "+ linking files" 54 # ln -s composition_venus.in composition.in 55 # ln -s nu_venus.txt narrowbands.in 56 ./linkLBL.bash 57 58 cd $LOCAL 59 # rm -f ${ARCHIVE} 60 # rm -f install_kspectrum*.bash 61 62 fi 63 fi 64 65 echo "" 66 echo "Use documentation file ./$FOLDER/Doc/manual.pdf if needed" 67 if [ -e $FOLDER/data/HITRAN2004 ]; then 68 echo "LBL databases have been linked" 69 else 70 echo "Do not forget to install LBL databases in the ./$FOLDER/data directory !" 71 fi 72 73 exit 0