SUMMARY="A library for playing MOD files"
DESCRIPTION="libmikmod supports many formats, including mod, s3m, it, and xm."
HOMEPAGE="http://mikmod.sourceforge.net"
COPYRIGHT="1998-2004 Jean-Paul Mikkers, Jake Stine, Frank Loemker, Steve \
McIntyre, Peter Amstutz, and Miodrag Vallat."
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="http://sourceforge.net/projects/mikmod/files/libmikmod/$portVersion/libmikmod-$portVersion.tar.gz"
CHECKSUM_SHA256="ad9d64dfc8f83684876419ea7cd4ff4a41d8bcd8c23ef37ecb3a200a16b46d19"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libmikmod$secondaryArchSuffix = $portVersion compat >= 3.3
	lib:libmikmod$secondaryArchSuffix = 3.3.0 compat >= 3
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libsdl$secondaryArchSuffix
	"

PROVIDES_devel="
	libmikmod${secondaryArchSuffix}_devel = $portVersion
	cmd:libmikmod_config$secondaryArchSuffix
	devel:libmikmod$secondaryArchSuffix = 3.3.0 compat >= 3
	"
REQUIRES_devel="
	libmikmod$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsdl$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:libtool
	cmd:make
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure --enable-sdl
	make
}

INSTALL()
{
	make install

	rm $libDir/libmikmod.la

	prepareInstalledDevelLibs libmikmod
	fixPkgconfig
	fixDevelopLibDirReferences $binDir/libmikmod-config

	# devel package
	packageEntries devel \
		$developDir $binDir/libmikmod-config \
		$dataDir
}
