]> Creatis software - creaToolsTools.git/commitdiff
First step of 'all in one' install procedure
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Mon, 10 Jan 2011 17:31:04 +0000 (17:31 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Mon, 10 Jan 2011 17:31:04 +0000 (17:31 +0000)
Linux/menu.sh [new file with mode: 0644]

diff --git a/Linux/menu.sh b/Linux/menu.sh
new file mode 100644 (file)
index 0000000..c889a72
--- /dev/null
@@ -0,0 +1,232 @@
+#!/bin/sh
+
+if [ $UID != 0 ] 
+then
+  echo
+  echo "..ERROR.."
+  echo "==================================================="
+  echo "REMEMBER !"
+  echo ""
+  echo "YOU NEED TO RUN THIS ONE AS root"
+  echo "==================================================="
+  echo
+  echo
+  exit 0
+
+else
+ i=999
+while [ $i != 9 ]
+do
+
+echo
+echo
+echo
+echo "                   MENU"
+echo
+echo " Choose what you want to do :"
+echo  
+echo " Configure :                     0"
+echo " Install Third Party Libraries : 1"
+echo " Compile the CreaTools :         2"
+echo " Install the CreaTools :         3"
+echo
+echo " Exit :                          9"
+echo
+echo
+echo 
+
+echo "Type in your choice :"
+read i
+
+  case $i in
+  0)
+echo
+echo
+  confirm="NO"
+  while [ "$confirm" != "YES" ]
+  do
+  OperatingSystem="XXX"
+  while [[ "$OperatingSystem" != "Linux"  && \
+           "$OperatingSystem" != "Ubuntu" && \
+          "$OperatingSystem" != "MacOS" ]]
+  do
+  echo "Operating System : Linux/Ubuntu/MacOS (mandatory!)"
+  read OperatingSystem
+  done
+  echo "you said : [" $OperatingSystem "]"
+echo
+echo
+  # ------------------
+  
+  
+  # ------------------
+  echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
+  read generationdir
+  if [ "$generationdir" = "" ]
+  then
+     generationdir="/tmp/myGenerationDir"
+  fi
+  echo "you said : [" $generationdir "]"
+echo
+echo
+  # ------------------
+
+  installPrefix="XXX"
+     echo "Install Prefix : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
+     read installPrefix
+  if [ "$installPrefix" = "" ]
+  then
+     installPrefix="/tmp/myGenerationDir/creatools_install"
+  fi
+  echo "you said : [" $installPrefix "]"
+echo
+echo 
+  # ------------------
+
+  docgeneration="XXX"
+  while [[ "$docgeneration" != "YES"  && "$docgeneration" != "NO" ]]
+  do
+  echo "Boolean For Doc Generation : YES/NO (default is NO)"
+  read docgeneration
+  if [ "$docgeneration" = "" ]
+  then
+     docgeneration="NO"
+  fi
+  echo "you said : [" $docgeneration "]"
+  done
+echo
+echo
+  # ------------------
+
+  sourcesFrom="XXX"
+  while [[ "$sourcesFrom" != "CVS"  && "$sourcesFrom" != "HTML" ]]
+  do
+  echo "Where do you want to get source files from : CVS/HTML (default is HTML)"
+  read sourcesFrom
+  if [ "$sourcesFrom" = "" ]
+  then
+     sourcesFrom="HTML"
+  fi
+  echo "you said : [" $sourcesFrom "]"
+  done
+echo
+echo
+  # ------------------
+  
+  cvsUserName=""
+  if [ "$sourcesFrom" = "CVS" ]
+  then
+  while [ "$cvsUserName" == "" ]
+  do
+     echo "CVS User Name (mandatory!)"
+     read cvsUserName
+  done
+  echo "you said : [" $cvsUserName "]"
+  else
+    cvsUserName="cvsUserNameCannotBeEmpty" 
+  fi
+echo
+echo
+  # ------------------
+
+  linuxUserName=""
+  while [ "$linuxUserName" == "" ]
+  do
+     echo "LINUX/MacOS User Name (mandatory!)"
+     read linuxUserName  
+     echo "you said : [" $linuxUserName "]"  
+  done
+echo
+echo
+  # ------------------
+  
+  buildType="XXX"
+  while [[ "$buildType" != "Release"  && "$Debug " != "HTML" ]]
+  do
+  echo "Build type : Release/Debug (default is Release)"
+  read buildType
+  if [ "$buildType" = "" ]
+  then
+     buildType="Release"
+  fi
+  echo "you said : [" $buildType "]"
+  done
+echo
+echo
+  # ------------------
+  
+  gdcmVersion="XXX"
+  while [[ "$gdcmVersion" != "GDCM1"  && "$gdcmVersion " != "GDCM2" ]]
+  do
+  echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
+  read gdcmVersion
+  if [ "$gdcmVersion" = "" ]
+  then
+     gdcmVersion="GDCM1"
+  fi
+  echo "you said : [" $gdcmVersion "]"
+  done
+echo
+echo
+echo
+echo
+echo "You said :"
+echo "           Operating System                           : $OperatingSystem"
+echo "           Name of the Generation Directory           : $generationdir"
+echo "           Install Prefix                             : $installPrefix"
+echo "           Boolean For Doc Generation                 : $docgeneration"
+echo "           Where do you want to get source files from : $sourcesFrom"
+if [ $sourcesFrom = CVS ]
+then
+echo "           CVS User Name                              : $cvsUserName"
+fi
+echo "           LINUX/MacOS User Name                      : $linuxUserName"
+echo "           Build type                                 : $buildType"          
+echo "           Gdcm version                               : $gdcmVersion"
+echo
+echo
+echo "Do you confirm your choices : YES/NO ? (default is NO)"
+read confirm
+done 
+
+configureFile="configure.sh"
+touch  $configureFile
+echo "#!/bin/sh"                         >> $configureFile
+echo "OperatingSystem=$OperatingSystem"  >> $configureFile
+echo "generationdir=$generationdir"      >> $configureFile
+echo "installPrefix= $installPrefix"     >> $configureFile
+echo "docgeneration=$docgeneration"      >> $configureFile
+echo "sourcesFrom=$sourcesFrom"          >> $configureFile
+echo "cvsUserName=$cvsUserName"          >> $configureFile 
+echo "linuxUserName=$linuxUserName"      >> $configureFile
+echo "buildType=$buildType"              >> $configureFile
+echo "gdcmVersion=$gdcmVersion"          >> $configureFile
+
+         
+  # ------------------
+         
+  ;;
+  
+  1)
+ echo "========================== $i Not Yet made"  
+  ;;
+  
+  2)
+ echo "========================== $i Not Yet made"
+  ;;
+  
+  3) 
+  echo "========================= $i Not Yet made"
+  ;;
+  
+  9) 
+  echo exit
+  ;;
+   
+  *)
+  echo "Your answer must be in {0, 1, 2, 3, 9} (was $i)"
+  ;;
+  esac
+
+done
+fi