SUMMARY="A common library for parsing mms:// and mmsh:// type network streams"
DESCRIPTION="LibMMS is a common library for parsing mms:// and mmsh:// type \
network streams. These are commonly used to stream Windows Media Video \
content over the web. LibMMS itself is only for receiving MMS stream, it \
doesn't handle sending at all."
HOMEPAGE="https://sourceforge.net/projects/libmms/"
COPYRIGHT="2009 Xine project"
LICENSE="GNU LGPL v2.1"
REVISION="3"
SOURCE_URI="https://downloads.sourceforge.net/libmms/libmms-$portVersion.tar.gz"
CHECKSUM_SHA256="3c05e05aebcbfcc044d9e8c2d4646cd8359be39a3f0ba8ce4e72a9094bee704f"
PATCHES="libmms-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libmms$secondaryArchSuffix = $portVersion
	lib:libmms$secondaryArchSuffix = 0.0.2 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	"

PROVIDES_devel="
	libmms${secondaryArchSuffix}_devel = $portVersion
	devel:libmms$secondaryArchSuffix = 0.0.2 compat >= 0
	"
REQUIRES_devel="
	libmms$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libglib_2.0$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	export CFLAGS="-D_BSD_SOURCE"
	export LDFLAGS="-lnetwork -lbsd"

	autoreconf -vfi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/libmms.la

	prepareInstalledDevelLib libmms
	fixPkgconfig

	packageEntries devel \
		$developDir
}
