From: Eduardo DAVILA Date: Mon, 15 Jun 2020 12:57:14 +0000 (+0200) Subject: All Linux X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e03610e6b7b801f462e7b53a078922da1a62a8d2;p=creaToolsTools.git All Linux --- diff --git a/Linux/scripts/CreaTools-configure.sh b/Linux/scripts/CreaTools-configure.sh new file mode 100644 index 0000000..1731f99 --- /dev/null +++ b/Linux/scripts/CreaTools-configure.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +#File generated by 'installscript' +#DO NOT edit ! +#(except if you *do* know what you do) + +OperatingSystem=Fedora +corenumber=7 +generationdir=/home/davila/Creatis/C10 +installPrefix=/home/davila/Creatis/C10/ci +installPrefixThird=/home/davila/Creatis/C10/tpli +docgeneration=OFF +sourcesFrom=GIT +loginUserName=davila +loginGroupName=davila +buildType=Release +gdcmVersion=GDCM1 +ITKVersion=ITK4 +ETC_BASHRC=/home/davila/.bashrc diff --git a/Linux/scripts/Install-Creatools-Bin.sh b/Linux/scripts/Install-Creatools-Bin.sh index 968e26e..3150f01 100755 --- a/Linux/scripts/Install-Creatools-Bin.sh +++ b/Linux/scripts/Install-Creatools-Bin.sh @@ -1,75 +1,3 @@ -# --------------------------------------------------------------------- -# -# 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 -e - -########################################### -function getDistrib { - local OS=`uname` - - if [ "$OS" == Darwin ] ; then OS=MacOS; -##EED2016-10-15 -## elif [ "$OS" == Linux ] ; then OS=$(lsb_release -i | awk '{print $3}') - elif [ "$OS" == Linux ] ; then OS=`awk 'NR==1{print $1}' /etc/system-release` - - else OS="" - fi -# checkDistrib $OS - echo $OS -} - - -OperatingSystem=`getDistrib` - - case "$OperatingSystem" in - Mandriva) - echo Root password: - su -c "urpmi aria2" - downloadCommand=aria2c - ;; - Fedora) - ARIA2EXIST=$(rpm -qa | grep aria2 | wc -l) - if [ "$ARIA2EXIST" -eq '1' ]; then - echo Root password: - su -c "dnf install aria2 -y" - fi - downloadCommand=aria2c - ;; - Ubuntu) - echo Root password: - su -c "apt-get --yes install wget" - downloadCommand=wget - ;; - MacOS) - port install curl -y - downloadCommand=curl - ;; - *) - echo " '$OperatingSystem' : Unknown (for us...) Operating Sytem " - echo " Allowed values are (right now) Fedora, Ubuntu, MacOS " -// exit 0 - ;; - esac CREATOOLSBINDIR=Creatools-Bin rm -rf $CREATOOLSBINDIR diff --git a/Linux/scripts/Install-Creatools-Bin.sh-downloadTool b/Linux/scripts/Install-Creatools-Bin.sh-downloadTool new file mode 100755 index 0000000..368357c --- /dev/null +++ b/Linux/scripts/Install-Creatools-Bin.sh-downloadTool @@ -0,0 +1,95 @@ +# --------------------------------------------------------------------- +# +# 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 -e + +########################################### +function getDistrib { + local OS=`uname` + + if [ "$OS" == Darwin ] ; then OS=MacOS; +##EED2016-10-15 +## elif [ "$OS" == Linux ] ; then OS=$(lsb_release -i | awk '{print $3}') + elif [ "$OS" == Linux ] ; then + OS=`awk 'NR==1{print $1}' /etc/system-release` + if [ "$OS" == "" ] ; then + OS=$(lsb_release -i | awk '{print $3}') + fi + else OS="" + fi +# checkDistrib $OS + echo $OS +} + + +OperatingSystem=`getDistrib` + +echo +echo +echo $OperatingSystem +echo + case "$OperatingSystem" in + Mandriva) + ARIA2EXIST=$(rpm -qa | grep aria2 | wc -l) + if [ "$ARIA2EXIST" = "0" ]; then + echo "Install aria2 (download tool) Root password:" + su -c "urpmi aria2" + fi + downloadCommand=aria2c + ;; + Fedora) + ARIA2EXIST=$(rpm -qa | grep aria2 | wc -l) + if [ "$ARIA2EXIST" = "0" ]; then + echo "Install aria2 (download tool) Root password:" + su -c "dnf install aria2 -y" + fi + downloadCommand=aria2c + ;; + Debian) + WGETEXIST=$(dpkg -l | grep wget | wc -l) + if [ "$WGETEXIST" = "0" ]; then + echo "Install wget (download tool) Root password:" + su -c "apt-get --yes install wget " + fi + downloadCommand=wget + ;; + Ubuntu) + WGETEXIST=$(dpkg -l | grep wget | wc -l) + if [ "$WGETEXIST" = "0" ]; then + echo "Install wget (download tool) Root password:" + su -c "apt-get --yes install wget" + fi + downloadCommand=wget + ;; + MacOS) + port install curl -y + downloadCommand=curl + ;; + *) + echo " '$OperatingSystem' : Unknown (for us...) Operating Sytem " + echo " Allowed values are (right now) Fedora, Ubuntu, MacOS " +// exit 0 + ;; + esac + + diff --git a/Linux/scripts/Install-Creatools-Final_User.sh b/Linux/scripts/Install-Creatools-Final_User.sh new file mode 100755 index 0000000..3c54457 --- /dev/null +++ b/Linux/scripts/Install-Creatools-Final_User.sh @@ -0,0 +1,10 @@ + +CREATOOLSBINDIR=Creatools-Bin +rm -rf $CREATOOLSBINDIR +mkdir $CREATOOLSBINDIR +cd $CREATOOLSBINDIR +$downloadCommand http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/creatools-Linux-Bin.sh +source creatools-Linux-Bin.sh Final_User +cd .. + + diff --git a/Linux/scripts/LocalFunctions.sh b/Linux/scripts/LocalFunctions.sh index 662fbae..ecc8a8c 100644 --- a/Linux/scripts/LocalFunctions.sh +++ b/Linux/scripts/LocalFunctions.sh @@ -51,7 +51,7 @@ function bigDisplay { ########################################### function checkDistrib { local OS=$1 - if [ "`checkVal $OS MacOS Fedora Ubuntu Mandriva CentOS`" == "false" ] ; then + if [ "`checkVal $OS MacOS Fedora Ubuntu Mandriva CentOS Debian`" == "false" ] ; then echo "Operating System not supported: $OS" echo "Currently supported system: Fedora Ubuntu MacOS" exit 1 @@ -84,6 +84,7 @@ function getDistribVersion { elif [ "$DISTRIB" == Fedora ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/system-release` elif [ "$DISTRIB" == Ubuntu ] ; then OSVersion=`awk 'NR==1{print $2}' /etc/issue` elif [ "$DISTRIB" == CentOS ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue` + elif [ "$DISTRIB" == Debian ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue` else OSVersion="VOID_EED" fi echo $OSVersion @@ -97,6 +98,7 @@ function getKernelVersion { elif [ "$DISTRIB" == Fedora ] ; then KernelVersion=$(uname -a | awk '{print $3}') elif [ "$DISTRIB" == Ubuntu ] ; then KernelVersion=$(uname -a | awk '{print $3}') elif [ "$DISTRIB" == CentOS ] ; then KernelVersion=$(uname -a | awk '{print $3}') + elif [ "$DISTRIB" == Debian ] ; then KernelVersion=$(uname -a | awk '{print $3}') else KernelVersion="VOID_EED" fi echo $KernelVersion @@ -113,6 +115,7 @@ function getDownloadCommand { elif [ "$DISTRIB" == Fedora ] ; then downloadCommand='aria2c -x 16' elif [ "$DISTRIB" == CentOs ] ; then downloadCommand='aria2c -x 16' elif [ "$DISTRIB" == Ubuntu ] ; then downloadCommand=wget + elif [ "$DISTRIB" == Debian ] ; then downloadCommand=wget else downloadCommand="VOID_EED" fi echo $downloadCommand diff --git a/Linux/scripts/TPLaux-bashrc.sh b/Linux/scripts/TPLaux-bashrc.sh new file mode 100644 index 0000000..7ac39b9 --- /dev/null +++ b/Linux/scripts/TPLaux-bashrc.sh @@ -0,0 +1,38 @@ +# --------------------------------------------------------------------- +# +# 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 + +echo "---TPLaux-bashrc.sh---" +echo $ETC_BASHRC +echo "installPrefixTPLaux: " $installPrefixTPLaux + +# Cleanning line in .bashrc file +sed -i -e '/.*installPrefixTPLaux*/ d' $ETC_BASHRC +sed -i -e '/.*creatools_TPLaux_config.*/ d' $ETC_BASHRC + +echo "====================================================ETC_BASHRC " $ETC_BASHRC +echo installPrefixTPLaux=$installPrefixTPLaux >> $ETC_BASHRC +echo '[ -f "$installPrefixTPLaux/share/creatools/creatools_TPLaux_config.sh" ] && source $installPrefixTPLaux/share/creatools/creatools_TPLaux_config.sh $installPrefixTPLaux' >> $ETC_BASHRC + diff --git a/Linux/scripts/ThirdParty-install-Base-Stuff.sh b/Linux/scripts/ThirdParty-install-Base-Stuff.sh index 7caf9ca..4db306e 100644 --- a/Linux/scripts/ThirdParty-install-Base-Stuff.sh +++ b/Linux/scripts/ThirdParty-install-Base-Stuff.sh @@ -33,7 +33,7 @@ echo "OperatingSystem = $OperatingSystem" bash ThirdParty-install-Base-rpm.sh $OperatingSystem else # must log as root - echo "Please enter the root passwd to add necessary packages:"; + echo "Creatools need to install some RPM pakages. Please enter the root passwd :"; if [ "Ubuntu" == $OperatingSystem ] ; then sudo bash ThirdParty-install-Base-rpm.sh $OperatingSystem elif [ "MacOS" == $OperatingSystem ] ; then