SUMMARY="libmodplug is a lib for playing mod files"
DESCRIPTION="
Olivier Lapicque, author of Modplug, which is arguably the best quality \
MOD-playing software available, has placed his sound rendering code in the \
public domain. This library and plugin is based on that code.
Plays 22 different mod formats, zip, rar, gzip, and bzip2 compressed mods.
"
HOMEPAGE="http://modplug-xmms.sourceforge.net" 
SOURCE_URI="http://sourceforge.net/projects/modplug-xmms/files/libmodplug/$portVersion/libmodplug-$portVersion.tar.gz"
CHECKSUM_SHA256="77462d12ee99476c8645cb5511363e3906b88b33a6b54362b4dbc0f39aa2daad"
PATCHES="libmodplug-$portVersion.patchset"
LICENSE="Public Domain"
COPYRIGHT="Public Domain"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libmodplug$secondaryArchSuffix = $portVersion
	lib:libmodplug$secondaryArchSuffix = 1.0.0 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	REQUIRES+="
		lib:libgcc_s$secondaryArchSuffix
	"
fi

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

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	automake

	runConfigure ./configure \
		--enable-static
	make $jobArgs
}

INSTALL()
{
	make install
	prepareInstalledDevelLibs libmodplug
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	libmodplug${secondaryArchSuffix}_devel = $portVersion
	devel:libmodplug$secondaryArchSuffix = 1.0.0 compat >= 1
	"
REQUIRES_devel="
	libmodplug$secondaryArchSuffix == $portVersion
	"
