From 3b873b40ab4f4cbfd9f951ef93819241d02f97ae Mon Sep 17 00:00:00 2001 From: davila Date: Thu, 8 Jan 2015 15:12:18 +0100 Subject: [PATCH] #2493 creaToolsTools Feature New Normal - Prepare and Install binary CreaTools version - Linux --- Linux/installscript | 2 +- Linux/scripts/CreaTools-GenerateBinTGZ.sh | 70 +++++++++++------------ Linux/scripts/Install-Creatools-Bin.sh | 31 +++++++++- Linux/scripts/LocalFunctions.sh | 7 ++- 4 files changed, 67 insertions(+), 43 deletions(-) diff --git a/Linux/installscript b/Linux/installscript index 5f49a6b..3a754ee 100755 --- a/Linux/installscript +++ b/Linux/installscript @@ -153,7 +153,7 @@ if [ `checkVal $command config all` == false ] ; then exit fi source $configureFile - if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ] ; then + if [ ! -f $installPrefixThird/share/creatools/creatools_third_party_library_config.sh ] ; then echo WARNING echo "the curently used Third Party libraries are NOT in $installPrefixThird but ... in :" grep "installPrefixThird=" $ETC_BASHRC diff --git a/Linux/scripts/CreaTools-GenerateBinTGZ.sh b/Linux/scripts/CreaTools-GenerateBinTGZ.sh index eb101ad..80760b8 100644 --- a/Linux/scripts/CreaTools-GenerateBinTGZ.sh +++ b/Linux/scripts/CreaTools-GenerateBinTGZ.sh @@ -21,7 +21,6 @@ # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ - #!/bin/bash # JPR 2/5/2011 @@ -37,42 +36,39 @@ source creatools_install/share/creatools/Version.sh fileTGZ=CreaTools-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion-`getDistrib`-`getDistribVersion`.tgz - tar -cvzf $fileTGZ creatools_install thirdparty_install - - scp $fileTGZ tux.creatis.insa-lyon.fr:creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/$fileTGZ - - echo "##" > creatools-Linux-BinVersion.sh - echo "## Generated by CreaTools-GeneratedBinTGZ.sh" >> creatools-Linux-BinVersion.sh - echo "##" >> creatools-Linux-BinVersion.sh - - echo "wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/$fileTGZ" >> creatools-Linux-BinVersion.sh - echo "tar -xvzf $fileTGZ" >> creatools-Linux-BinVersion.sh - - - echo "source creatools_install/share/creatools/LocalFunctions.sh" >> creatools-Linux-BinVersion.sh - echo "ETC_BASHRC=\`getbashrc\`" >> creatools-Linux-BinVersion.sh - echo "installPrefix=\$(pwd)/creatools_install #You need this variable in the -barshrc script" >> creatools-Linux-BinVersion.sh - echo "installPrefixThird=\$(pwd)/thirdparty_install #You need this variable in the -barshrc script" >> creatools-Linux-BinVersion.sh - echo "OperatingSystem=\`getDistrib\` #You need this variable in the Base-Stuff script" >> creatools-Linux-BinVersion.sh - - - echo "cd thirdparty_install/share/creatools/" >> creatools-Linux-BinVersion.sh - echo "source ThirdParty-install-Base-Stuff.sh $OperatingSystem" >> creatools-Linux-BinVersion.sh - echo "cd ../../.." >> creatools-Linux-BinVersion.sh - echo "source thirdparty_install/share/creatools/ThirdParty-bashrc.sh" >> creatools-Linux-BinVersion.sh - echo "source creatools_install/share/creatools/CreaTools-bashrc.sh" >> creatools-Linux-BinVersion.sh - echo "echo " >> creatools-Linux-BinVersion.sh - echo "echo " >> creatools-Linux-BinVersion.sh - echo "echo " >> creatools-Linux-BinVersion.sh - echo "echo " >> creatools-Linux-BinVersion.sh - echo "echo 'Open a new terminal to run creatools.'" >> creatools-Linux-BinVersion.sh - echo "echo '(Close this window and continue....)' " >> creatools-Linux-BinVersion.sh - echo "echo " >> creatools-Linux-BinVersion.sh - echo "echo " >> creatools-Linux-BinVersion.sh - echo "read -p 'Press [Enter] key to continue...'" >> creatools-Linux-BinVersion.sh - - - scp creatools-Linux-BinVersion.sh tux.creatis.insa-lyon.fr:creatools/creaTools/. +##EED tar -cvzf $fileTGZ creatools_install thirdparty_install +##EED scp $fileTGZ tux.creatis.insa-lyon.fr:creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/$fileTGZ + + filename_BinVersion=creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh + + echo "##" > $filename_BinVersion + echo "## Generated by CreaTools-GeneratedBinTGZ.sh" >> $filename_BinVersion + echo "##" >> $filename_BinVersion + + echo "wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/$fileTGZ" >> $filename_BinVersion + echo "tar -xvzf $fileTGZ" >> $filename_BinVersion + + echo "source creatools_install/share/creatools/LocalFunctions.sh" >> $filename_BinVersion + echo "ETC_BASHRC=\`getbashrc\`" >> $filename_BinVersion + echo "installPrefix=\$(pwd)/creatools_install #You need this variable in the -barshrc script" >> $filename_BinVersion + echo "installPrefixThird=\$(pwd)/thirdparty_install #You need this variable in the -barshrc script" >> $filename_BinVersion + echo "OperatingSystem=\`getDistrib\` #You need this variable in the Base-Stuff script" >> $filename_BinVersion + + echo "cd thirdparty_install/share/creatools/" >> $filename_BinVersion + echo "source ThirdParty-install-Base-Stuff.sh $OperatingSystem" >> $filename_BinVersion + echo "cd ../../.." >> $filename_BinVersion + echo "source thirdparty_install/share/creatools/ThirdParty-bashrc.sh" >> $filename_BinVersion + echo "source creatools_install/share/creatools/CreaTools-bashrc.sh" >> $filename_BinVersion + echo "echo " >> $filename_BinVersion + echo "echo " >> $filename_BinVersion + echo "echo " >> $filename_BinVersion + echo "echo " >> $filename_BinVersion + echo "echo 'Open a new terminal to run creatools.'" >> $filename_BinVersion + echo "echo '(Close this window and continue....)' " >> $filename_BinVersion + echo "echo " >> $filename_BinVersion + echo "echo " >> $filename_BinVersion + echo "read -p 'Press [Enter] key to continue...'" >> $filename_BinVersion + scp $filename_BinVersion tux.creatis.insa-lyon.fr:creatools/creaTools/. echo "" echo "" diff --git a/Linux/scripts/Install-Creatools-Bin.sh b/Linux/scripts/Install-Creatools-Bin.sh index 38040b1..9c00c6d 100755 --- a/Linux/scripts/Install-Creatools-Bin.sh +++ b/Linux/scripts/Install-Creatools-Bin.sh @@ -24,10 +24,37 @@ #!/bin/bash + + +########################################### +function getDistrib { + local OS=`uname` + + if [ "$OS" == Darwin ] ; then OS=MacOS; + elif [ "$OS" == Linux ] ; then OS=`awk 'NR==1{print $1}' /etc/issue` + else OS="" + fi +# checkDistrib $OS + echo $OS +} + +########################################### +function getDistribVersion { + local DISTRIB=`getDistrib` + + if [ "$DISTRIB" == MacOS ] ; then OSVesion=VOID_Darwin_EED; + elif [ "$DISTRIB" == Fedora ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue` + elif [ "$DISTRIB" == Ubuntu ] ; then OSVersion=`awk 'NR==1{print $2}' /etc/issue` + else OSVersion="VOID_EED" + fi + echo $OSVersion +} + + rm -rf Creatools mkdir Creatools cd Creatools -wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/creatools-Linux-BinVersion.sh -source creatools-Linux-BinVersion.sh +wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh +source creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh cd .. diff --git a/Linux/scripts/LocalFunctions.sh b/Linux/scripts/LocalFunctions.sh index 8d61359..c84fca4 100644 --- a/Linux/scripts/LocalFunctions.sh +++ b/Linux/scripts/LocalFunctions.sh @@ -72,10 +72,11 @@ function getDistrib { ########################################### function getDistribVersion { - local OS=`uname` + local DISTRIB=`getDistrib` - if [ "$OS" == Darwin ] ; then OSVesion=VOID_Darwin_EED; - elif [ "$OS" == Linux ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue` + if [ "$DISTRIB" == MacOS ] ; then OSVesion=VOID_Darwin_EED; + elif [ "$DISTRIB" == Fedora ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue` + elif [ "$DISTRIB" == Ubuntu ] ; then OSVersion=`awk 'NR==1{print $2}' /etc/issue` else OSVersion="VOID_EED" fi echo $OSVersion -- 2.47.1