#/bin/sh

. ./_clfsset.sh
. ./_6clfsset.sh

APPNAME=bzip2
VER=1.0.6
TARGET=$APPNAME-$VER
TARGETBALL=$TARGET.tar.gz
TARGETDIR=$TARGET

cd $SRC

echo $TARGET

RemoveSrcDir

. $WRK/_extract.sh

cd $TARGETDIR

TimeStart

cp Makefile{,.orig}
sed -e 's@^\(all:.*\) test@\1@g' \
    -e 's@/lib\(/\| \|$\)@/lib64\1@g' Makefile.orig > Makefile

echo Making...
make CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" \
        1> $LOG/$THISFILE.2_make.log 2>&1 || exit 1

echo Installing...
make PREFIX=/tools install \
        1> $LOG/$THISFILE.3_install.log 2>&1 || exit 1

TimeEnd

cd ..
RemoveSrcDir

echo Done.

