#!/bin/sh

. ./_blfsset.sh

APPNAME=unzip
VER=6.0
TARGET=$APPNAME-$VER
TARGETBALL=$DLD/${APPNAME}60.tar.gz
TARGETDIR=${APPNAME}60

echo $TARGET
. $WRK/_checkRequired.sh ""
. $WRK/_checkOptions.sh  ""
. $WRK/_checkTarball.sh
. $WRK/_checkExit.sh "$1" || exit $?

cd $SRC
RemoveSrcDir
Extract

TimeStart

cd $TARGETDIR

#Making
#case `uname -m` in
#  i?86)
#    sed -i -e 's/DASM"/DASM -DNO_LCHMOD"/' unix/Makefile
#    make -f unix/Makefile linux \
#	1> $LOG/$TARGET.2_make.log 2>&1 || exit 1
#    ;;
#  *)
#    sed -i -e 's/CFLAGS="-O -Wall/& -DNO_LCHMOD/' unix/Makefile
#    make -f unix/Makefile linux_noasm \
#	1> $LOG/$TARGET.2_make.log 2>&1 || exit 1
#    ;;
#esac

Making
make -f unix/Makefile generic \
	1> $LOG/$TARGET.2_make.log 2>&1 || exit 1

Installing
porg -lp $TARGET "\
make prefix=/usr MANDIR=/usr/share/man/man1 \
 -f unix/Makefile install" \
	1> $LOG/$TARGET.3_install.log 2>&1 || exit 1

TimeEnd

cd ..
RemoveSrcDir
PorgingDone

