#!/bin/sh
#
# Copyright 2005 Dagmar d'Surreal <rivyqntzne@tznvy.pbz>
# Modified by Zach Borgerding <zborgerd@gmail.com>
# Available under the terms of the GNU GPL.
#

NAME="abiword"
VERSION="2.4.1"
REVISION="3"

PKG_SOURCEURL='http://www.abisource.com/downloads/$NAME/$VERSION/source/$NAME-$VERSION.tar.gz'

PKG_PATCH[0]='abiword.desktop.patch'

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

cflags
prepare
analyzesource
pwd
applypatch 0 1

PKG_BUILDROOT="$PKG_SRCROOT/abi"
spewdo "cd $PKG_BUILDROOT"
configure --with-libxml2 --enable-gnome
make
#makecheck # somebody wrote a bad makefile
makeinstall install-strip

PKG_BUILDROOT="$PKG_SRCROOT/abiword-plugins"
spewdo "cd $PKG_BUILDROOT"

loggedcommand sh_nextgen "sh nextgen.sh"
status=$?
if [ $status != 0 ]; then
  die "Error!  sh_nextgen exited with status: $status"
fi

spewdo "cd $PKG_BUILDROOT"
configure  --disable-abigochart #--disable-link-grammar --disable-OpenDocument --disable-OpenWriter --disable-abigochart
make
makecheck
makeinstall

tidydocumentation
analyzebinaries
includescript
finalizepackage
packagize
cleanup
