# SliTaz package receipt.

PACKAGE="ffmpeg"
VERSION="0.6.3"
CATEGORY="multimedia"
SHORT_DESC="Record, convert and stream audio and video."
MAINTAINER="pascal.bellard@slitaz.org"
WEB_SITE="http://ffmpeg.org/"
TARBALL="$PACKAGE-$VERSION.tar.bz2"
WGET_URL="${WEB_SITE}releases/$TARBALL"
DEPENDS="bzlib freetype imlib2 alsa-lib jack-audio-connection-kit zlib"
BUILD_DEPENDS="imlib2-dev freetype-dev libsdl-dev zlib-dev coreutils-file-format \
coreutils-file-special"
SUGGESTED="ffplay"
TAGS="audio video convert stream"

# Rules to configure and make the package.
compile_rules()
{
	cd $src
	
	# Fix gcc45 build.
	patch -p1 < $stuff/ffmpeg-0.5.1-gcc45.u || return 1
	
	./configure \
		--prefix=/usr \
		--enable-gpl \
		--arch=i486 \
		--cpu=i486 \
		--enable-shared \
		--enable-small \
		--enable-pthreads \
		--enable-postproc \
		--enable-swscale \
		--disable-mmx \
		--disable-mmx2 \
		--disable-ssse3 &&
	make &&
	make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/lib
	cp -a $_pkg/usr/lib/*so* $fs/usr/lib
	cp -a $_pkg/usr/bin $fs/usr
	# ffplay with it SDL dep go in a splited package
	rm $fs/usr/bin/ffplay
}