SUMMARY="A library to import many e-book formats"
DESCRIPTION="libe-book is a library and set of tools for reading and \
converting various reflowable e-book formats."
HOMEPAGE="https://sourceforge.net/projects/libebook/"
COPYRIGHT="David Tardon"
LICENSE="MPL v2.0"
REVISION="3"
SOURCE_URI="http://prdownloads.sourceforge.net/libebook/libe-book-$portVersion.tar.bz2"
CHECKSUM_SHA256="5170222409c13b75ffafa99a42b1125e16202e3ba5fa40be37e9b7e2edca95aa"
SOURCE_DIR="libe-book-$portVersion"

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

PROVIDES="
	libebook$secondaryArchSuffix = $portVersion
	cmd:ebook2html$secondaryArchSuffix
	cmd:ebook2raw$secondaryArchSuffix
	cmd:ebook2text$secondaryArchSuffix
	lib:libe_book_0.1$secondaryArchSuffix = 1.0.3 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libicui18n$secondaryArchSuffix >= 66
	lib:liblangtag$secondaryArchSuffix
	lib:librevenge_0.0$secondaryArchSuffix
	lib:librevenge_generators_0.0$secondaryArchSuffix
	lib:librevenge_stream_0.0$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	libebook${secondaryArchSuffix}_devel = $portVersion
	devel:libe_book_0.1$secondaryArchSuffix = 1.0.3 compat >= 1
	"
REQUIRES_devel="
	libebook$secondaryArchSuffix == $portVersion base
	"

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

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

INSTALL()
{
	make install

	rm $libDir/libe-book-0.1.la

	prepareInstalledDevelLibs libe-book-0.1
	fixPkgconfig

	packageEntries devel $developDir
}

TEST()
{
	make check
}
