SUMMARY="X Display Manager Control Protocol library"
DESCRIPTION="libXdmcp - X Display Manager Control Protocol library."
HOMEPAGE="https://www.x.org/releases/individual/lib/"
COPYRIGHT="1989-2004 The Open Group
	2006 Keith Packard"
LICENSE="MIT (no promotion)"
REVISION="1"
SOURCE_URI="https://www.x.org/archive/individual/lib/libXdmcp-$portVersion.tar.bz2"
CHECKSUM_SHA256="20523b44aaa513e17c009e873ad7bbc301507a3224c232610ce2e099011c6529"
SOURCE_DIR="libXdmcp-$portVersion"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

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

PROVIDES="
	libxdmcp$secondaryArchSuffix = $portVersion
	lib:libXdmcp$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libxdmcp${secondaryArchSuffix}_devel = $portVersion
	devel:libXdmcp$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	libxdmcp$secondaryArchSuffix == $portVersion base
	devel:xproto
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	docbook_xml_dtd
	docbook_xsl_stylesheets
	devel:util_macros
	devel:xorg_sgml_doctools
	devel:xproto
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:xmlto
	cmd:xsltproc
	"

defineDebugInfoPackage libxdmcp$secondaryArchSuffix \
	$libDir/libXdmcp.so.$libVersion

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

INSTALL()
{
	make install

	rm -f $libDir/*.la

	prepareInstalledDevelLib libXdmcp
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}
