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