PKGNAME=ncurses-5.6
ARCHIVE=ncurses_5.6+20070716.orig.tar.gz
SRCDIR=ncurses-5.6+20070716
CONFIG_OPTS=--with-shared

pre_config()
{
	cd ncurses-5.6+20070716
	zcat $1/ncurses_5.6+20070716-1ubuntu3.diff.gz | patch -p1
	cd ..
}

pre_build()
{
    test;
}

post_build()
{
	echo Copying dev files to environment
	root=$1/root/mnt/HD_a2/fun_plug.d
	toolpath=$(dirname $(dirname $(which ${CC})))
	if [ "x$toolpath" != x ]; then
		cp -a $root/include/* "$toolpath/include/"
		cp -a $root/lib/* "$toolpath/lib/"
		cp -a $root/bin/* "$toolpath/bin/"
	fi

	echo Stripping binaries
	${STRIP} $root/lib/*.so.5.6

	echo Removing unnecessary files
	rm -rf $root/include
	rm -rf $root/bin
	rm -rf $root/man
	rm -rf $root/lib/*.a
}
