]> SALOME platform Git repositories - tools/install.git/blob - config_files/netgen-4.3.sh
Salome HOME
Update for version 3.0.0
[tools/install.git] / config_files / netgen-4.3.sh
1 #!/bin/sh
2
3 check_version()
4 {
5 # check existance of netgen
6 # unfortunarely we can't find anything about netgen version
7 if [ -n "$NETGENROOT" ]; then
8   return 0
9 fi
10 return 1
11 }
12
13 print_env()
14 {
15 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
16 #$DELIM ${PRODUCT_TYPE} $DELIM
17 export NETGENHOME=\${INSTALL_ROOT}/${PRODUCT}
18 ##
19 EOF
20 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
21 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
22 }
23
24 # looks for the native product and collects it's environment (used by make_env())
25 try_native(){
26 check_version
27 if [ $? -eq 0 ] ; then
28     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
29 #$DELIM ${PRODUCT_TYPE} $DELIM
30 export NETGENHOME=\${NETGENROOT}
31 ##
32 EOF
33     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
34     return 0
35 fi
36 return 1;
37 }
38
39 try_preinstalled(){
40 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
41 return $?
42 }
43
44 install_source()
45 {
46 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
47 source ${INSTALL_WORK}/$SHRC
48
49 makedir ${PRODUCT_DIR}
50
51 check_jb tar xfz ${SOURCE_DIR}/netgen-4.3.tar.gz -C ${INSTALL_WORK}
52
53 export MACHINE=LINUX
54
55 for directory in csg general geom2d gprim interface linalg meshing opti stlgeom ; do
56     cd ${PRODUCT_WORK}/libsrc/${directory}
57     check_job ${PRODUCT_DIR}/MAKE.LOG make
58 done
59
60 mkdir -p ${PRODUCT_DIR}/lib/LINUX
61 cp -f ${PRODUCT_WORK}/lib/LINUX/* ${PRODUCT_DIR}/lib/LINUX
62 mkdir -p ${PRODUCT_DIR}/include
63 cp -f ${PRODUCT_WORK}/libsrc/interface/nglib.h ${PRODUCT_DIR}/include
64
65 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
66 rm -fr ${PRODUCT_WORK}
67 print_env
68 }
69
70 install_binary()
71 {
72 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
73 source ${INSTALL_WORK}/$SHRC
74
75 check_jb tar xfz ${SOURCE_DIR}/netgen-4.3.tar.gz -C ${INSTALL_ROOT}
76
77 print_env
78 }
79
80 export PROCEDURE=$1;
81 export INSTALL_WORK=$2;
82 export SOURCE_DIR=$3;
83 export INSTALL_ROOT=$4;
84 export PRODUCT_SEQUENCE=$5;
85 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="netgen" ; fi
86 export PRODUCT="netgen-4.3"
87 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
88 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
89 source ./common.sh
90 $PROCEDURE