# knowledge of the CeCILL-B license and that you accept its terms.
# ------------------------------------------------------------------------
-
#!/bin/bash
# JPR 2/5/2011
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 ""
#!/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 ..