SUMMARY="GNU's basic cryptographic library"
DESCRIPTION="Libgcrypt is a general purpose crypto library based on the code \
used in GnuPG."
HOMEPAGE="http://directory.fsf.org/project/libgcrypt/" 
LICENSE="GNU LGPL v3"
REVISION="1"

ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"


SOURCE_URI="ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-$portVersion.tar.bz2"
CHECKSUM_SHA256="41b4917b93ae34c6a0e2127378d7a4d66d805a2a86a09911d4f9bd871db7025f"
COPYRIGHT="2000-2013 Free Software Foundation, Inc."
PATCHES="libgcrypt-$portVersion.patchset"

PROVIDES="
	libgcrypt${secondaryArchSuffix} = $portVersion compat >= 1.6
	lib:libgcrypt${secondaryArchSuffix} = 20.0.3 compat >= 20
	"
REQUIRES="
	haiku${secondaryArchSuffix}
	lib:libgpg_error${secondaryArchSuffix}
	"
PROVIDES_devel="
	libgcrypt${secondaryArchSuffix}_devel = $portVersion compat >= 1.6
	devel:libgcrypt$secondaryArchSuffix = 20.0.3 compat >= 20
	cmd:dumpsexp$secondaryArchSuffix = $portVersion compat >= 1.6
	cmd:libgcrypt_config$secondaryArchSuffix = $portVersion compat >= 1.6
	cmd:hmac256$secondaryArchSuffix = $portVersion compat >= 1.6
	cmd:mpicalc$secondaryArchSuffix = $portVersion compat >= 1.6
	"
REQUIRES_devel="
	libgcrypt${secondaryArchSuffix} == $portVersion base
	haiku${secondaryArchSuffix}
	libgpg_error${secondaryArchSuffix}
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libgpg_error${secondaryArchSuffix}
	"
BUILD_PREREQUIRES="
	cmd:autoconf
	cmd:make
	cmd:gcc${secondaryArchSuffix}
	"

BUILD()
{
	autoconf
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libgcrypt

	packageEntries devel \
		$developDir $binDir
}
