SUMMARY="Zoner Callisto/Draw import library"
DESCRIPTION="Libzmf is a library that parses the file format \
of Zoner Callisto/Draw documents. Currently it only understands documents \
created by Zoner Draw version 4 and 5."
HOMEPAGE="https://wiki.documentfoundation.org/DLP/Libraries/libzmf"
COPYRIGHT="2013-2017 David Tardon
	2016 Aleksas Pantechovskis"
LICENSE="MPL v2.0"
REVISION="5"
SOURCE_URI="https://dev-www.libreoffice.org/src/libzmf/libzmf-$portVersion.tar.xz"
CHECKSUM_SHA256="27051a30cb057fdb5d5de65a1f165c7153dc76e27fe62251cbb86639eb2caf22"

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

PROVIDES="
	libzmf$secondaryArchSuffix = $portVersion
	cmd:zmf2raw$secondaryArchSuffix = $portVersion
	cmd:zmf2svg$secondaryArchSuffix = $portVersion
	lib:libzmf_0.0$secondaryArchSuffix = $portVersion compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libicui18n$secondaryArchSuffix >= 66
	lib:libpng16$secondaryArchSuffix
	lib:librevenge_0.0$secondaryArchSuffix
	lib:librevenge_generators_0.0$secondaryArchSuffix
	lib:librevenge_stream_0.0$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	libzmf${secondaryArchSuffix}_devel = $portVersion
	devel:libzmf_0.0$secondaryArchSuffix = $portVersion compat >= 0
	"
REQUIRES_devel="
	libzmf$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libboost_math_c99$secondaryArchSuffix >= 1.57.0
	devel:libboost_system$secondaryArchSuffix >= 1.57.0
	devel:libcppunit$secondaryArchSuffix
	devel:libicui18n$secondaryArchSuffix >= 66
	devel:libpng16$secondaryArchSuffix
	devel:librevenge_0.0$secondaryArchSuffix
	devel:librevenge_generators_0.0$secondaryArchSuffix
	devel:librevenge_stream_0.0$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:autoheader
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

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

INSTALL()
{
	make install

	rm $libDir/libzmf-0.0.la

	prepareInstalledDevelLibs libzmf-0.0
	fixPkgconfig

	packageEntries devel $developDir
}

TEST()
{
	make check
}
