cd $root/src

if [ -z $WGET ]; then

 notice "$MENUFALSE" " WGet utility not installed...\n"

 IsYNLoop "Do you want to try and download it right now with lynx and install it?"
        case "$?" in
            $NO)
                echo -e "Moving on without wget, please make sure all the sources you'll need are in \"$root/src\"!\n
		You can get them from http://www.apachetoolbox.com/data/cvs/src/ if you need to."
                HitAnyKey
                ;;
            $YES)


	  if [ ! -f wget-$WGETV.tar.gz ]; then
	   echo "wget-$WGETV.tar.gz detection failed, downloading..."
	   $LYNX -dump ftp://ftp.gnu.org/gnu/wget/wget-$WGETV.tar.gz > wget-$WGETV.tar.gz
	  fi

	  if [ ! -f wget-$WGETV.tar.gz ]; then
	   echo "wget-$WGETV.tar.gz download failed from ftp.gnu.org, trying from apachetoolbox.com..."
	   $LYNX -dump http://www.apachetoolbox.com/data/cvs/src/wget-$WGETV.tar.gz > wget-$WGETV.tar.gz
	  fi

	  if [ ! -f wget-$WGETV.tar.gz ]; then
	   echo "failed to download wget-$WGETV.tar.gz from anywhere. exiting."
	   exit 1
	  fi


	 explode "wget-$WGETV.tar.gz"
	 echo uncompressed wget...
	 cd wget-$WGETV

	notice $MENUTRUE " Configuring..."
	 ./configure --prefix=$LOCAL_PATH > $logdir/wget-configure.log
	 testcheck $? wget-configure.log
	echo " [$DONE]"

	notice $MENUTRUE " Compiling..."
	 $MAKE > $logdir/wget-compile.log
	 testcheck $? wget-compile.log
	echo " [$DONE]"

	notice $MENUTRUE " Installing into $LOCAL_PATH..."
	 inst wget
	 testcheck $? wget-install.log
	echo " [$DONE]"

	 cd ..
	 rm -rf $root/src/wget-$WGETV
	 if [ ! -x $LOCAL_PATH/bin/wget ];then notice "$MENUFALSE" "WGet was't automatically installed, manually install it.\n"; exit; fi
     ;;
        esac

fi
cd $root
