# SliTaz package receipt.

PACKED_SIZE="112.0K"
UNPACKED_SIZE="312.0K"
PACKAGE="ncurses"
VERSION="5.9"
CATEGORY="base-system"
SHORT_DESC="Library of functions to manage display on terminals."
MAINTAINER="pankso@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.gz"
LICENSE="MIT"
WEB_SITE="http://invisible-island.net/ncurses/"
WGET_URL="ftp://invisible-island.net/ncurses/$TARBALL"
HOST_ARCH="i486 arm"

DEPENDS="ncurses-common"
BUILD_DEPENDS=""

# Rules to configure and make the package.
compile_rules()
{
	# Ncurses need an installed /usr/bin/tic witch is in ncursesw-extra. And
	# when cross compiling we can't use the freshly cooked binary. See cook log:
	#
	#** Building terminfo database, please wait...
	#Running /usr/bin/tic to install /home/slitaz/wok/ncurses/install/usr/share/terminfo
	#
	if [ ! -d "/var/lib/tazpkg/installed/ncursesw-extra" ]; then
		echo "Installing: ncursesw-extra"
		tazpkg get-install ncursesw-extra 2>/dev/null 1>/dev/null
	fi
	cd $src
	mkdir -p $DESTDIR/usr/lib/terminfo
	sed -i 's|\tsh $(srcdir)/MKhashsize.sh|\tash $(srcdir)/MKhashsize.sh|' \
		include/Makefile.in
	./configure \
		--libdir=/lib \
		--sysconfdir=/etc \
		--with-shared \
		--without-debug \
		--without-ada \
		--with-build-cc="gcc -D_GNU_SOURCE" \
		$CONFIGURE_ARGS &&
	make && make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/lib
    cp -a $install/lib/libncurses.so* $fs/lib
}
