SUMMARY="Web-centric format for distributing documents and images"
DESCRIPTION="
DjVu is a web-centric format and software platform for distributing documents \
and images."
HOMEPAGE="http://djvulibre.sourceforge.net/"
COPYRIGHT="2002 Leon Bottou and Yann Le Cun.
	2001 AT&T
	1999-2001 LizardTech, Inc."
LICENSE="GNU GPL v2"
REVISION="3"
SOURCE_URI="http://downloads.sourceforge.net/project/djvu/DjVuLibre/$portVersion/djvulibre-$portVersion.tar.gz"
CHECKSUM_SHA256="e69668252565603875fb88500cde02bf93d12d48a3884e472696c896e81f505f"
PATCHES="djvulibre-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	djvulibre$secondaryArchSuffix = $portVersion
	cmd:any2djvu$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:bzz$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:c44$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:cjb2$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:cpaldjvu$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:csepdjvu$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:ddjvu$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvm$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvmcvt$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvudigital$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvudump$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvuextract$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvumake$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvups$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvused$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvuserve$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvutoxml$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvutxt$secondaryArchSuffix = $portVersion compat >= 3.5
	cmd:djvuxmlparser$secondaryArchSuffix = $portVersion compat >= 3.5
	lib:libdjvulibre$secondaryArchSuffix = 21.6.0 compat >= 21
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
	lib:libtiff$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	djvulibre${secondaryArchSuffix}_devel = $portVersion
	devel:libdjvulibre$secondaryArchSuffix = 21.6.0 compat >= 21
	"
REQUIRES_devel="
	djvulibre$secondaryArchSuffix == $portVersion
	"

BUILD_REQUIRES="
	devel:libjpeg$secondaryArchSuffix
	devel:libtiff$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:aclocal
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtool
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	aclocal
	libtoolize -fci
	automake --add-missing
	autoconf
	runConfigure ./configure
	make
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libdjvulibre

	fixPkgconfig

	packageEntries devel $developDir
}
