5 if [ -z "$MED2HOME" ]; then
6 #echo "MED2HOME doesn't set"
9 check_lib_version libmed.so.1.0.1 ${MED2HOME}/lib
10 if [ "$?" -eq "0" ]; then
11 #echo "The product ${PRODUCT} has been already installed on yours system"
19 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
20 #$DELIM ${PRODUCT_TYPE} $DELIM
21 export MED2HOME=\${INSTALL_ROOT}/med-2.2.2
22 export PATH=\${MED2HOME}/bin:\${PATH}
23 export LD_LIBRARY_PATH=\${MED2HOME}/lib:\${LD_LIBRARY_PATH}
26 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
27 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
30 # looks for the native product and collects it's environment (used by make_env())
33 if [ $? -eq 0 ] ; then
34 tmp="\${MED2HOME}/bin ${MED2HOME}/bin \${PATH} ${PATH}";
35 path=`sort_path ${tmp}`
36 tmp="\${MED2HOME}/lib ${MED2HOME}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
37 ld_library_path=`sort_path ${tmp}`
38 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
39 #$DELIM ${PRODUCT_TYPE} $DELIM
40 export MED2HOME=${MED2HOME}
42 export LD_LIBRARY_PATH=${ld_library_path}
45 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
52 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
58 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
59 source ${INSTALL_WORK}/$SHRC
61 check_jb tar xfz ${SOURCE_DIR}/med_fichier2.2.2.src.tar.gz -C ${INSTALL_WORK}
64 makedir ${PRODUCT_DIR}
66 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR}
69 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
73 check_job ${PRODUCT_DIR}/MAKE.LOG make
74 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
76 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
77 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
79 ### modify libmed.la libmedC.la files to correct direct path to hdf5 library
81 sed -e 's%\(.*\)\([[:space:]].*libhdf5.la\)\(.*\)%\1 -lhdf5\3%g' libmed.la > libmed.la.new
82 mv -f libmed.la.new libmed.la
83 sed -e 's%\(.*\)\([[:space:]].*libhdf5.la\)\(.*\)%\1 -lhdf5\3%g' libmedC.la > libmedC.la.new
84 mv -f libmedC.la.new libmedC.la
86 if [ -n "${HDF5HOME}" ]; then
87 tmp="-L${HDF5HOME}/lib"
89 sed -e "s%\(.*\)\([[:space:]].*-L.*/hdf5-1\.6\.3/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libmed.la > libmed.la.new
90 mv -f libmed.la.new libmed.la
91 sed -e "s%\(.*\)\([[:space:]].*-L.*/hdf5-1\.6\.3/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libmedC.la > libmedC.la.new
92 mv -f libmedC.la.new libmedC.la
102 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
103 source ${INSTALL_WORK}/$SHRC
105 check_jb tar xfz ${SOURCE_DIR}/med-2.2.2.tar.gz -C ${INSTALL_ROOT}
107 ### modify libmed.la libmedC.la files to correct direct path to hdf5 library
108 ### also modify libmed.la and libmedC.la files to correct direct path to med libraries
109 ### no need to do this for sources installation because 'make install' does it!
110 cd ${PRODUCT_DIR}/lib
111 sed -e 's%\(.*\)\([[:space:]].*libhdf5.la\)\(.*\)%\1 -lhdf5\3%g' -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libmed.la > libmed.la.new
112 mv -f libmed.la.new libmed.la
113 sed -e 's%\(.*\)\([[:space:]].*libhdf5.la\)\(.*\)%\1 -lhdf5\3%g' -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libmedC.la > libmedC.la.new
114 mv -f libmedC.la.new libmedC.la
116 if [ -n "${HDF5HOME}" ]; then
117 tmp="-L${HDF5HOME}/lib"
119 sed -e "s%\(.*\)\([[:space:]].*-L.*/hdf5-1\.6\.3/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libmed.la > libmed.la.new
120 mv -f libmed.la.new libmed.la
121 sed -e "s%\(.*\)\([[:space:]].*-L.*/hdf5-1\.6\.3/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libmedC.la > libmedC.la.new
122 mv -f libmedC.la.new libmedC.la
131 export INSTALL_WORK=$2;
132 export SOURCE_DIR=$3;
133 export INSTALL_ROOT=$4;
134 export PRODUCT_SEQUENCE=$5;
135 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="med" ; fi
136 export PRODUCT="med-2.2.2"
137 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
138 export PRODUCT_WORK=${INSTALL_WORK}/med_fichier2.2.2.src