SUMMARY="Library for parsing, editing, and saving EXIF data"
DESCRIPTION="Most digital cameras produce EXIF files, which are JPEG files \
with extra tags that contain information about the image. The EXIF library \
allows you to parse an EXIF file and read the data from those tags."
HOMEPAGE="https://github.com/libexif/libexif/"
COPYRIGHT="2012 Lutz Mueller
	Jan Patera
	Hans Ulrich Niedermann
	Hubert Figuiere
	"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/libexif-${portVersion//./_}-release.tar.gz"
CHECKSUM_SHA256="46498934b7b931526fdee8fd8eb77a1dddedd529d5a6dbce88daf4384baecc54"
SOURCE_DIR="libexif-libexif-${portVersion//./_}-release"
if [ $effectiveTargetArchitecture = x86_gcc2 ]; then
	PATCHES="libexif-$portVersion.patchset"
fi

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

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

PROVIDES="
	libexif$secondaryArchSuffix = $portVersion
	lib:libexif$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libintl$secondaryArchSuffix
	devel:libiconv$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:aclocal
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

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

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

INSTALL()
{
	make install

	rm "$libDir"/libexif.*a

	prepareInstalledDevelLib libexif
	fixPkgconfig

	packageEntries devel \
		"$developDir"
}
