#!/bin/bash

source /scripts/BLFS/variables

source $SCRIPTS_DIR/include/functions

NAME=freetype
PROGRAM=freetype-2.4.4
FILE=freetype-2.4.4.tar.bz2
EXT=bzip
DLINK=http://downloads.sourceforge.net/freetype/${FILE}
MD5=b3e2b6e2f1c3e0dffa1fd2a0f848b671

download ${DLINK}
waitUser
check ${FILE} ${MD5}
waitUser
unpack ${EXT}

cd $BUILD_DIR/$PROGRAM
{
sed -i -r 's:.*(#.*SUBPIXEL.*) .*:\1:' \
          include/freetype/config/ftoption.h &&
	echo "$G $PROGRAM/configure   $DEF"
	waitUser
./configure --prefix=/usr

	StartMake
	waitUser
	make || exit 1

	StartMakeInstall
	waitUser
	make install || exit 1
install -v -m755 -d /usr/share/doc/freetype-2.4.4 
cp -v -R docs/*     /usr/share/doc/freetype-2.4.4

} 2>&1 | tee $BUILD_DIR/LOG_$PROGRAM.log
if [ $PIPESTATUS -ne 0 ]
	then
		echo -e "$L_FAIL_BUIL"
		exit 1
fi  	 

RMsource

cd $ROOT
