	#!/bin/bash
        #Builds all binaries
        /bin/rm -r bin
	/bin/mkdir  bin
#build the src tar files, we include these in the
#rpm because users amy want to rebult the codes
        cd src
        tar cvzf bonnie++-1.01c.tgz bonnie++-1.01c 
        tar cvzf netperf-2.1pl3.tar.gz netperf-2.1pl3
        tar cvzf  npb.tar.gz npb
        tar cvzf unixbench.tar.gz unixbench

        tar cvzf stream.tar.gz stream
        tar cvzf netpipe.tar.gz netpipe-2.4
#needed to fix a make issue
	touch LMbench/scripts/*
        tar cvzf lmbench-2.0-patch1.tgz LMbench
#now start building
	cd bonnie++-1.01c
	./configure 
	make  
	cp bonnie++ ../../bin/bonnie++ 
	make clean
	cd ..; 
	cd netpipe-2.4; 
	make TCP; 
	cp NPtcp  ../../bin/NPtcp 
	make clean
	cd ..; 
	cd netperf-2.1pl3; 
	make; 
	cp netperf  ../../bin/netperf 
	cp netserver  ../../bin/netserver 
	make clean
	cd ..; 
	cd stream; 
	gcc -o stream-wall stream_d.c second_wall.c -lm
	cp  stream-wall ../../bin/stream-wall 
	/bin/rm stream-wall
	cd ..; 
	cd ..; 
	cp bps-html/bps-html.pl bin/bps-html
	cp bps-html/netpipe.network_signature_graph.gp bin
	cp bps-html/netpipe.throughput_vs_blocksize.gp bin
	#cp xbps/xbps.py bin/xbps
	cp src/sedscr bin/sedscr
	cp src/bps bin/bps
