#!/bin/bash

#Some cleanup
rm -rf install metis-4.0
mkdir install

#Untar 
tar -zxvf  metis-4.0.tar.gz

#Move metis into install directory
mv metis-4.0/* install
rm -rf metis-4.0

#Apply patches
cd install 
patch -p1 < ../metis-4.0.patch
patch -R Lib/Makefile ../configs/4.0/win7/Makefile.patch
patch -R Makefile.in ../configs/4.0/win7/Makefile.in.patch

#Compile
make
