-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)
Exit :.............................9
-C) Choose 'Configure' (0)
+B) Choose 'Configure' (0)
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.
while [[ "$suitable" != "YES" && \
"$suitable" != "yes" && \
"$suitable" != "Y" && \
- "$suitable" != "y" && \
+ "$suitable" != "y" && \
"$suitable" != "NO" && \
"$suitable" != "no" ]]
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)"
OperatingSystem="XXX"
while [[ "$OperatingSystem" != "Fedora" && \
"$OperatingSystem" != "Ubuntu" && \
-
"$OperatingSystem" != "MacOS" ]]
do
echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
# 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
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.."
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
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