SUMMARY="An implementation of the Progressive Graphics File (PGF)"
DESCRIPTION="libpgf is a library implementing an interface for handling \
PGF (Progressive Graphic File) format files."
HOMEPAGE="https://www.libpgf.org/"
COPYRIGHT="2006 xeraina GmbH, Switzerland"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="https://downloads.sourceforge.net/libpgf/libpgf/$portVersion-latest/libPGF-codec-and-console-src.zip"
CHECKSUM_SHA256="f1dd054b09b0f3651209d67529490b4cbc156a985d8b019ff3bfe575260f4221"
SOURCE_FILENAME="libpgf-$portVersion.zip"
SOURCE_DIR="PGF/Codec"
PATCHES="libpgf-$portVersion.patchset"

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

libVersion="7.0.15"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
	libpgf$secondaryArchSuffix = $portVersion
	lib:libpgf$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libpgf${secondaryArchSuffix}_devel = $portVersion
	devel:libpgf$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	libpgf$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:doxygen
	cmd:g++$secondaryArchSuffix
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

defineDebugInfoPackage libpgf$secondaryArchSuffix \
	"$libDir/libpgf.so.$libVersion"

BUILD()
{
	sh ./autogen.sh
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm -f "$libDir"/*.la

	install -d -m 755 "$developDocDir"
	mv "$dataDir/doc/libpgf-$portVersion/html" "$developDocDir"
	rm -rf "$dataDir" "$manDir"

	prepareInstalledDevelLib libpgf
	fixPkgconfig
	packageEntries devel "$developDir"
}
