SUMMARY="A library for interfacing Music Player Daemon"
DESCRIPTION="
Music Player Daemon (MPD) is a flexible, powerful, server-side application \
for playing music. Through plugins and libraries it can play a variety \
of sound files while being controlled by its network protocol.
"
HOMEPAGE="http://www.musicpd.org/"
SOURCE_URI="git://git.musicpd.org/master/libmpdclient.git#cc2ffe943dd36a4c95ec34b2f2bf413de15b7974"
#CHECKSUM_SHA256=""
LICENSE="BSD (3-clause)"
COPYRIGHT="2003-2014 The Music Player Daemon Project"
REVISION="1"
ARCHITECTURES="x86 ?x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
else
	ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libmpdclient$secondaryArchSuffix = $portVersion
	lib:libmpdclient$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	glib2$secondaryArchSuffix >= 2
	lib:libexpat$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libglib_2.0$secondaryArchSuffix
	devel:libexpat$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:autoheader
	cmd:automake
	cmd:doxygen
	cmd:gcc${secondaryArchSuffix}
	cmd:ld${secondaryArchSuffix}
	cmd:libtoolize
	cmd:make
	cmd:m4
	cmd:awk
	cmd:ranlib
	cmd:sed
	cmd:find
	"

BUILD()
{
	export PKG_CONFIG_LIBDIR="`finddir B_SYSTEM_DIRECTORY`/$relativeDevelopLibDir/pkgconfig"

	export NOCONFIGURE=1
	./autogen.sh

	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	export PKG_CONFIG_LIBDIR="`finddir B_SYSTEM_DIRECTORY`/$relativeDevelopLibDir/pkgconfig"

	make install

	# prepare devel/lib
	prepareInstalledDevelLibs libmpdclient
	fixPkgconfig
	
	# devel package
	packageEntries devel \
		$developDir
}

# ----- devel package -------------------------------------------------------
#TODO: move html docs here?

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