SUMMARY="Full-featured Jabber/XMPP client library"
DESCRIPTION="Rock-solid, full-featured Jabber/XMPP client library, written in clean ANSI C++."
HOMEPAGE="https://camaya.net/gloox/"
COPYRIGHT="2002-2020 Jakob Schröter"
LICENSE="GNU GPL v2"
REVISION="3"
SOURCE_URI="http://camaya.net/download/gloox-$portVersion.tar.bz2"
CHECKSUM_SHA256="ae1462be2a2eb8fe5cd054825143617c53c2c9c7195606cb5a5ba68c0f68f9c9"
PATCHES="gloox-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"

libVersion="18.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
	gloox$secondaryArchSuffix = $portVersion
	lib:libgloox$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libcrypto$secondaryArchSuffix
	lib:libssl$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	gloox${secondaryArchSuffix}_devel = $portVersion
	cmd:gloox_config$secondaryArchSuffix
	devel:libgloox$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	gloox$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libcrypto$secondaryArchSuffix
	devel:libssl$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:autoreconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

defineDebugInfoPackage gloox$secondaryArchSuffix \
	$libDir/libgloox.so.$libVersion

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

INSTALL()
{
	make install

	rm $libDir/libgloox.la $libDir/libgloox.a

	# prepare development lib links
	prepareInstalledDevelLib libgloox

	fixPkgconfig

	# devel package
	packageEntries devel $developDir $binDir
}

TEST()
{
	make check
}
