From f513924db3c927ac3c0e765731487572f25fcf1c Mon Sep 17 00:00:00 2001 From: davila Date: Wed, 24 Dec 2014 15:55:52 +0100 Subject: [PATCH] #2493 creaToolsTools Feature New Normal - Prepare and Install binary CreaTools version - Linux --- Linux/installscript | 7 ++- Linux/scripts/CreaTools-install.sh | 58 +++++++++----------- Linux/scripts/CreaTools-load.sh | 5 +- Linux/scripts/ThirdParty-install-Finalize.sh | 27 +++++---- Linux/scripts/ThirdParty-install-VTK.sh | 13 ++++- Linux/scripts/installmod.sh | 12 ++-- Linux/scripts/installmodBash.sh | 45 +++++++++++++++ Linux/scripts/installmodNomake.sh | 8 +-- Linux/scripts/tgz-Bin-Package.sh | 58 ++++++++++++++++++++ 9 files changed, 171 insertions(+), 62 deletions(-) create mode 100644 Linux/scripts/installmodBash.sh create mode 100644 Linux/scripts/tgz-Bin-Package.sh diff --git a/Linux/installscript b/Linux/installscript index 4823c02..70fb284 100755 --- a/Linux/installscript +++ b/Linux/installscript @@ -339,11 +339,12 @@ fi if [ `checkVal $command all 3rd 3rd-base` == true ] ; then bigDisplay "INSTALL PACKAGES DEPENDENCIES" if [ "`whoami`" == root ] ; then - bash scripts/ThirdParty-install-Base-Stuff.sh + echo ThirdParty-install-Base-Stuff + bash scripts/ThirdParty-install-Base-Stuff.sh else # must log as root echo "Please enter the root passwd to add necessary packages:"; - sudo su -c "bash scripts/ThirdParty-install-Base-Stuff.sh" + su -c "bash scripts/ThirdParty-install-Base-Stuff.sh" fi bash scripts/ThirdParty-install.sh fi @@ -398,7 +399,7 @@ fi if [ `checkVal $command all creatools creatools-cmp` == true ] ; then bigDisplay "COMPILE CREATOOLS" source $ETC_BASHRC - bash -x scripts/CreaTools-compile.sh + bash -x scripts/CreaTools-compile.sh # To allow (*very* aware) user to patch code, later if [ ! -e $generationdir/creatools_source ] ; then diff --git a/Linux/scripts/CreaTools-install.sh b/Linux/scripts/CreaTools-install.sh index 4a37bb3..d20555c 100644 --- a/Linux/scripts/CreaTools-install.sh +++ b/Linux/scripts/CreaTools-install.sh @@ -55,28 +55,25 @@ #create creatools_base_library_config.sh at the very begining, so we can write "export xxx_BIN=..." inside installmod.sh. JPRx 3 mars 2011 - if [ -f $installPrefix/share/creatools_base_library_config.sh ] - then - rm $installPrefix/share/creatools_base_library_config.sh - fi - touch $installPrefix/share/creatools_base_library_config.sh - chmod 755 $installPrefix/share/creatools_base_library_config.sh - - echo export PATH='$'PATH:$installPrefix/bin >> $installPrefix/share/creatools_base_library_config.sh - if [ $OperatingSystem = "MacOS" ] - then - echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh - else - echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh - echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh - fi +##EED if [ -f $installPrefix/share/creatools_base_library_config.sh ] +##EED then +##EED rm $installPrefix/share/creatools_base_library_config.sh +##EED fi +##EED touch $installPrefix/share/creatools_base_library_config.sh + + # Install creatools as user (no longer as root) // JPR 2/5/2011 # - remove line 'bash $installPrefix/creatools_install/share/creatools_base_library_config.sh' if any sed -i -e '/.*creatools_base_library_config.*/ d' $ETC_BASHRC sed -i -e '/installPrefixtmp*/ d' $ETC_BASHRC - + + mkdir $installPrefix + mkdir $installPrefix/share + echo '## This file is call from .bashrc' > $installPrefix/share/creatools_base_library_config.sh + bash installmodBash.sh $installPrefix + # JPR 2/5/2011 # modify /etc/bashrc (we cannot modify .bashrc, since we switched as root) # - add line 'bash $installPrefix/creatools_install/share/creatools_base_library_config.sh' @@ -111,26 +108,21 @@ bash installmodNomake.sh $buildType wxvtk $generationdir $installPrefix #EED I don't know why this works here and not after the chmod 755 -echo export PATH='$'PATH:$installPrefix/bin >> $installPrefix/share/creatools_base_library_config.sh -if [ $OperatingSystem = "MacOS" ] -then - echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh -else - echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh - echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh -fi +#EED bash installmodBash.sh $installPrefix echo "===================================================in CreaTools-install.sh ETC_BASHRC : " $ETC_BASHRC echo installPrefixtmp=$installPrefix >> $ETC_BASHRC -echo '[ -f "$installPrefixtmp/share/creatools_base_library_config.sh" ] && source $installPrefixtmp/share/creatools_base_library_config.sh' >> $ETC_BASHRC - -source $installPrefix/share/creatools_base_library_config.sh -echo "===================================================" -echo " Regenerate Package doc" -$installPrefix/bin/bbRegeneratePackageDoc -a -q -echo " Regenerate Boxes list" -$installPrefix/bin/bbRegenerateBoxesLists -q -echo "===================================================" +echo '[ -f "$installPrefixtmp/share/creatools_base_library_config.sh" ] && source $installPrefixtmp/share/creatools_base_library_config.sh $installPrefixtmp' >> $ETC_BASHRC + +source $installPrefix/share/creatools_base_library_config.sh $installPrefix + +##EED 21/12/2014 +##EED echo "===================================================" +##EED echo " Regenerate Package doc" +##EED $installPrefix/bin/bbRegeneratePackageDoc -a -q +##EED echo " Regenerate Boxes list" +##EED $installPrefix/bin/bbRegenerateBoxesLists -q +##EED echo "===================================================" # JPR 2/5/2011 #else diff --git a/Linux/scripts/CreaTools-load.sh b/Linux/scripts/CreaTools-load.sh index 3fd2e76..b8b983b 100644 --- a/Linux/scripts/CreaTools-load.sh +++ b/Linux/scripts/CreaTools-load.sh @@ -86,9 +86,9 @@ then #if [ true = false ] if [ true = true ] then -# rm -rf creatools_bin -# mkdir $generationdir/creatools_bin rm -rf creatools_source + rm -rf creatools_bin + rm -rf creatools_install mkdir $generationdir/creatools_source fi fi @@ -106,6 +106,7 @@ then # if [ $sourcesFrom = GIT ] || [ $sourcesFrom = GIT-READ-ONLY ]; then + ssh-add bash $scriptDir/gitclone.sh $creasource $generationdir $sourcesFrom bash $scriptDir/gitclone.sh $bbtksource $generationdir $sourcesFrom bash $scriptDir/gitclone.sh $creavtksource $generationdir $sourcesFrom diff --git a/Linux/scripts/ThirdParty-install-Finalize.sh b/Linux/scripts/ThirdParty-install-Finalize.sh index f1d99b7..9ac09af 100644 --- a/Linux/scripts/ThirdParty-install-Finalize.sh +++ b/Linux/scripts/ThirdParty-install-Finalize.sh @@ -62,21 +62,22 @@ fi touch $installPrefixThird/share/creatools_third_party_library_config.sh chmod 755 $installPrefixThird/share/creatools_third_party_library_config.sh -echo export PATH='$'PATH:$installPrefixThird/bin >> $installPrefixThird/share/creatools_third_party_library_config.sh -echo export VTK_DIR=$installPrefixThird/lib/vtk-5.10 >> $installPrefixThird/share/creatools_third_party_library_config.sh -echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh -echo export GDCM_DIR=$installPrefixThird/lib/gdcm >> $installPrefixThird/share/creatools_third_party_library_config.sh -echo export TTH=$installPrefixThird/bin/tth >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo installPrefixThird='$1' >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export PATH='$'PATH:'$'installPrefixThird/bin >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export VTK_DIR='$'installPrefixThird/lib/vtk-5.10 >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export ITK_DIR='$'installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export GDCM_DIR='$'installPrefixThird/lib/gdcm >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export TTH='$'installPrefixThird/bin/tth >> $installPrefixThird/share/creatools_third_party_library_config.sh if [ $OperatingSystem = "MacOS" ] then - echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh - echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh - echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh + echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:'$'GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh + echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:'$'ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh + echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:'$'VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh else - echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh - echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh - echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh + echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh + echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh + echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh fi sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC @@ -86,7 +87,9 @@ fi echo "====================================================ETC_BASHRC " $ETC_BASHRC echo installPrefixThird=$installPrefixThird >> $ETC_BASHRC -echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] && source $installPrefixThird/share/creatools_third_party_library_config.sh' >> $ETC_BASHRC +echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] && source $installPrefixThird/share/creatools_third_party_library_config.sh $installPrefixThird' >> $ETC_BASHRC chown -R $loginUserName $generationdir chgrp -R $loginGroupName $generationdir + +source ~/.bashrc diff --git a/Linux/scripts/ThirdParty-install-VTK.sh b/Linux/scripts/ThirdParty-install-VTK.sh index 7ab1f31..8062966 100644 --- a/Linux/scripts/ThirdParty-install-VTK.sh +++ b/Linux/scripts/ThirdParty-install-VTK.sh @@ -108,9 +108,11 @@ fi ## tar -xvf VTK-5.6.1.patchCreatis.tar.gz curl -O http://www.vtk.org/files/release/5.10/vtk-5.10.1.zip - # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-( unzip vtk-5.10.1.zip - + cd VTK5.10.1/Rendering + curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/vtk-5.10.1.vtkXOpenGLRenderWindow.patch + patch < vtk-5.10.1.vtkXOpenGLRenderWindow.patch + # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-( else ## EED 2013-10-29 @@ -121,8 +123,15 @@ fi echo unzip vtk-5.10.1.zip pwd unzip vtk-5.10.1.zip + + cd VTK5.10.1/Rendering + wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/vtk-5.10.1.vtkXOpenGLRenderWindow.patch + patch < vtk-5.10.1.vtkXOpenGLRenderWindow.patch fi + + + #if [ $buildType = "Debug" ] #then # debug="ON" diff --git a/Linux/scripts/installmod.sh b/Linux/scripts/installmod.sh index 18bca20..48f9870 100644 --- a/Linux/scripts/installmod.sh +++ b/Linux/scripts/installmod.sh @@ -48,10 +48,10 @@ then # grouik style patch JPR if [ $2 = "bbtk" ] then - echo export BBTK_DIR=$installPrefix/lib64/creatools/$2 >> $installPrefix/share/creatools_base_library_config.sh + echo export BBTK_DIR='$'installPrefix/lib64/creatools/$2 >> $installPrefix/share/creatools_base_library_config.sh else - echo export $2_DIR=$installPrefix/lib64/creatools/$2 >> $installPrefix/share/creatools_base_library_config.sh - echo export bb$2_DIR=$installPrefix/lib64/creatools/bb$2 >> $installPrefix/share/creatools_base_library_config.sh + echo export $2_DIR='$'installPrefix/lib64/creatools/$2 >> $installPrefix/share/creatools_base_library_config.sh + echo export bb$2_DIR='$'installPrefix/lib64/creatools/bb$2 >> $installPrefix/share/creatools_base_library_config.sh fi else @@ -60,10 +60,10 @@ else # grouik style patch JPR if [ $2 = "bbtk" ] then - echo "export BBTK_DIR=$installPrefix/lib/creatools/$2" >> $installPrefix/share/creatools_base_library_config.sh + echo "export BBTK_DIR='$'installPrefix/lib/creatools/$2" >> $installPrefix/share/creatools_base_library_config.sh else - echo "export $2_DIR=$installPrefix/lib/creatools/$2" >> $installPrefix/share/creatools_base_library_config.sh - echo "export bb$2_DIR=$installPrefix/lib/creatools/bb$2" >> $installPrefix/share/creatools_base_library_config.sh + echo "export $2_DIR='$'installPrefix/lib/creatools/$2" >> $installPrefix/share/creatools_base_library_config.sh + echo "export bb$2_DIR='$'installPrefix/lib/creatools/bb$2" >> $installPrefix/share/creatools_base_library_config.sh fi else echo "============================= NEITHER $installPrefix/lib64 NOR $installPrefix/lib EXIST ?!?" diff --git a/Linux/scripts/installmodBash.sh b/Linux/scripts/installmodBash.sh new file mode 100644 index 0000000..428195d --- /dev/null +++ b/Linux/scripts/installmodBash.sh @@ -0,0 +1,45 @@ +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Santé) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + + +# $1 : installPrefix + +echo +echo +echo +echo "------------------------------------------in installmodBash-------------" + +source CreaTools-configure.sh +source CreaTools-names.sh + +echo installPrefix='$1' >> $installPrefix/share/creatools_base_library_config.sh +echo export PATH='$'PATH:'$'installPrefix/bin >> $installPrefix/share/creatools_base_library_config.sh +if [ $OperatingSystem = "MacOS" ] +then + echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:'$'installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh +else + echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh + echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:'$'installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh +fi + + diff --git a/Linux/scripts/installmodNomake.sh b/Linux/scripts/installmodNomake.sh index 28d684b..7910d15 100644 --- a/Linux/scripts/installmodNomake.sh +++ b/Linux/scripts/installmodNomake.sh @@ -55,8 +55,8 @@ then #then # echo export BBTK_DIR=$installPrefix/lib64/creatools/$2 >> $installPrefix/share/creatools_base_library_config.sh #else - echo export $2_DIR=$installPrefix/lib64/creatools/$2 >> $installPrefix/share/creatools_base_library_config.sh - echo export bb$2_DIR=$installPrefix/lib64/creatools/bb$2 >> $installPrefix/share/creatools_base_library_config.sh + echo export $2_DIR='$'installPrefix/lib64/creatools/$2 >> $installPrefix/share/creatools_base_library_config.sh + echo export bb$2_DIR='$'installPrefix/lib64/creatools/bb$2 >> $installPrefix/share/creatools_base_library_config.sh #fi fi @@ -67,8 +67,8 @@ then # then # echo "export BBTK_DIR=$installPrefix/lib/creatools/$2" >> $installPrefix/share/creatools_base_library_config.sh # else - echo "export $2_DIR=$installPrefix/lib/creatools/$2" >> $installPrefix/share/creatools_base_library_config.sh - echo "export bb$2_DIR=$installPrefix/lib/creatools/bb$2" >> $installPrefix/share/creatools_base_library_config.sh + echo "export $2_DIR='$'installPrefix/lib/creatools/$2" >> $installPrefix/share/creatools_base_library_config.sh + echo "export bb$2_DIR='$'installPrefix/lib/creatools/bb$2" >> $installPrefix/share/creatools_base_library_config.sh # fi else diff --git a/Linux/scripts/tgz-Bin-Package.sh b/Linux/scripts/tgz-Bin-Package.sh new file mode 100644 index 0000000..7c8c195 --- /dev/null +++ b/Linux/scripts/tgz-Bin-Package.sh @@ -0,0 +1,58 @@ +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Santé) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + + +#!/bin/bash + +# JPR 2/5/2011 +#if [ $UID = 0 ] +#then + # Set all local variables + source $PWD/scripts/CreaTools-configure.sh + + if [ -e $generationdir ] + then + fileTGZ=$generationdir/creaTools-Bin.tgz + tar -cvzf $fileTGZ $installPrefix $installPrefixThird + + echo "" + echo "Creation OK:" + echo $fileTGZ + echo "" + + else + echo + echo "..ERROR.." + echo "===================================================" + echo "REMEMBER !" + echo "" + echo "You MUST load the Creatools sources before (use 2.2)!" + echo "===================================================" + echo + echo + read a + exit 0 + fi + + + -- 2.47.1