SUMMARY="Aldus/Macromedia/Adobe FreeHand import library"
DESCRIPTION="libcdr is a library that parses the file format of \
Aldus/Macromedia/Adobe FreeHand documents of all versions."
HOMEPAGE="https://wiki.documentfoundation.org/DLP/Libraries/libfreehand"
COPYRIGHT="Fridrich Strba, David Tardon"
LICENSE="MPL v2.0"
REVISION="3"
SOURCE_URI="http://dev-www.libreoffice.org/src/libfreehand/libfreehand-$portVersion.tar.bz2"
CHECKSUM_SHA256="1ff634f2b34223a1ab406284bb5a7de1d0d76b5da9cf7832af0a80a6b7d962f1"
PATCHES="libfreehand-$portVersion.patchset"

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

PROVIDES="
	libfreehand$secondaryArchSuffix = $portVersion
	cmd:fh2raw$secondaryArchSuffix
	cmd:fh2svg$secondaryArchSuffix
	cmd:fh2text$secondaryArchSuffix
	lib:libfreehand_0.1$secondaryArchSuffix = 1.0.2 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:liblcms2$secondaryArchSuffix
	lib:librevenge_0.0$secondaryArchSuffix
	lib:librevenge_generators_0.0$secondaryArchSuffix
	lib:librevenge_stream_0.0$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	libfreehand${secondaryArchSuffix}_devel = $portVersion
	devel:libfreehand_0.1$secondaryArchSuffix = 1.0.2 compat >= 1
	"
REQUIRES_devel="
	libfreehand$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libboost_system$secondaryArchSuffix
	devel:libcppunit$secondaryArchSuffix
	devel:libicuuc$secondaryArchSuffix >= 66
	devel:liblcms2$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:gperf
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

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

INSTALL()
{
	make install

	rm $libDir/libfreehand-0.1.la

	prepareInstalledDevelLibs libfreehand-0.1
	fixPkgconfig

	packageEntries devel $developDir
}
