Blame view

compilAndInstall.sh 4.05 KB
346b85c6   Benjamin Renard   First commit with...
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

createDir() {
	WHAT=$1
	if [ ! -d ${WHAT} ]; then
		echo "Create ${WHAT}"
		mkdir -p ${WHAT}
		chmod -Rf 775 ${WHAT}
	fi
}

# to change before installation
cfb80664   Benjamin Renard   Update install sc...
13
export TREPS_INSTALL_DIR="/home/mbouchemit/TREPS" # treps install dir
346b85c6   Benjamin Renard   First commit with...
14

cfb80664   Benjamin Renard   Update install sc...
15
16
export TREPS_BUILD_DEBUG=0 # 1 to compile the treps kernel in Debug mode
export TREPS_VALIDATION=0  # 1 to install validation platform (Fitnesse & Sonar)
346b85c6   Benjamin Renard   First commit with...
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153

# treps package structure
export TREPS_PACKAGE_DIR="`pwd`"
export TREPS_IHM_PACKAGE_DIR=${TREPS_PACKAGE_DIR}/ihm
export TREPS_SERVER_PACKAGE_DIR=${TREPS_PACKAGE_DIR}/server
export TREPS_PHP_PACKAGE_DIR=${TREPS_SERVER_PACKAGE_DIR}/php
export TREPS_KERNEL_PACKAGE_DIR=${TREPS_SERVER_PACKAGE_DIR}/kernel
export TREPS_COTS_PACKAGE_DIR=${TREPS_PACKAGE_DIR}/COTS

export TREPS_EXTJS_PACKAGE_NAME="ext-4.2.1-gpl.tar.gz"
export TREPS_SAMPJS_PACKAGE_NAME="sampjs.tar.gz"

# treps installation dir structure
export TREPS_WWW_INSTALL_DIR=${TREPS_INSTALL_DIR}/www
export TREPS_WWW_LIB_INSTALL_DIR=${TREPS_WWW_INSTALL_DIR}/lib
export TREPS_WWW_PHP_INSTALL_DIR=${TREPS_WWW_INSTALL_DIR}/php
export TREPS_BIN_INSTALL_DIR=${TREPS_INSTALL_DIR}/bin
export TREPS_KERNEL_INSTALL_DIR=${TREPS_BIN_INSTALL_DIR}/kernel
export TREPS_COTS_INSTALL_DIR=${TREPS_BIN_INSTALL_DIR}/COTS
if [ ${TREPS_VALIDATION} -ne 0 ]; then
  export TREPS_TEST_INSTALL_DIR=${TREPS_INSTALL_DIR}/test
  export TREPS_FITNESSE_INSTALL_DIR=${TREPS_TEST_INSTALL_DIR}/Fitnesse
  export TREPS_SONAR_INSTALL_DIR=${TREPS_TEST_INSTALL_DIR}/Sonar
fi

# create install dirs
createDir ${TREPS_INSTALL_DIR}
createDir ${TREPS_WWW_INSTALL_DIR}
createDir ${TREPS_WWW_LIB_INSTALL_DIR}
createDir ${TREPS_WWW_PHP_INSTALL_DIR}
createDir ${TREPS_BIN_INSTALL_DIR}
createDir ${TREPS_KERNEL_INSTALL_DIR}
createDir ${TREPS_COTS_INSTALL_DIR}
if [ ${TREPS_VALIDATION} -ne 0 ]; then
  createDir ${TREPS_TEST_INSTALL_DIR}
  createDir ${TREPS_FITNESSE_INSTALL_DIR}
  createDir ${TREPS_SONAR_INSTALL_DIR}
fi

# install ihm
cp -Rf ${TREPS_IHM_PACKAGE_DIR}/* ${TREPS_WWW_INSTALL_DIR}

cp ${TREPS_COTS_PACKAGE_DIR}/${TREPS_EXTJS_PACKAGE_NAME} ${TREPS_WWW_LIB_INSTALL_DIR}
cp ${TREPS_COTS_PACKAGE_DIR}/${TREPS_SAMPJS_PACKAGE_NAME} ${TREPS_WWW_LIB_INSTALL_DIR}

cd ${TREPS_WWW_LIB_INSTALL_DIR}
tar xzf ${TREPS_EXTJS_PACKAGE_NAME}
tar xzf ${TREPS_SAMPJS_PACKAGE_NAME}
rm ${TREPS_EXTJS_PACKAGE_NAME} ${TREPS_SAMPJS_PACKAGE_NAME}

# install server php
cp -Rf ${TREPS_PHP_PACKAGE_DIR}/* ${TREPS_WWW_PHP_INSTALL_DIR}

chmod 775 ${TREPS_WWW_PHP_INSTALL_DIR}/data

# compil and install kernel COTS
cd ${TREPS_COTS_PACKAGE_DIR}
chmod 775 build_cots.sh
./build_cots.sh ${TREPS_VALIDATION}

if [ $? -eq 0 ]; then
  echo "COTS compilation OK"
else
  echo "COTS compilation ERROR - $?"
  exit 1
fi

# compil and install kernel
cd ${TREPS_KERNEL_PACKAGE_DIR}

chmod 775 scripts/generate3DViewSOAPClient.sh

TREPS_CMAKE_GENERATOR="Unix Makefiles"
if [ ${TREPS_BUILD_DEBUG} -eq 0 ]; then
  echo "TREPS kernel compilation in Release mode"
  TREPS_CMAKE_BUILD_TYPE=Release
else
  echo "TREPS kernel compilation in Debug mode"
  TREPS_CMAKE_BUILD_TYPE=Debug
fi

cmake -G"${TREPS_CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=${TREPS_CMAKE_BUILD_TYPE}

if [ ${?} -eq 0 ]; then
  echo "cmake TREPS kernel OK"
else
  echo "cmake TREPS kernel ERROR"
  exit 1
fi

make

if [ ${?} -ne 0 ]; then
  echo "Error during the compilation of TREPS Kernel."
  exit 1
fi

make install CMAKE_INSTALL_ALWAYS=1

if [ ${?} -ne 0 ]; then
  echo "Error during the installation of TREPS Kernel."
  exit 1
fi

chmod 775 ${TREPS_KERNEL_INSTALL_DIR}

if [ ${TREPS_VALIDATION} -eq 0 ]; then
  echo "Compilation & Installation without validation OK"
  exit 0
fi

# compil and install CSlimServer
cd ${TREPS_KERNEL_PACKAGE_DIR}/test/Fitnesse/CSlimServer
cmake -G"${TREPS_CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=${TREPS_CMAKE_BUILD_TYPE}

if [ ${?} -eq 0 ]; then
  echo "cmake TREPS CSlimServer OK"
else
  echo "cmake TREPS CSlimServer ERROR"
  exit 1
fi

make

if [ ${?} -ne 0 ]; then
  echo "Error during the compilation of TREPS CSlimServer."
  exit 1
fi

make install CMAKE_INSTALL_ALWAYS=1

if [ ${?} -ne 0 ]; then
  echo "Error during the installation of TREPS CSlimServer."
  exit 1
fi

exit 0