]> SALOME platform Git repositories - modules/shaper.git/blob - config.sh
Salome HOME
Make export XAO with groups
[modules/shaper.git] / config.sh
1 #!/bin/bash -ex
2
3 while [[ $# > 0 ]]; do
4   key="$1"
5
6   case $key in
7     standalone|Standalone)
8     MODE=Standalone
9     shift
10     ;;
11     *)
12     shift
13     ;;
14   esac
15 done
16
17
18 rm env_config.sh || echo "File env_config.sh was not found."
19
20 echo "#!/bin/bash -ex" >> env_config.sh
21
22 PLATFORM=""
23 if [ -f PLATFORM ]; then
24   PLATFORM="$(lsb_release -is)"
25   RELEASE="$(lsb_release -rs)"
26   if [ "${PLATFORM}" = 'CentOS' ]; then PLATFORM=-centos
27   elif [ "${PLATFORM}" = 'Debian' ]; then
28     if [ "${RELEASE}" = '8.0' ]; then PLATFORM=-d8
29     else PLATFORM=-d6
30     fi
31   fi
32 fi
33
34 if [ -f DEBUG ]; then
35   PLATFORM=${PLATFORM}_d
36 fi
37
38 echo "export PLATFORM=${PLATFORM}" >> env_config.sh
39
40 include_products() {
41   local salome_version=$1
42   local platform="$(lsb_release -is)"
43   local release="$(lsb_release -rs)"
44   if [[ ${salome_version} = '7.7.0' ]]; then
45     if   [[ "${platform}" = 'CentOS' ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/CentOS.6.3.64/7.7.0
46     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/DEBIAN.6.0.64/7.7.0
47     fi
48   elif [[ ${salome_version} = '7.8.0' ]]; then
49     if   [[ "${platform}" = 'CentOS' ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/CentOS.6.3.64/7.8.0
50     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/DEBIAN.6.0.64/7.8.0
51     fi
52   else
53     echo "Could not find PRODUCTS for the platform ${platform} ${release}"
54     exit 1
55   fi
56 }
57 include_products '7.8.0'
58
59 include_suit() {
60   local salome_version=$1
61   local platform="$(lsb_release -is)"
62   local release="$(lsb_release -rs)"
63   if [[ ${salome_version} = '7.7.0' ]]; then
64     if   [[ "${platform}" = 'CentOS' ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_7_0/CentOS63-64/GUI
65     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_7_0/Debian60-64/GUI
66     fi
67   elif [[ ${salome_version} = '7.8.0' ]]; then
68     if   [[ "${platform}" = 'CentOS' ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_8_0/CentOS63-64/GUI
69     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_8_0/Debian60-64/GUI
70     fi
71   else
72     echo "Could not find PRODUCTS for the platform ${platform} ${release}"
73     exit 1
74   fi
75 }
76 include_suit '7.8.0'
77
78 include_salome() {
79   local salome_version=$1
80   local platform="$(lsb_release -is)"
81   local release="$(lsb_release -rs)"
82   if [[ ${salome_version} = '7.5.1' ]]; then
83     if   [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn48/newgeom/common/SALOME-7.5.1_CentOS-6.3
84     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-6.0_SOURCES
85     elif [[ "${platform}" = 'Debian' && ${release} =~ ^8 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-8.0_SOURCES
86     fi
87   elif [[ ${salome_version} = '7.6.0' ]]; then
88     if   [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.6.0_CentOS-6.3_SOURCES
89     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.6.0_Debian-6.0_SOURCES
90     fi
91   elif [[ ${salome_version} = '7.7.0' ]]; then
92     if   [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.7.0_CentOS63-64
93     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.7.0_Debian60-64
94     fi
95   elif [[ ${salome_version} = '7.8.0' ]]; then
96     if   [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.8.0_CentOS63-64
97     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.8.0_Debian60-64
98     fi
99   else 
100     echo "Could not find SALOME for the platform ${platform} ${release}"
101     exit 1
102   fi
103 }
104 include_salome '7.8.0'
105
106
107 if [[ ${MODE} = 'Standalone' ]]; then
108   echo "export INST_ROOT=${PRODUCTS_ROOT}" >> env_config.sh
109   echo "export SUIT_DIR=${SUIT_DIR}" >> env_config.sh
110 else
111   echo "export INST_ROOT=${SALOME_ROOT}" >> env_config.sh
112 fi
113