]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-install.sh
2411 creaToolsTools Feature New Normal Add creaVtk Library in Linux version
[creaToolsTools.git] / Linux / scripts / CreaTools-install.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
25 #!/bin/bash
26
27 # JPR 2/5/2011
28 #if [ $UID = 0 ] 
29 #then
30   # Set all local variables
31   source $PWD/scripts/CreaTools-configure.sh
32   source $PWD/scripts/CreaTools-names.sh
33  
34   if [ -e $generationdir ]
35   then
36      if [ ! -e $generationdir/creatools_install ]
37      then
38         mkdir $generationdir/creatools_install
39      fi
40   else
41    echo
42    echo "..ERROR.."
43    echo "==================================================="
44    echo "REMEMBER !"
45    echo ""
46    echo "You MUST load the Creatools sources before (use 2.2)!"
47    echo "==================================================="
48    echo
49    echo 
50    read a
51    exit 0 
52   fi  
53   
54   cd $scriptDir
55
56   #create creatools_base_library_config.sh  at the very begining, so we can write "export xxx_BIN=..." inside installmod.sh. JPRx 3 mars 2011
57
58   if [ -f $installPrefix/share/creatools_base_library_config.sh ]
59   then
60      rm        $installPrefix/share/creatools_base_library_config.sh
61   fi
62   touch     $installPrefix/share/creatools_base_library_config.sh
63   chmod 755 $installPrefix/share/creatools_base_library_config.sh
64   
65   echo export PATH='$'PATH:$installPrefix/bin                                   >> $installPrefix/share/creatools_base_library_config.sh
66   if [ $OperatingSystem = "MacOS" ]
67   then
68      echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$installPrefix/lib/creatools   >> $installPrefix/share/creatools_base_library_config.sh
69   else
70      echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools   >> $installPrefix/share/creatools_base_library_config.sh
71      echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
72   fi
73
74   # Install creatools as user (no longer as root) // JPR 2/5/2011
75
76   # - remove line 'bash $installPrefix/creatools_install/share/creatools_base_library_config.sh' if any
77   sed -i -e '/.*creatools_base_library_config.*/ d' $ETC_BASHRC
78   sed -i -e '/installPrefixtmp*/ d' $ETC_BASHRC
79   
80   # JPR 2/5/2011
81   #  modify /etc/bashrc (we cannot modify .bashrc, since we switched as root)  
82   # - add line 'bash $installPrefix/creatools_install/share/creatools_base_library_config.sh'
83
84   bash installmod.sh $buildType $creasource                   $generationdir  $installPrefix
85   bash installmod.sh $buildType $bbtksource                   $generationdir  $installPrefix
86   bash installmod.sh $buildType $creavtksource                $generationdir  $installPrefix
87   bash installmod.sh $buildType $creamaracassource            $generationdir  $installPrefix
88   bash installmod.sh $buildType $creaenvironmentsource        $generationdir  $installPrefix
89   bash installmod.sh $buildType $creabrukersource             $generationdir  $installPrefix
90   bash installmod.sh $buildType $creaimagesource              $generationdir  $installPrefix
91   bash installmod.sh $buildType $creacontourssource           $generationdir  $installPrefix
92   bash installmod.sh $buildType $crearigidregistrationssource $generationdir  $installPrefix
93   bash installmod.sh $buildType $bbtkgeditorsource            $generationdir  $installPrefix
94   bash installmod.sh $buildType $creatoolssource              $generationdir  $installPrefix
95   bash installmod.sh $buildType $creaminitoolssource          $generationdir  $installPrefix
96   # bash installmod.sh $buildType $libidosource                 $generationdir  $installPrefix 
97
98   #export as well bbPackages_DIR // JPR 25 Mai 2011
99
100   bash installmodNomake.sh $buildType appli              $generationdir  $installPrefix
101   bash installmodNomake.sh $buildType creaMiniToolsBase  $generationdir  $installPrefix
102   bash installmodNomake.sh $buildType demo               $generationdir  $installPrefix
103   bash installmodNomake.sh $buildType gdcmvtk            $generationdir  $installPrefix
104   bash installmodNomake.sh $buildType itk                $generationdir  $installPrefix
105   bash installmodNomake.sh $buildType itkvtk             $generationdir  $installPrefix
106   bash installmodNomake.sh $buildType qt                 $generationdir  $installPrefix
107   bash installmodNomake.sh $buildType std                $generationdir  $installPrefix
108   bash installmodNomake.sh $buildType toolsbbtk          $generationdir  $installPrefix
109   bash installmodNomake.sh $buildType vtk                $generationdir  $installPrefix
110   bash installmodNomake.sh $buildType wx                 $generationdir  $installPrefix
111   bash installmodNomake.sh $buildType wxvtk              $generationdir  $installPrefix
112
113 #EED  I don't know why this works here and not after the chmod 755
114 echo export PATH='$'PATH:$installPrefix/bin                                   >> $installPrefix/share/creatools_base_library_config.sh
115 if [ $OperatingSystem = "MacOS" ]
116 then
117   echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$installPrefix/lib/creatools   >> $installPrefix/share/creatools_base_library_config.sh
118 else
119   echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools   >> $installPrefix/share/creatools_base_library_config.sh
120   echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
121 fi
122
123 echo "===================================================in CreaTools-install.sh ETC_BASHRC : "  $ETC_BASHRC 
124 echo installPrefixtmp=$installPrefix >> $ETC_BASHRC
125 echo '[ -f "$installPrefixtmp/share/creatools_base_library_config.sh" ] &&  source $installPrefixtmp/share/creatools_base_library_config.sh' >> $ETC_BASHRC 
126
127 source $installPrefix/share/creatools_base_library_config.sh
128 echo "==================================================="
129 echo " Regenerate Package doc"
130 $installPrefix/bin/bbRegeneratePackageDoc -a -q
131 echo " Regenerate Boxes list"
132 $installPrefix/bin/bbRegenerateBoxesLists -q
133 echo "==================================================="
134
135   # JPR 2/5/2011
136 #else
137 #  echo
138 #  echo "..ERROR.."
139 #  echo "==================================================="
140 #  echo "REMEMBER !"
141 #  echo ""
142 #  echo "YOU NEED TO RUN THIS ONE AS root"
143 #  echo "==================================================="
144 #  echo
145 #  echo
146 #fi 
147