]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-GenerateBinTGZ.sh
#3446 vtk8itk5wx3-macos in Linux
[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 #--------Active SSH agent to the next operations---------------------------------------------------------
41         echo "Active SSH agent to copy files to the Cluster:"
42         ssh-add 
43
44
45 #--------CreaTools-Bin  for Package developers---------------------------------------------------------
46
47         echo generationdir:
48         echo $generationdir
49         cd $generationdir
50         mkdir GenerateBinTGZ
51     cd GenerateBinTGZ
52
53         ln -s $installPrefix creatools_install
54         ln -s $installPrefixThird thirdparty_install
55
56         source creatools_install/share/creatools/Version.sh 
57 #       distanceAdress=davila@tux.creatis.insa-lyon.fr:creatools/creaTools/v$creatoolsMajorVersion.$creatoolsMinorVersion.x/
58         distanceAdress=davila@tux.creatis.insa-lyon.fr:creatools/creaTools/v$creatoolsMajorVersion.x.x/
59         fileTGZ=CreaTools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion-`getDistrib`-`getDistribVersion`.tgz
60         fileTGZstring=CreaTools-Bin-Release-\$creatoolsMajorVersion.\$creatoolsMinorVersion.\$creatoolsBuildVersion-\`getDistrib\`-\`getDistribVersion\`
61         tar -cvzf $fileTGZ creatools_install/* thirdparty_install/*
62         scp $fileTGZ $distanceAdress/$fileTGZ 
63
64
65 #--------CreaTools-Final_User---------------------------------------------------------
66
67         creatoolsTPLaux=creatoolsTPLaux
68         rm -rf $creatoolsTPLaux
69         mkdir $creatoolsTPLaux
70         cd $creatoolsTPLaux
71         mkdir bin
72         mkdir lib64
73         mkdir share
74         mkdir share/creatools
75         echo "export PATH=\$PATH:\$1/bin" > share/creatools/creatools_TPLaux_config.sh
76         echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$1/lib64" >> share/creatools/creatools_TPLaux_config.sh
77         cp $scriptDir/TPLaux-bashrc.sh share/creatools/TPLaux-bashrc.sh
78         cd lib64
79
80 # Fedora 31 
81         if [ `getDistribVersion` == 31 ] ; then 
82                 cp /usr/lib64/libwx*-3.0.so.0 .
83                 cp /usr/lib64/libboost_*.so.1.69.0 .
84                 cp /usr/lib64/libm.so.6 .
85                 cp /usr/lib64/libstdc++.so.6 .
86                 cp /usr/lib64/libSDL2-2.0.so.0 .
87                 cp /usr/lib64/libmspack.so.0 .
88                 cp /usr/lib64/libjpeg.so.62 .
89                 cp /usr/lib64/libicudata.so.63 .
90                 cp /usr/lib64/libicui18n.so.63 .
91                 cp /usr/lib64/libicuuc.so.63 .
92         fi
93
94 # Fedora 28
95         if [ `getDistribVersion` == 28 ] ; then 
96                 cp /usr/lib64/libwx*-3.0.so.0 .
97                 cp /usr/lib64/libboost_*.so.1.66.0 .
98                 cp /usr/lib64/libjpeg.so.62 .
99                 cp /usr/lib64/libSDL2-2.0.so.0 .
100                 cp /usr/lib64/libmspack.so.0 .
101                 cp /usr/lib64/libmspack.so.0 .
102                 cp /usr/lib64/libicudata.so.60 .
103                 cp /usr/lib64/libicui18n.so.60 . 
104                 cp /usr/lib64/libicuuc.so.60 . 
105                 ## For Fedora 32
106                 cp /usr/lib64/libGLU.so.1 . 
107         fi
108
109         cd ../..
110         fileTGZaux=$creatoolsTPLaux-`getDistrib`-`getDistribVersion`.tgz
111         rm -rf $fileTGZaux
112         tar -cvzf $fileTGZaux $creatoolsTPLaux
113         scp $fileTGZaux $distanceAdress/$fileTGZaux
114
115
116         fileTGZf28=CreaTools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion-Fedora-28.tgz
117         fileTGZauxf28=$creatoolsTPLaux-Fedora-28.tgz
118
119         
120 #--------Script de Instalation :  creatools-Linux-Bin-x.x.x.sh   --------------------------------------------------------
121
122
123         filename_BinVersion=creatools-Linux-Bin-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh
124
125           echo "##" > $filename_BinVersion
126           echo "## Generated by CreaTools-GeneratedBinTGZ.sh" >> $filename_BinVersion
127           echo "##" >> $filename_BinVersion
128
129           cat creatools_install/share/creatools/Version.sh >> $filename_BinVersion
130           cat $scriptDir/LocalFunctions.sh >> $filename_BinVersion
131
132      echo "ETC_BASHRC=\`getbashrc\`" >>  $filename_BinVersion
133
134
135           echo "if [ \"\$1\" = \"FinalUser\" ] ; then" >> $filename_BinVersion
136           echo "   \`getDownloadCommand\` http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/v\$creatoolsMajorVersion.x.x/$fileTGZf28" >> $filename_BinVersion 
137           echo "   tar -xvzf $fileTGZf28" >>  $filename_BinVersion
138           echo "   rm -f $fileTGZf28" >>  $filename_BinVersion
139           echo "   \`getDownloadCommand\` http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/v\$creatoolsMajorVersion.x.x/$fileTGZauxf28" >> $filename_BinVersion 
140           echo "   tar -xvzf $fileTGZauxf28" >>  $filename_BinVersion
141           echo "   rm -f $fileTGZauxf28" >>  $filename_BinVersion
142       echo "   installPrefixTPLaux=\$(pwd)/creatoolsTPLaux #You need this variable in the -barshrc script" >>  $filename_BinVersion
143       echo "   source creatoolsTPLaux/share/creatools/TPLaux-bashrc.sh"  >>  $filename_BinVersion
144
145           echo "else" >> $filename_BinVersion
146           echo "   \`getDownloadCommand\` http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/v\$creatoolsMajorVersion.x.x/$fileTGZstring.tgz" >> $filename_BinVersion 
147           echo "   tar -xvzf $fileTGZstring.tgz" >>  $filename_BinVersion
148           echo "   rm -f $fileTGZstring.tgz" >>  $filename_BinVersion
149       echo "   OperatingSystem=\`getDistrib\`  #You need this variable in the Base-Stuff script" >>  $filename_BinVersion
150       echo "   cd thirdparty_install/share/creatools/"  >>  $filename_BinVersion
151       echo "   source ThirdParty-install-Base-Stuff.sh \$OperatingSystem"  >>  $filename_BinVersion
152       echo "   cd ../../.."  >>  $filename_BinVersion
153           echo "fi" >> $filename_BinVersion
154          
155
156 #EED     echo "source creatools_install/share/creatools/LocalFunctions.sh"  >>  $filename_BinVersion
157      echo "installPrefix=\$(pwd)/creatools_install #You need this variable in the -barshrc script" >>  $filename_BinVersion
158      echo "installPrefixThird=\$(pwd)/thirdparty_install #You need this variable in the -barshrc script" >>  $filename_BinVersion
159      echo "source thirdparty_install/share/creatools/ThirdParty-bashrc.sh"  >>  $filename_BinVersion
160      echo "source creatools_install/share/creatools/CreaTools-bashrc.sh"  >>  $filename_BinVersion
161      echo "echo $fileTGZstring >> Creatools-Bin-Version.txt " >>  $filename_BinVersion
162
163      echo "echo  " >>  $filename_BinVersion
164      echo "echo  " >>  $filename_BinVersion
165      echo "echo  " >>  $filename_BinVersion
166      echo "echo  " >>  $filename_BinVersion
167      echo "echo 'Open a new terminal to run creatools.'" >>  $filename_BinVersion
168      echo "echo '(Close this window and continue....)' " >>  $filename_BinVersion
169      echo "echo  " >>  $filename_BinVersion
170      echo "echo  " >>  $filename_BinVersion
171      echo "echo  Install dir:" >>  $filename_BinVersion
172      echo "pwd"    >>  $filename_BinVersion
173      echo "echo  " >>  $filename_BinVersion
174      echo "read -p 'Press [Enter] key to continue...'" >>  $filename_BinVersion
175      scp $filename_BinVersion $distanceAdress/. 
176      rm creatools_install
177      rm thirdparty_install
178
179
180 #-----------------------------------------------------------------
181
182          cat $scriptDir/Install-Creatools-Bin.sh-downloadTool $scriptDir/Install-Creatools-Bin.sh > Install-Creatools-Bin-tmp.sh
183 ##       cat $scriptDir/Install-Creatools-Bin.sh-downloadTool $scriptDir/Install-Creatools-Final_User.sh > Install-Creatools-Final_User-tmp.sh
184
185      scp Install-Creatools-Bin-tmp.sh $distanceAdress/Install-Creatools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh       
186  ##    scp Install-Creatools-Final_User-tmp.sh $distanceAdress/Install-Creatools-Final_User-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh       
187
188          ssh davila@tux.creatis.insa-lyon.fr "cd creatools/creaTools;rm Install-Creatools-Bin-Release.sh;  ln -s v4.x.x/Install-Creatools-Bin-Release-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh  Install-Creatools-Bin-Release.sh"
189          ssh davila@tux.creatis.insa-lyon.fr "cd creatools/creaTools;rm creatools-Linux-Bin.sh;  ln -s v4.x.x/$filename_BinVersion  creatools-Linux-Bin.sh"
190
191 ##       ssh davila@tux.creatis.insa-lyon.fr "cd creatools/creaTools;rm Install-Creatools-Final_User.sh;  ln -s v4.x.x/Install-Creatools-Final_User-$creatoolsMajorVersion.$creatoolsMinorVersion.$creatoolsBuildVersion.sh  Install-Creatools-Final_User.sh"
192
193
194      echo ""
195      echo ""
196      echo ""
197      echo "Creation OK:"
198      echo $fileTGZ
199      echo ""
200      echo $PWD
201         
202   else
203    echo
204    echo "..ERROR.."
205    echo "==================================================="
206    echo "REMEMBER !"
207    echo ""
208    echo "You MUST run before:"
209    echo "   > ./instalscript config"
210    echo "   > ./instalscript 3rd"
211    echo "   > ./instalscript creatools"
212    echo "==================================================="
213    echo
214    echo 
215    read a
216    exit 0 
217   fi  
218   
219
220