SUMMARY="A library for importing WordPerfect (tm) documents"
DESCRIPTION="
libwpd is a C++ library designed to help process WordPerfect documents. It is \
most commonly used to import WordPerfect documents into other word processors \
(see below), but may be useful in other cases as well.
"
HOMEPAGE="http://sourceforge.net/projects/libwpd/"
SOURCE_URI="http://prdownloads.sourceforge.net/libwpd/libwpd-$portVersion.tar.bz2"
LICENSE="
	MPL v2.0
	GNU LGPL v2.1
	"
COPYRIGHT="
	William Lachance
	Marc Maurer
	Fridrich Strba
	"
REVISION="2"
CHECKSUM_SHA256="f2bf5d65156a351ce404550dd822c8db8ab8740b393f61dba828d1b2cb33fe91"

ARCHITECTURES="x86 ?x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libwpd$secondaryArchSuffix = $portVersion
	cmd:wpd2html$secondaryArchSuffix
	cmd:wpd2raw$secondaryArchSuffix
	cmd:wpd2text$secondaryArchSuffix
	lib:libwpd_0.10$secondaryArchSuffix = 10.0.0 compat >= 10
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:librevenge_0.0$secondaryArchSuffix
	lib:librevenge_generators_0.0$secondaryArchSuffix
	lib:librevenge_stream_0.0$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	lib:libgcc_s$secondaryArchSuffix
	"
BUILD_REQUIRES="
	devel:librevenge_0.0$secondaryArchSuffix
	devel:librevenge_generators_0.0$secondaryArchSuffix
	devel:librevenge_stream_0.0$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:aclocal
	cmd:libtoolize
	cmd:autoconf
	cmd:automake
	cmd:autoheader
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:awk
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoheader
	automake -a -c --foreign
	autoconf
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libwpd-0.10
	fixPkgconfig

	packageEntries devel $developDir
}

PROVIDES_devel="
	libwpd${secondaryArchSuffix}_devel = $portVersion
	devel:libwpd_0.10$secondaryArchSuffix = 10.0.0 compat >= 10
	"
REQUIRES_devel="
	libwpd$secondaryArchSuffix == $portVersion base
	"
