SUMMARY="A library 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.
It plays 22 different MOD formats as well as zip, rar, gzip, and bzip2 \
compressed MODs."
HOMEPAGE="http://modplug-xmms.sourceforge.net"
COPYRIGHT="Public Domain"
LICENSE="Public Domain"
REVISION="1"
SOURCE_URI="http://sourceforge.net/projects/modplug-xmms/files/libmodplug/$portVersion/libmodplug-$portVersion.tar.gz"
CHECKSUM_SHA256="457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de"
PATCHES="libmodplug-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libmodplug$secondaryArchSuffix = $portVersion
	lib:libmodplug$secondaryArchSuffix = 1.0.0 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

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

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

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

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

INSTALL()
{
	make install
	prepareInstalledDevelLibs libmodplug
	rm $developLibDir/*.la
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}
