SUMMARY="A set of C subroutines for indexing sets of key/value pairs"
DESCRIPTION="AVLDupTree is a set of C subroutines (not C++, so you can use it \
in drivers) that is useful for indexing a set of key/value pairs, using the \
key to find a matching value.
The standard AVL balanced binary tree algorithm is enhanced to support \
multiple values for the same key.  It is designed for future use in a file \
system to support fast attribute indexing and queries, but you can use it for \
other things. This package also includes the AGMSAVLTest GUI App. It tests \
the operations on the tree, provided by libavlduptree."
HOMEPAGE="https://github.com/HaikuArchives/AVLDupTree"
COPYRIGHT="2001 Alexander G. M. Smith"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="git+https://github.com/HaikuArchives/AVLDupTree.git#5969ca7e26e65857a9ade8ed6abee2fda7f1e9d9"

ARCHITECTURES="?all x86_gcc2"
SECONDARY_ARCHITECTURES="x86_gcc2 ?x86"

PROVIDES="
	libavlduptree$secondaryArchSuffix = $portVersion
	lib:libavlduptree$secondaryArchSuffix = 1.0.0 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

PROVIDES_devel="
	libavlduptree${secondaryArchSuffix}_devel = $portVersion
	devel:libavlduptree$secondaryArchSuffix = 1.0.0 compat >= 1
	"
REQUIRES_devel="
	libavlduptree${secondaryArchSuffix} == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:mkdir
	"

BUILD()
{
	make $jobArgs
}

INSTALL()
{
	mkdir -p $libDir
	make install INSTALL_DIR=$libDir

	# set up the develop directory correctly
	prepareInstalledDevelLibs libavlduptree

	# devel package
	packageEntries devel $developDir
}
