SUMMARY="A simple and lightweight command line MP3 Player"
DESCRIPTION="mpg321 is a very popular command-line mp3 player. mpg321 is used \
for frontends, as an mp3 player and as an mp3 to wave file decoder (primarily \
for use with CD-recording software)."
HOMEPAGE="http://mpg321.sourceforge.net/"
COPYRIGHT="2001 Joe Drew
	2006-2012 Nanakos Chrysostomos"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://downloads.sourceforge.net/mpg321/mpg321_$portVersion.orig.tar.gz"
CHECKSUM_SHA256="056fcc03e3f5c5021ec74bb5053d32c4a3b89b4086478dcf81adae650eac284e"
SOURCE_DIR="mpg321-$portVersion-orig"
PATCHES="mpg321-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandSuffix=
	commandBinDir=$prefix/bin
fi

PROVIDES="
	mpg321$secondaryArchSuffix = $portVersion
	cmd:mpg321$commandSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libao$secondaryArchSuffix
	lib:libid3tag$secondaryArchSuffix
	lib:libmad$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libao$secondaryArchSuffix
	devel:libid3tag$secondaryArchSuffix
	devel:libmad$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure \
		--enable-mpg123-symlink=NO \
		--enable-alsa=NO \
		LIBS=-lnetwork
	make $jobArgs
}

INSTALL()
{
	make install \
		bindir=$commandBinDir \
		datadir=$dataDir \
		mandir=$manDir
}

TEST()
{
	make check
}
