# SliTaz package receipt.

PACKED_SIZE="192.0K"
UNPACKED_SIZE="1.1M"
PACKAGE="gnutls"
VERSION="3.3.16"
CATEGORY="security"
SHORT_DESC="GNU Transport Layer Security Library"
MAINTAINER="erjo@slitaz.org"
LICENSE="GPL3"
TARBALL="$PACKAGE-$VERSION.tar.lz"
WEB_SITE="http://www.gnu.org/software/gnutls/"
WGET_URL="ftp://ftp.gnutls.org/gcrypt/gnutls/v${VERSION%.*}/$TARBALL"
HOST_ARCH="i486 arm"

DEPENDS="nettle libgpg-error ncurses readline zlib gcc-lib-base 
libgnutls libcrypto libtasn1"
BUILD_DEPENDS="libtasn1-dev ncurses-dev readline-dev nettle-dev 
libgpg-error-dev libgcrypt-dev libcrypto-dev gmp-dev lzip"
SUGGESTED="cacerts"

# Handle SliTaz arch.
case "$SLITAZ_ARCH" in
	i?86) DEPENDS="$DEPENDS p11-kit" ;;
esac

# Handle cross compilation.
case "$ARCH" in
	i?86) 
		BUILD_DEPENDS="$BUILD_DEPENDS p11-kit-dev cacerts" ;;
	arm*) 
		ARCH_ARGS="--with-libgcrypt-prefix=/cross/$ARCH/sysroot/usr \
		--without-p11-kit --disable-rpath" ;;
esac

# Rules to configure and make the package.
compile_rules()
{
	./configure \
		--with-libgcrypt \
		--disable-guile \
		--with-zlib \
		--with-default-trust-store-file="/etc/ssl/ca-bundle.crt" \
		$CONFIGURE_ARGS ${ARCH_ARGS} &&
	make && make install
}

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