]> SALOME platform Git repositories - tools/install.git/blob - config_files/netgen-4.5.sh
Salome HOME
Remove HappyDoc dependencies
[tools/install.git] / config_files / netgen-4.5.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.5.tar.gz -C ${INSTALL_WORK}
52
53 export MACHINE=LINUX
54
55 # apply patch: to make compilable on latest versions of gcc
56 (cd ${PRODUCT_WORK}/libsrc/meshing; echo -e '14s/^$/class Mesh;\nwq' | ed - meshtype.hpp > /dev/null)
57
58 for directory in csg general geom2d gprim interface linalg meshing opti stlgeom ; do
59     cd ${PRODUCT_WORK}/libsrc/${directory}
60     check_job ${PRODUCT_DIR}/MAKE.LOG make
61 done
62
63 mkdir -p ${PRODUCT_DIR}/lib/LINUX
64 cp -f ${PRODUCT_WORK}/lib/LINUX/* ${PRODUCT_DIR}/lib/LINUX
65 mkdir -p ${PRODUCT_DIR}/include
66 cp -f ${PRODUCT_WORK}/libsrc/interface/nglib.h ${PRODUCT_DIR}/include
67
68 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
69 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
70 print_env
71 }
72
73 install_binary()
74 {
75 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
76 source ${INSTALL_WORK}/$SHRC
77
78 check_jb tar xfz ${SOURCE_DIR}/netgen-4.5.tar.gz -C ${INSTALL_ROOT}
79
80 print_env
81 }
82
83 export PROCEDURE=$1;
84 export INSTALL_WORK=$2;
85 export SOURCE_DIR=$3;
86 export INSTALL_ROOT=$4;
87 export PRODUCT_SEQUENCE=$5;
88 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="netgen" ; fi
89 export PRODUCT="netgen-4.5"
90 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
91 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
92 source ./common.sh
93 $PROCEDURE