SUMMARY="C++ unit testing framework"
DESCRIPTION="CppUnit is a C++ unit testing framework. It started its life as \
a port of JUnit to C++ by Michael Feathers."
HOMEPAGE="https://www.freedesktop.org/wiki/Software/cppunit/"
COPYRIGHT="2000 Jerome Lacoste
	2000 Michael Feathers
	2000-2002 E. Sommerlade
	2001-2013 Baptiste Lepilleur
	2001 Bastiaan Bakker
	2001-2002, 2007-2008 Steve Robbins
	2012-2013 Harvey Brydon"
LICENSE="GNU LGPL v2.1"
REVISION="4"
SOURCE_URI="https://dev-www.libreoffice.org/src/cppunit-$portVersion.tar.gz"
CHECKSUM_SHA256="3d569869d27b48860210c758c4f313082103a5e58219a7669b52bfd29d674780"

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

libVersion="0.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
portVersionCompat="$portVersion compat >= ${portVersion%%.*}"
portVers="${portVersion%.*}"

PROVIDES="
	cppunit$secondaryArchSuffix = $portVersion
	cmd:DllPlugInTester$secondaryArchSuffix = $portVersionCompat
	lib:libcppunit$secondaryArchSuffix = $libVersionCompat
	lib:libcppunit_$portVers$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	cppunit${secondaryArchSuffix}_devel = $portVersion
	devel:libcppunit$secondaryArchSuffix = $libVersionCompat
	devel:libcppunit_$portVers$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	cppunit$secondaryArchSuffix == $portVersion base
	haiku${secondaryArchSuffix}_devel
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:autoreconf
	cmd:g++$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:sed
	"

defineDebugInfoPackage cppunit$secondaryArchSuffix \
	$libDir/libcppunit-$portVers.so.$libVersion

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

INSTALL()
{
	make install

	rm $libDir/libcppunit.la

	prepareInstalledDevelLibs libcppunit-$portVers libcppunit
	fixPkgconfig

	packageEntries devel $developDir
}
