# SliTaz package receipt.

PACKED_SIZE="320.0K"
UNPACKED_SIZE="680.0K"
PACKAGE="nettle"
VERSION="3.7.3"
CATEGORY="security"
SHORT_DESC="A cryptographic library that is designed to fit easily in more or less any context."
MAINTAINER="devl547@gmail.com"
LICENSE="LGPL2.1"
WEB_SITE="https://www.lysator.liu.se/~nisse/nettle/"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"

DEPENDS="gcc83-lib-base gmp"
BUILD_DEPENDS="gcc83 gmp-dev"

HOST_ARCH="i486 arm"
		
# Handle cross compilation.
case "$ARCH" in
	arm) 
		ARCH_ARGS="--enable-arm-neon" ;;
esac

# What is the latest version available today?
current_version()
{
	wget -O - https://ftp.gnu.org/gnu/$PACKAGE/ 2>/dev/null | \
	sed "/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
	./configure			\
		CC=gcc-83		\
		CXX=g++-83		\
		--libdir=/usr/lib	\
		--enable-shared		\
		$CONFIGURE_ARGS		\
		${ARCH_ARGS} && 
	make &&
	make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	cook_copy_folders	bin
	cook_copy_files		*.so*
}
