SUMMARY="An image compression library and tools for JPEGs"
DESCRIPTION="This package contains C software to implement JPEG image \
encoding, decoding, and transcoding. JPEG is a standardized compression \
method for full-color and gray-scale images.

The distributed programs provide conversion between JPEG 'JFIF' format and \
image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats. The core \
compression and decompression library can easily be reused in other programs, \
such as image viewers. The package is highly portable C code; it was tested \
on many machines ranging from PCs to Crays."
HOMEPAGE="http://www.ijg.org/"
COPYRIGHT="1991-2018 Thomas G. Lane, Guido Vollbeding"
LICENSE="JPEG"
REVISION="4"
SOURCE_URI="http://www.ijg.org/files/jpegsrc.v$portVersion.tar.gz"
CHECKSUM_SHA256="650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122"

ARCHITECTURES="all ?x86_gcc2 ?arm !sparc"
SECONDARY_ARCHITECTURES="?x86_gcc2 x86"

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

PROVIDES="
	jpeg$secondaryArchSuffix = $portVersion compat >= 9
	lib:libjpeg$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:automake
	cmd:autoreconf
	cmd:gcc$secondaryArchSuffix
	cmd:grep
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	AUTOHEADER=true autoreconf -fi
	runConfigure ./configure \
		--enable-shared
	make $jobArgs
}

INSTALL()
{
	make install-strip

	rm $libDir/libjpeg.{a,la,so}
	rm -rf $binDir $documentationDir $includeDir $libDir/pkgconfig
}
