From: jean-pierre roux Date: Mon, 14 Feb 2011 17:41:27 +0000 (+0000) Subject: This one should solve the troubles with Ubuntu X-Git-Tag: Creatools2-0-3.creaToolsTools2-0-3.17Feb2011~4 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0dc1b0564e7ba236e6a045f0b0904a10f4d792a8;p=creaToolsTools.git This one should solve the troubles with Ubuntu (/etc/bashrc vs /etc/bash.bashrc) --- diff --git a/Linux/README.txt b/Linux/README.txt index 8abf0bd..f19da65 100644 --- a/Linux/README.txt +++ b/Linux/README.txt @@ -1,14 +1,12 @@ -A) switch as root - -B) sh menu.sh +A) bash menu.sh You will be prompted to say what you want to do : Configure :........................0 Install Third Party Libraries :....1 (as root) - Get the 'CreaTools' source files :.2 (CVS : as user!) - Compile the CreaTools :..........3 + Get the 'CreaTools' source files :.2 (if CVS : as user!) + Compile the CreaTools :..........3 (as you like [root/user]) Install the CreaTools :..........4 (as root) Uninstall the CreaTools :..........5 (as root) @@ -17,7 +15,7 @@ You will be prompted to say what you want to do : Exit :.............................9 -C) Choose 'Configure' (0) +B) Choose 'Configure' (0) You will be prompted to give your preferences : @@ -32,18 +30,19 @@ You will be prompted to give your preferences : "Build type : Release/Debug (default is Release)" "Gdcm version : GDCM1/GDCM2 (default is GDCM1)" -D) If 'Third Party Libraries' are not yet installed, -choose 'Install Third Party Libraries' (1) +C) If 'Third Party Libraries' are not yet installed, + - switch as root (if not already done) + - choose 'Install Third Party Libraries' (1) -E) Close the window and open a new one. +D) Close the window and open a new one. switch as root again bash menu.sh -F) Choose Get the CreaTools source files ' (2) +E) Choose 'Get the CreaTools source files' (2) -G) Choose 'Compile the CreaTools' (3) +F) Choose 'Compile the CreaTools' (3) -H) Choose 'Install the CreaTools' (4) +G) Choose 'Install the CreaTools' (4) -I) Close the window and open a new one. +H) Close the window and open a new one. You can work, now. diff --git a/Linux/menu.sh b/Linux/menu.sh index 9bb3488..a965358 100644 --- a/Linux/menu.sh +++ b/Linux/menu.sh @@ -43,7 +43,7 @@ do while [[ "$suitable" != "YES" && \ "$suitable" != "yes" && \ "$suitable" != "Y" && \ - "$suitable" != "y" && \ + "$suitable" != "y" && \ "$suitable" != "NO" && \ "$suitable" != "no" ]] do @@ -66,18 +66,21 @@ do then echo echo "You are probabely running under UBUNTU OS ?" - echo "Troubles expected!" + echo "Troubles expected! (Hope NO!)" echo echo "Hit any key to continue" read a - else - echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :" - grep "installPrefixThird=" /etc/bashrc - echo "VTK_DIR :...." $VTK_DIR - echo "ITK_DIR :...." $ITK_DIR - echo "GDCM_DIR :..." $GDCM_DIR - echo "(Have a look at /etc/bashrc, edit it or run again Install Third Party Libraries if you disagree)" - fi + echo export ETC_BASHRC="/etc/bash.bashrc" + else + echo export ETC_BASHRC="/etc/bashrc" + fi + echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :" + + grep "installPrefixThird=" $ETC_BASHRC + echo "VTK_DIR :...." $VTK_DIR + echo "ITK_DIR :...." $ITK_DIR + echo "GDCM_DIR :..." $GDCM_DIR + echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)" fi echo echo "Are these values suitable for you : YES/NO? (default is YES)" @@ -108,7 +111,6 @@ do OperatingSystem="XXX" while [[ "$OperatingSystem" != "Fedora" && \ "$OperatingSystem" != "Ubuntu" && \ - "$OperatingSystem" != "MacOS" ]] do echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)" @@ -370,10 +372,10 @@ do # done # echo "you said [" $latexCompilerVariable "]" -# sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc -# sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc -# echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc -# echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc +# sed -i -e '/.*VTK_DIR*/ d' $ETC_BASHRC +# sed -i -e '/.*LATEX_COMPILER*/ d' $ETC_BASHRC +# echo "export VTK_DIR=$vtkdirVariable" >> $ETC_BASHRC +# echo "export LATEX_COMPILER=$latexCompilerVariable" >> $ETC_BASHRC if [ "$sourcesFrom" = "CVS" ] then diff --git a/Linux/scripts/CreaTools-install.sh b/Linux/scripts/CreaTools-install.sh index 76cb71f..9dd0fc4 100644 --- a/Linux/scripts/CreaTools-install.sh +++ b/Linux/scripts/CreaTools-install.sh @@ -28,12 +28,24 @@ then 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 - + if [ ! -f /etc/bashrc ] + then + echo + echo "You are probabely running under UBUNTU OS ?" + echo "Troubles expected! (Hope NO!)" + echo + echo "Hit any key to continue" + read a + echo export ETC_BASHRC="/etc/bash.bashrc" + else + echo export ETC_BASHRC="/etc/bashrc" + fi + # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' if any - sed -i -e '/.*creatools_base_library_config.*/ d' /etc/bashrc - # modify /etc/bashrc (we cannot modify .bashrc, since we witched as root) + sed -i -e '/.*creatools_base_library_config.*/ d' $ETC_BASHRC + # modify /etc/bashrc (we cannot modify .bashrc, since we switched as root) # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' - echo source $installPrefix/share/creatools_base_library_config.sh >> /etc/bashrc + echo source $installPrefix/share/creatools_base_library_config.sh >> $ETC_BASHRC else echo echo "..ERROR.." diff --git a/Linux/scripts/CreaTools-uninstall.sh b/Linux/scripts/CreaTools-uninstall.sh index b58c94e..d1f4b11 100644 --- a/Linux/scripts/CreaTools-uninstall.sh +++ b/Linux/scripts/CreaTools-uninstall.sh @@ -75,9 +75,23 @@ rm -rf creaMaracasVisu rm -rf bbtk creaImageIO creaNewProject creaContours creaMaracasVisu rm -f creatools_base_library_config.sh + +if [ ! -f /etc/bashrc ] +then + echo + echo "You are probabely running under UBUNTU OS ?" + echo "Troubles expected!" + echo + echo "Hit any key to continue"scripts/CreaTools-uninstall.sh + read a + echo export ETC_BASHRC="/etc/bash.bashrc" +else + echo export ETC_BASHRC="/etc/bashrc" +fi + # revert /etc/bashrc to previous value # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' - sed -i -e '/.*creatools_base_library_config.*/ d' /etc/bashrc + sed -i -e '/.*creatools_base_library_config.*/ d' $ETC_BASHRC else echo diff --git a/Linux/scripts/ThirdParty-install.sh b/Linux/scripts/ThirdParty-install.sh index 369e5c8..11d5ca0 100644 --- a/Linux/scripts/ThirdParty-install.sh +++ b/Linux/scripts/ThirdParty-install.sh @@ -245,20 +245,23 @@ echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThir if [ ! -f /etc/bashrc ] then - echo - echo "You are probabely running under UBUNTU OS ?" - echo "Troubles expected!" - echo - echo "Hit any key to continue" - read a + echo + echo "You are probabely running under UBUNTU OS ?" + echo "Troubles expected!" + echo + echo "Hit any key to continue"scripts/CreaTools-uninstall.sh + read a + echo export ETC_BASHRC="/etc/bash.bashrc" else - sed -i -e '/.*installPrefixThird*/ d' /etc/bashrc - sed -i -e '/.*creatools_third_party_library_config.*/ d' /etc/bashrc + echo export ETC_BASHRC="/etc/bashrc" fi + sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC + sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC + # - add line 'sh $installPrefixThird/share/creatools_third_party_library_config.sh' (with accurate value for ???) -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 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