#!/bin/sh
#
# Copyright 2004 Dagmar d'Surreal <rivyqntzne@tznvy.pbz>
# Available under the terms of the GNU GPL.
#

NAME="faad2"
VERSION="2.0"
REVISION="3"

PKG_SOURCEURL='http://easynews.dl.sourceforge.net/sourceforge/faac/$NAME-$VERSION.tar.gz'

PKG_PATCH[0]="faad2-2.0-Makefile-separator.patch"
PKG_PATCH[1]="faad2-2.0-gcc34.patch"
PKG_PATCH[2]="faad2-2.0-xmms-noext.patch"
PKG_PATCH[3]="faad2-2.0-gcc4.patch"
PKG_PATCH[4]="faad2-2.0-configure-mpeg4ip.patch"
PKG_PATCH[5]="faad2-2.0-64bit.patch"
PKG_PATCH[6]="faad2-2.0-symbol.patch"
PKG_PATCH[7]="faad2-2.0-inttypesheader.diff"

. $DLG_ROOT/config
. $DLG_ROOT/SCRIPTS/dropline-functions.sh

# NOTE!  For whatever reason this thing will not build properly _if it is
# already installed_ on your system.  If you remove it and then build it
# without it being present it'll behave just fine.  Go figure.

cflags
cxxflags
prepare

applypatch 0 1 
applypatch 1 1
applypatch 2 1
applypatch 3 1 
applypatch 4 0
applypatch 5 1
applypatch 6 1
applypatch 7 1

spewdo "cd $PKG_BUILDROOT"
loggedcommand bootstrap "sh ./bootstrap"
analyzesource
spewdo "chmod 755 $PKG_BUILDROOT/configure"
configure --with-drm --without-xmms --with-mp4v2 --with-mpeg4ip
make
makeinstall install-strip
tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
