SUMMARY="Internationalized Domain Names (IDN) implementation"
DESCRIPTION="Libidn is a package for internationalized string handling based \
on the Stringprep, Punycode, IDNA and TLD specifications."
HOMEPAGE="http://www.gnu.org/software/libidn"
LICENSE="GNU LGPL v2.1"
REVISION="1"

SOURCE_URI="http://ftp.gnu.org/gnu/libidn/libidn-$portVersion.tar.gz"
CHECKSUM_SHA256="39b9fc94d74081c185757b12e0891ce5a22db55268e7d1bb24533ff4432eb053"
COPYRIGHT="2002-2014 Simon Josefsson"

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

PROVIDES="
	libidn$secondaryArchSuffix = $portVersion compat >= 1
	lib:libidn$secondaryArchSuffix = 11.6.13 compat >= 11
	cmd:idn$secondaryArchSuffix
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	"
PROVIDES_devel="
	libidn${secondaryArchSuffix}_devel = $portVersion compat >= 1
	devel:libidn$secondaryArchSuffix = 11.6.13 compat >= 11
	"
REQUIRES_devel="
	libidn$secondaryArchSuffix == $portVersion base
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libiconv$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	cmd:gettext >= 0.19.3
	cmd:find
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libidn
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir \
		$manDir/man3
}
