# building maxbin2
#tar -xvf getfile.php?MaxBin-2.2.5.tar.gz
#cd MaxBin-2.2.5/src
ls -l
cd src
make
cd ../

# building auxiliary packages
./autobuild_auxiliary > errors


# copying over all necessary files
mkdir -p $PREFIX/bin/
mkdir -p $PREFIX/bin/src/

cp bacar_marker.hmm $PREFIX/bin/
cp heatmap.r $PREFIX/bin/
cp marker.hmm $PREFIX/bin/
cp _sepReads.pl $PREFIX/bin/
cp -r src/MaxBin $PREFIX/bin/src/


for f in buildapp _getabund.pl _getmarker.pl run_MaxBin.pl; do
	echo '#!/usr/bin/env perl' > $PREFIX/bin/$f
	echo 'use warnings;' >> $PREFIX/bin/$f
	cat $f | grep -v '#!/usr/bin/perl -w' >> $PREFIX/bin/$f
	chmod +x $PREFIX/bin/$f
done

