]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-GenerateBinTGZ.sh
0c6a1a7692cb65dc65f4d08dac0e3b34be4b54eb
[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   scriptDir=`pwd`/scripts
31 ##  cd $scriptsDir
32   source scripts/LocalFunctions.sh
33 ##  cd $scriptsDir
34   source scripts/CreaTools-configure.sh
35
36
37   if [ -e $generationdir ]
38   then
39
40         echo generationdir:
41         echo $generationdir
42         cd $generationdir
43         mkdir GenerateBinTGZ
44     cd GenerateBinTGZ
45
46         ln -s $installPrefix creatools_install
47         ln -s $installPrefixThird thirdparty_install
48
49         source creatools_install/share/creatools/Version.sh 
50         distanceAdress=davila@tux.creatis.insa-lyon.fr:creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/
51
52         fileTGZ=CreaTools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion-`getDistrib`-`getDistribVersion`.tgz
53         fileTGZstring=CreaTools-Bin-Release-\$creatoolsMajorVersion.\$creatoolsMinorVersion.\$creatoolsBuildVersion-\`getDistrib\`-\`getDistribVersion\`
54
55      tar -cvzf $fileTGZ creatools_install/* thirdparty_install/*
56
57
58           scp $fileTGZ $distanceAdress/$fileTGZ 
59
60           filename_BinVersion=creatools-Linux-Bin-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh
61
62           echo "##" > $filename_BinVersion
63           echo "## Generated by CreaTools-GeneratedBinTGZ.sh" >> $filename_BinVersion
64           echo "##" >> $filename_BinVersion
65
66           cat creatools_install/share/creatools/Version.sh >> $filename_BinVersion
67           cat $scriptDir/LocalFunctions.sh >> $filename_BinVersion
68
69           echo "\`getDownloadCommand\` http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/v\$creatoolsMajorVersion.\$creatoolsMinorVersion.x/$fileTGZstring.tgz" >> $filename_BinVersion 
70           echo "tar -xvzf $fileTGZstring.tgz" >>  $filename_BinVersion
71           echo "rm -f $fileTGZstring.tgz" >>  $filename_BinVersion
72          
73
74 #EED     echo "source creatools_install/share/creatools/LocalFunctions.sh"  >>  $filename_BinVersion
75      echo "ETC_BASHRC=\`getbashrc\`" >>  $filename_BinVersion
76      echo "installPrefix=\$(pwd)/creatools_install #You need this variable in the -barshrc script" >>  $filename_BinVersion
77      echo "installPrefixThird=\$(pwd)/thirdparty_install #You need this variable in the -barshrc script" >>  $filename_BinVersion
78      echo "OperatingSystem=\`getDistrib\`  #You need this variable in the Base-Stuff script" >>  $filename_BinVersion
79
80      echo "cd thirdparty_install/share/creatools/"  >>  $filename_BinVersion
81      echo "source ThirdParty-install-Base-Stuff.sh \$OperatingSystem"  >>  $filename_BinVersion
82      echo "cd ../../.."  >>  $filename_BinVersion
83
84      echo "source thirdparty_install/share/creatools/ThirdParty-bashrc.sh"  >>  $filename_BinVersion
85      echo "source creatools_install/share/creatools/CreaTools-bashrc.sh"  >>  $filename_BinVersion
86
87      echo "echo $fileTGZstring >> Creatools-Bin-Version.txt " >>  $filename_BinVersion
88
89      echo "echo  " >>  $filename_BinVersion
90      echo "echo  " >>  $filename_BinVersion
91      echo "echo  " >>  $filename_BinVersion
92      echo "echo  " >>  $filename_BinVersion
93      echo "echo 'Open a new terminal to run creatools.'" >>  $filename_BinVersion
94      echo "echo '(Close this window and continue....)' " >>  $filename_BinVersion
95      echo "echo  " >>  $filename_BinVersion
96      echo "echo  " >>  $filename_BinVersion
97      echo "echo  Install dir:" >>  $filename_BinVersion
98      echo "pwd"    >>  $filename_BinVersion
99      echo "echo  " >>  $filename_BinVersion
100      echo "read -p 'Press [Enter] key to continue...'" >>  $filename_BinVersion
101      scp $filename_BinVersion $distanceAdress/. 
102
103      cd $scriptsDir
104      scp $scriptDir/Install-Creatools-Bin.sh $distanceAdress/Install-Creatools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh
105           
106           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"
107
108           ssh davila@tux.creatis.insa-lyon.fr "cd creatools/creaTools;rm creatools-Linux-Bin.sh;  ln -s v2.6.x/$filename_BinVersion  creatools-Linux-Bin.sh"
109
110       rm creatools_install
111       rm thirdparty_install
112
113
114      echo ""
115      echo ""
116      echo ""
117      echo "Creation OK:"
118      echo $fileTGZ
119      echo ""
120      echo $PWD
121         
122   else
123    echo
124    echo "..ERROR.."
125    echo "==================================================="
126    echo "REMEMBER !"
127    echo ""
128    echo "You MUST run before:"
129    echo "   > ./instalscript config"
130    echo "   > ./instalscript 3rd"
131    echo "   > ./instalscript creatools"
132    echo "==================================================="
133    echo
134    echo 
135    read a
136    exit 0 
137   fi  
138   
139
140