SUMMARY="Replay Gain library from Musepack"
DESCRIPTION="libreplaygain calculates the perceived loudness of audio and \
suggests dB adjustments according to the ReplayGain standard.
"
ARCHITECTURES="x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
REVISION="1"
HOMEPAGE="https://www.musepack.net"
LICENSE="GNU LGPL v2.1"
COPYRIGHT="1997-2011 Musepack Project"

SOURCE_URI="http://files.musepack.net/source/libreplaygain_r475.tar.gz"
SOURCE_DIR="libreplaygain_r475"
CHECKSUM_SHA256="8258bf785547ac2cda43bb195e07522f0a3682f55abe97753c974609ec232482"

PROVIDES="
	libreplaygain$secondaryArchSuffix = $portVersion
	lib:libreplaygain$secondaryArchSuffix = 1.0.0 compat = 1
"

REQUIRES="
	haiku$secondaryArchSuffix
"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:cmake
	cmd:gcc$secondaryArchSuffix
	cmd:make
"

PROVIDES_devel="
	libreplaygain${secondaryArchSuffix}_devel = $portVersion
	devel:libreplaygain$secondaryArchSuffix
"

REQUIRES_devel="
	libreplaygain$secondaryArchSuffix == $portVersion base
"

BUILD()
{
	cmake . -DCMAKE_INSTALL_PREFIX=$prefix -DLIB_SUFFIX=$secondaryArchSubDir
	make $jobArgs
}

INSTALL()
{
	make install

	mkdir -p $includeDir
	cp -r include/replaygain $includeDir

	prepareInstalledDevelLib libreplaygain

	packageEntries devel $developDir
}
