# SliTaz package receipt.

PACKAGE="ncurses"
VERSION="6.3"
CATEGORY="base-system"
SHORT_DESC="Library of functions to manage display on terminals."
DEPENDS="libtic libtinfo ncurses-common"
BUILD_DEPENDS="gcc"
MAINTAINER="pankso@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://invisible-island.net/ncurses/"
WGET_URL="$GNU_MIRROR/ncurses/$TARBALL"

# Rules to compile & install the temporary toolchain.
cook_tmp_toolchain()
{
	cd $src
	./configure --with-shared --without-debug \
		--without-ada --enable-overwrite &&
	make && make install
}

# Rules to configure and make the package.
compile_rules()
{
	cd $src
	sed -i 's|\tsh $(srcdir)/MKhashsize.sh|\tash $(srcdir)/MKhashsize.sh|' \
		include/Makefile.in
	./configure \
		--libdir=/lib \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--with-shared \
		--without-debug \
		--without-ada \
                --with-termlib \
                --with-ticlib \
		--build=$HOST_SYSTEM \
		--host=$HOST_SYSTEM  &&
	make && make install
}

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

post_install()
{
    # create symlink to libncurses.so.5
    # keep compat with stable repo before mass rebuild
    cd $root/lib
    ln -sf libncurses.so.6 libncurses.so.5
}