From e427258ed12d1a98f7d8ab680db9ee258b09d857 Mon Sep 17 00:00:00 2001 From: davila Date: Sat, 7 Feb 2015 00:58:30 +0100 Subject: [PATCH] #2493 creaToolsTools Feature New Normal - Prepare and Install binary CreaTools version - Linux --- Linux/scripts/CreaTools-GenerateBinTGZ.sh | 53 +++++++++++++++----- Linux/scripts/Install-Creatools-Bin.sh | 45 ++++++++++------- Linux/scripts/ThirdParty-install-Base-rpm.sh | 3 ++ 3 files changed, 70 insertions(+), 31 deletions(-) diff --git a/Linux/scripts/CreaTools-GenerateBinTGZ.sh b/Linux/scripts/CreaTools-GenerateBinTGZ.sh index f63e69a..5c77067 100644 --- a/Linux/scripts/CreaTools-GenerateBinTGZ.sh +++ b/Linux/scripts/CreaTools-GenerateBinTGZ.sh @@ -27,38 +27,57 @@ #if [ $UID = 0 ] #then # Set all local variables - source $PWD/scripts/LocalFunctions.sh - source $PWD/scripts/CreaTools-configure.sh + scriptDir=`pwd`/scripts +## cd $scriptsDir + source scripts/LocalFunctions.sh +## cd $scriptsDir + source scripts/CreaTools-configure.sh + + if [ -e $generationdir ] then cd $generationdir source creatools_install/share/creatools/Version.sh - fileTGZ=CreaTools-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion-`getDistrib`-`getDistribVersion`.tgz + distanceAdress=davila@tux.creatis.insa-lyon.fr:creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/ +echo distanceAdress: +echo $distanceAdress + + fileTGZ=CreaTools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion-`getDistrib`-`getDistribVersion`.tgz + fileTGZstring=CreaTools-Bin-Release-\$creatoolsMajorVersion.\$creatoolsMinorVersion.\$creatoolsBuildVersion-\`getDistrib\`-\`getDistribVersion\` - tar -cvzf $fileTGZ creatools_install thirdparty_install - scp $fileTGZ davila@tux.creatis.insa-lyon.fr:creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/$fileTGZ + ##EED tar -cvzf $fileTGZ creatools_install thirdparty_install +##EED scp $fileTGZ $distanceAdress/$fileTGZ - filename_BinVersion=creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh + filename_BinVersion=creatools-Linux-Bin-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.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 + cat creatools_install/share/creatools/Version.sh >> $filename_BinVersion + cat creatools_install/share/creatools/LocalFunctions.sh >> $filename_BinVersion - echo "source creatools_install/share/creatools/LocalFunctions.sh" >> $filename_BinVersion + echo "aria2c -x 16 http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/v\$creatoolsMajorVersion.\$creatoolsMinorVersion.x/$fileTGZstring.tgz" >> $filename_BinVersion + echo "tar -xvzf $fileTGZstring.tgz" >> $filename_BinVersion + echo "rm -f $fileTGZstring.tgz" >> $filename_BinVersion + + +#EED 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 "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 $fileTGZstring >> Creatools-Bin-Version.txt " >> $filename_BinVersion + echo "echo " >> $filename_BinVersion echo "echo " >> $filename_BinVersion echo "echo " >> $filename_BinVersion @@ -68,10 +87,17 @@ echo "echo " >> $filename_BinVersion echo "echo " >> $filename_BinVersion echo "echo Install dir:" >> $filename_BinVersion - echo "pwd" >> $filename_BinVersion + echo "pwd" >> $filename_BinVersion echo "echo " >> $filename_BinVersion echo "read -p 'Press [Enter] key to continue...'" >> $filename_BinVersion - scp $filename_BinVersion davila@tux.creatis.insa-lyon.fr:creatools/creaTools/. + scp $filename_BinVersion $distanceAdress/. + + cd $scriptsDir + scp $scriptDir/Install-Creatools-Bin.sh $distanceAdress/Install-Creatools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh + + ssh davila@tux.creatis.insa-lyon.fr "cd creatools/creaTools;rm Install-Creatools-Bin-Release.sh; ln -s v2.6.x/Install-Creatools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh Install-Creatools-Bin-Release.sh" + + ssh davila@tux.creatis.insa-lyon.fr "cd creatools/creaTools;rm $filename_BinVersion; ln -s v2.6.x/$filename_BinVersion creatools-Linux-Bin.sh" echo "" echo "" @@ -79,7 +105,8 @@ echo "Creation OK:" echo $fileTGZ echo "" - + echo $PWD + else echo echo "..ERROR.." diff --git a/Linux/scripts/Install-Creatools-Bin.sh b/Linux/scripts/Install-Creatools-Bin.sh index 8d9e4ee..6fc6311 100755 --- a/Linux/scripts/Install-Creatools-Bin.sh +++ b/Linux/scripts/Install-Creatools-Bin.sh @@ -21,10 +21,7 @@ # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ - -#!/bin/bash - - +#!/bin/bash -e ########################################### function getDistrib { @@ -38,26 +35,38 @@ function getDistrib { 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 -} +OperatingSystem=`getDistrib` -CREATOOLSBINDIR=Creatools-Bin-`getDistrib`-`getDistribVersion` + case "$OperatingSystem" in + Mandriva) + echo Root password: + su -c "urpmi aria2" + ;; + Fedora) + echo Root password: + su -c "yum install aria2 -y" + ;; + Ubuntu) + echo Root password: + su -c "apt-get --yes install aria2" + ;; + MacOS) + port install aria2 -y + ;; + *) + echo " '$OperatingSystem' : Unknown (for us...) Operating Sytem " + echo " Allowed values are (right now) Fedora, Ubuntu, MacOS " +// exit 0 + ;; + esac +CREATOOLSBINDIR=Creatools-Bin rm -rf $CREATOOLSBINDIR mkdir $CREATOOLSBINDIR cd $CREATOOLSBINDIR -wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh -source creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh +aria2c http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/creatools-Linux-Bin.sh +source creatools-Linux-Bin.sh cd .. - diff --git a/Linux/scripts/ThirdParty-install-Base-rpm.sh b/Linux/scripts/ThirdParty-install-Base-rpm.sh index 1ab88ab..141db32 100644 --- a/Linux/scripts/ThirdParty-install-Base-rpm.sh +++ b/Linux/scripts/ThirdParty-install-Base-rpm.sh @@ -35,6 +35,7 @@ then # ///\TODO what about SuSE? Debian? Mandriva? Gentoo? case "$OperatingSystem" in Mandriva) + urpmi aria2 urpmi cmake urpmi cmake-qtgui urpmi doxygen @@ -62,6 +63,7 @@ then ;; Fedora) + yum install aria2 -y yum install wget -y yum install unzip -y yum install cmake -y @@ -84,6 +86,7 @@ then ;; Ubuntu) + apt-get --yes install aria2 apt-get --yes install build-essential # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc. apt-get --yes install git apt-get --yes install cmake -- 2.47.1