check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
rm -fr ${PRODUCT_WORK}
+
+### modify libmed.la libmedC.la files to correct direct path to hdf5 library
+cd ${PRODUCT_DIR}/lib
+tmp=""
+if [ -n "${HDF5HOME}" ]; then
+ tmp="-L${HDF5HOME}/lib"
+fi
+sed -e "s%\(.*\)\([[:space:]].*-L.*/hdf5-1\.4\.4/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libmed.la > libmed.la.new
+mv -f libmed.la.new libmed.la
+
print_env
}
check_jb tar xfz ${SOURCE_DIR}/med-2.1.6.tar.gz -C ${INSTALL_ROOT}
+### modify libmed.la libmedC.la files to correct direct path to hdf5 library
+### also modify libmed.la and libmedC.la files to correct direct path to med libraries
+### no need to do this for sources installation because 'make install' does it!
+cd ${PRODUCT_DIR}/lib
+sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libmed.la > libmed.la.new
+mv -f libmed.la.new libmed.la
+tmp=""
+if [ -n "${HDF5HOME}" ]; then
+ tmp="-L${HDF5HOME}/lib"
+fi
+sed -e "s%\(.*\)\([[:space:]].*-L.*/hdf5-1\.4\.4/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libmed.la > libmed.la.new
+mv -f libmed.la.new libmed.la
+
print_env
}