SUMMARY="A C++ logging library"
DESCRIPTION="Google's C++ logging library"
HOMEPAGE="https://github.com/google/glog/"
COPYRIGHT="1999-2017 Google Inc."
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/google/glog/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c"
PATCHES="glog-$portVersion.patchset"

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

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

PROVIDES="
	glog$secondaryArchSuffix = $portVersion
	lib:libglog$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:autoreconf
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

defineDebugInfoPackage glog$secondaryArchSuffix \
	$libDir/libglog.so.$libVersion

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

INSTALL()
{
	make install

	rm $libDir/libglog.la $libDir/libglog.a

	prepareInstalledDevelLib libglog

	fixPkgconfig

	# devel package
	packageEntries devel $developDir
}
