#!/bin/bash

NAME=${coreutils[0]}
PROGRAM=${coreutils[3]}
FILE=${coreutils[2]}
EXT=${coreutils[4]}
DLINK=${coreutils[1]}
MD5=${coreutils[5]}

download ${DLINK}

waitUser

check ${FILE} ${MD5}

waitUser

unpack ${EXT}

waitUser

startBuild

cd $BUILD_DIR/$PROGRAM
{
	./configure --prefix=/tools --enable-install-program=hostname || exit 1
	StartMake
	waitUser
	make|| exit 1
	waitUser
	c_MakeTest RUN_EXPENSIVE_TESTS=yes check || exit 1
	StartMakeInstall
	waitUser
	make install || exit 1
	waitUser
	cp -v src/su /tools/bin/su-tools
} 2>&1 | tee $BUILD_DIR/LOG_$PROGRAM.log
if [ $PIPESTATUS -ne 0 ]
	then
		echo -e "$L_FAIL_BUIL"
		exit 1
fi  	

waitUser
RMsource
cd $ROOT
