Salome HOME
Unit test for Int Array
[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 ]; then PLATFORM=-d8
29     elif [ "${RELEASE}" =~ ^7 ]; then PLATFORM=-d7
30     else PLATFORM=-d6
31     fi
32   fi
33 fi
34
35 if [ -f DEBUG ]; then
36   PLATFORM=${PLATFORM}_d
37 fi
38
39 echo "export PLATFORM=${PLATFORM}" >> env_config.sh
40
41 include_products() {
42   local salome_version=$1
43   local platform="$(lsb_release -is)"
44   local release="$(lsb_release -rs)"
45   if [[ ${salome_version} = '7.7.0' ]]; then
46     if   [[ "${platform}" = 'CentOS' ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/CentOS.6.3.64/7.7.0
47     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/DEBIAN.6.0.64/7.7.0
48     fi
49   elif [[ ${salome_version} = '7.8.0' ]]; then
50     if   [[ "${platform}" = 'CentOS' ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/CentOS.6.3.64/7.8.0
51     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/DEBIAN.6.0.64/7.8.0
52     elif [[ "${platform}" = 'Debian' && ${release} =~ ^7 ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/DEBIAN.7.0.64/7.8.0
53     fi
54   else
55     echo "Could not find PRODUCTS for the platform ${platform} ${release}"
56     exit 1
57   fi
58 }
59 include_products '7.8.0'
60
61 include_suit() {
62   local salome_version=$1
63   local platform="$(lsb_release -is)"
64   local release="$(lsb_release -rs)"
65   if [[ ${salome_version} = '7.7.0' ]]; then
66     if   [[ "${platform}" = 'CentOS' ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_7_0/CentOS63-64/GUI
67     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_7_0/Debian60-64/GUI
68     fi
69   elif [[ ${salome_version} = '7.8.0' ]]; then
70     if   [[ "${platform}" = 'CentOS' ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_8_0/CentOS63-64/GUI
71     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_8_0/Debian60-64/GUI
72     elif [[ "${platform}" = 'Debian' && ${release} =~ ^7 ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_8_0/Debian70-64/GUI
73     fi
74   else
75     echo "Could not find PRODUCTS for the platform ${platform} ${release}"
76     exit 1
77   fi
78 }
79 include_suit '7.8.0'
80
81 include_salome() {
82   local salome_version=$1
83   local platform="$(lsb_release -is)"
84   local release="$(lsb_release -rs)"
85   if [[ ${salome_version} = '7.5.1' ]]; then
86     if   [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn48/newgeom/common/SALOME-7.5.1_CentOS-6.3
87     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-6.0_SOURCES
88     elif [[ "${platform}" = 'Debian' && ${release} =~ ^8 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-8.0_SOURCES
89     fi
90   elif [[ ${salome_version} = '7.6.0' ]]; then
91     if   [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.6.0_CentOS-6.3_SOURCES
92     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.6.0_Debian-6.0_SOURCES
93     fi
94   elif [[ ${salome_version} = '7.7.0' ]]; then
95     if   [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.7.0_CentOS63-64
96     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.7.0_Debian60-64
97     fi
98   elif [[ ${salome_version} = '7.8.0' ]]; then
99     if   [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.8.0_CentOS63-64
100     elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.8.0_Debian60-64
101     elif [[ "${platform}" = 'Debian' && ${release} =~ ^7 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.8.0_Debian70-64
102     fi
103   else 
104     echo "Could not find SALOME for the platform ${platform} ${release}"
105     exit 1
106   fi
107 }
108 include_salome '7.8.0'
109
110
111 if [[ ${MODE} = 'Standalone' ]]; then
112   echo "export INST_ROOT=${PRODUCTS_ROOT}" >> env_config.sh
113   echo "export SUIT_DIR=${SUIT_DIR}" >> env_config.sh
114 else
115   echo "export INST_ROOT=${SALOME_ROOT}" >> env_config.sh
116 fi
117