# SliTaz package receipt.

PACKAGE="libffi"
VERSION="3.3"
CATEGORY="development"
SHORT_DESC="A portable foreign function interface library."
MAINTAINER="rcx@zoominternet.net"
DEPENDS="glibc-base"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://sourceware.org/libffi/"
WGET_URL="ftp://sourceware.org/pub/$PACKAGE/$TARBALL"

# Rules to configure and make the package.
compile_rules()
{
	cd $src
	./configure \
		--includedir=/usr/include \
		$CONFIGURE_ARGS  &&
	make  &&
	make DESTDIR=$DESTDIR install
}

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

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