]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-GenerateBinTGZ.sh
11b4d5e4a0cb5da2b7ddcde92ad2490423901d02
[creaToolsTools.git] / Linux / scripts / CreaTools-GenerateBinTGZ.sh
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Santé)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 #
7 #  This software is governed by the CeCILL-B license under French law and 
8 #  abiding by the rules of distribution of free software. You can  use, 
9 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
10 #  license as circulated by CEA, CNRS and INRIA at the following URL 
11 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
12 #  or in the file LICENSE.txt.
13 #
14 #  As a counterpart to the access to the source code and  rights to copy,
15 #  modify and redistribute granted by the license, users are provided only
16 #  with a limited warranty  and the software's author,  the holder of the
17 #  economic rights,  and the successive licensors  have only  limited
18 #  liability. 
19 #
20 #  The fact that you are presently reading this means that you have had
21 #  knowledge of the CeCILL-B license and that you accept its terms.
22 # ------------------------------------------------------------------------  
23
24 #!/bin/bash
25
26 # JPR 2/5/2011
27 #if [ $UID = 0 ] 
28 #then
29   # Set all local variables
30   source $PWD/scripts/LocalFunctions.sh
31   source $PWD/scripts/CreaTools-configure.sh
32   if [ -e $generationdir ]
33   then
34
35           cd $generationdir
36           source creatools_install/share/creatools/Version.sh 
37      fileTGZ=CreaTools-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion-`getDistrib`-`getDistribVersion`.tgz
38
39      tar -cvzf $fileTGZ creatools_install thirdparty_install
40           scp $fileTGZ tux.creatis.insa-lyon.fr:creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/$fileTGZ 
41
42           filename_BinVersion=creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh
43
44           echo "##" > $filename_BinVersion
45           echo "## Generated by CreaTools-GeneratedBinTGZ.sh" >> $filename_BinVersion
46           echo "##" >> $filename_BinVersion
47
48           echo "wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/$fileTGZ" >> $filename_BinVersion 
49           echo "tar -xvzf $fileTGZ" >>  $filename_BinVersion
50
51      echo "source creatools_install/share/creatools/LocalFunctions.sh"  >>  $filename_BinVersion
52      echo "ETC_BASHRC=\`getbashrc\`" >>  $filename_BinVersion
53      echo "installPrefix=\$(pwd)/creatools_install #You need this variable in the -barshrc script" >>  $filename_BinVersion
54      echo "installPrefixThird=\$(pwd)/thirdparty_install #You need this variable in the -barshrc script" >>  $filename_BinVersion
55      echo "OperatingSystem=\`getDistrib\`  #You need this variable in the Base-Stuff script" >>  $filename_BinVersion
56
57      echo "cd thirdparty_install/share/creatools/"  >>  $filename_BinVersion
58      echo "source ThirdParty-install-Base-Stuff.sh $OperatingSystem"  >>  $filename_BinVersion
59      echo "cd ../../.."  >>  $filename_BinVersion
60      echo "source thirdparty_install/share/creatools/ThirdParty-bashrc.sh"  >>  $filename_BinVersion
61      echo "source creatools_install/share/creatools/CreaTools-bashrc.sh"  >>  $filename_BinVersion
62      echo "echo  " >>  $filename_BinVersion
63      echo "echo  " >>  $filename_BinVersion
64      echo "echo  " >>  $filename_BinVersion
65      echo "echo  " >>  $filename_BinVersion
66      echo "echo 'Open a new terminal to run creatools.'" >>  $filename_BinVersion
67      echo "echo '(Close this window and continue....)' " >>  $filename_BinVersion
68      echo "echo  " >>  $filename_BinVersion
69      echo "echo  " >>  $filename_BinVersion
70      echo "echo  Install dir:" >>  $filename_BinVersion
71      echo "pwd" >>  $filename_BinVersion
72      echo "echo  " >>  $filename_BinVersion
73      echo "read -p 'Press [Enter] key to continue...'" >>  $filename_BinVersion
74      scp $filename_BinVersion tux.creatis.insa-lyon.fr:creatools/creaTools/. 
75
76      echo ""
77      echo ""
78      echo ""
79      echo "Creation OK:"
80      echo $fileTGZ
81      echo ""
82
83   else
84    echo
85    echo "..ERROR.."
86    echo "==================================================="
87    echo "REMEMBER !"
88    echo ""
89    echo "You MUST run before:"
90    echo "   > ./instalscript config"
91    echo "   > ./instalscript 3rd"
92    echo "   > ./instalscript creatools"
93    echo "==================================================="
94    echo
95    echo 
96    read a
97    exit 0 
98   fi  
99   
100
101