DESCRIPTION="Libsndfile is a C library for reading and writing files containing sampled sound" 
HOMEPAGE="http://www.mega-nerd.com/libsndfile" 
SOURCE_URI="http://ports-space.haiku-files.org/source/libsndfile_1.0.21.orig.tar.gz"
CHECKSUM_MD5="880a40ec636ab2185b97f8927299b292"
REVISION="1"
MESSAGE="This port only builds with gcc4. Use 'setgcc gcc4' before building."
STATUS_HAIKU="stable"

DEPEND="media-libs/flac >= 1.2.1
        media-libs/libogg >= 1.2.0
        media-libs/libvorbis >= 1.3.1"

BUILD()
{
	cd libsndfile-1.0.21
	rm aclocal.m4
	echo "AC_CONFIG_MACRO_DIR([M4]) >> configure.in"
	libtoolize --force --copy --install
	aclocal --install -I M4
	sed -i 's/htmldocdir=$prefix\/share\/doc\/libsndfile1-dev\/html/htmldocdir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`\/doc\/libsndfile1-dev\/html/' configure.ac
	autoconf
	autoheader
	automake
	COMMON_DOCS=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`
	export htmldocdir=$COMMON_DOCS/doc/libsndfile-dev/html
	./configure --prefix=`finddir B_COMMON_DIRECTORY` \
		--mandir=$COMMON_DOCS/man
	make
}

INSTALL()
{
	cd libsndfile-1.0.21
	make install
}

LICENSE="GNU LGPL v2.1
		 GNU LGPL v3"
COPYRIGHT="1999-2009 Erik de Castro Lopo"
