SUMMARY="Library to read Adobe PageMaker files"
DESCRIPTION="Libpagemaker is a library that parses the file format of \
Aldus/Adobe PageMaker documents. Currently it only understands documents \
created by PageMaker version 6.x and 7."
LICENSE="MPL v2.0"
COPYRIGHT="2013-2014 Fridrich Štrba
	2014 Anurag Kanungo
	2014 Brennan Vincent
	2014 David Tardon"
HOMEPAGE="https://wiki.documentfoundation.org/DLP/Libraries/libpagemaker"
SOURCE_URI="http://dev-www.libreoffice.org/src/libpagemaker/libpagemaker-0.0.2.tar.xz"
CHECKSUM_SHA256="cdbdf86605773339caab6477ff694a95a90aaa4d45bb6cdb59e4a7f76c91ef17"
REVISION="1"
ARCHITECTURES="x86 ?x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libpagemaker$secondaryArchSuffix = $portVersion compat >= 0
	cmd:pmd2raw$secondaryArchSuffix = $portVersion compat >= 0
	cmd:pmd2svg$secondaryArchSuffix = $portVersion compat >= 0
	lib:libpagemaker_0.0$secondaryArchSuffix = $portVersion compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	librevenge${secondaryArchSuffix}
	lib:libboost_system$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
PROVIDES_devel="
	libpagemaker${secondaryArchSuffix}_devel = $portVersion compat >= 0
	devel:libpagemaker_0.0$secondaryArchSuffix = $portVersion compat >= 0
	"
REQUIRES_devel="
	libpagemaker${secondaryArchSuffix} == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	librevenge${secondaryArchSuffix}_devel
	devel:libboost_system$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:libtoolize
	cmd:aclocal
	cmd:autoheader
	cmd:automake
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:awk
	cmd:pkg_config$secondaryArchSuffix
	"

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

INSTALL()
{
	make install

	# set up the develop directory correctly
	prepareInstalledDevelLibs \
		libpagemaker-0.0
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}
