# install sources
install_source
+# build sources
+cd ${PRODUCT_SRC_DIR}
+test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
+
+# patch for 64bit platforms
+if test `uname -m` = "x86_64" ; then
+ sed -e "s%COPTIONS[[:space:]]*=[[:space:]]*\(.*\)%COPTIONS = -fPIC \1%g" Makefile.in > Makefile.in.new
+ mv Makefile.in.new Makefile.in
+fi
+
+# make
+check_job ${PRODUCT_DIR}/MAKE.LOG make
+
+# install
+cp -rf Doc Graphs libmetis.a pmetis kmetis oemetis onmetis partdmesh partnmesh mesh2dual mesh2nodal graphchk ${PRODUCT_DIR}
+( mkdir -p ${PRODUCT_DIR}/Lib && cp Lib/*.h ${PRODUCT_DIR}/Lib )
+
+cd ${PRODUCT_DIR};
+
# remove sources and temporary files after building
if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
fi
-# install binary
-install_binary
+# to generate environment scripts
+try_preinstalled
}
install_binary()