# SliTaz package receipt.

PACKAGE="abiword"
VERSION="2.8.6"
CATEGORY="office"
SHORT_DESC="Light and speed word processing application."
MAINTAINER="pankso@slitaz.org"
DEPENDS="gtk+ libgnomeprint libgnomeprintui libgnomecanvas fribidi libglade \
popt libxml2 libart_lgpl libgsf libgio enchant wv xorg-libXdamage gcc-lib-base librsvg \
goffice glibc-locale"
BUILD_DEPENDS="$DEPENDS gtk+-dev libgnomeprint-dev libgnomeprintui-dev \
fribidi-dev libglade-dev popt-dev libxml2-dev libart_lgpl-dev libgsf-dev \
enchant-dev wv-dev libgnomecanvas-dev libcroco-dev libboost-dev librsvg-dev"
SUGGESTED="abiword-extras"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://www.abisource.com/"
WGET_URL="http://www.abisource.com/downloads/abiword/$VERSION/source/$TARBALL"
TAGS="word doc office"

# Rules to configure and make the package. 	--enable-extra-optimization \
compile_rules()
{
	cd $src
	./configure \
		--prefix=/usr \
		--infodir=/usr/share/info \
		--mandir=/usr/share/man \
		--enable-plugins \
		--enable-clipart \
		--enable-templates \
		--disable-collab-backend-sugar \
		$CONFIGURE_ARGS &&
	make $MAKEFLAGS &&
	make DESTDIR=$PWD/_pkg install
	
	cd plugins
	make DESTDIR=$src/_pkg install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/share/pixmaps $fs/usr/lib/abiword-2.8/plugins $fs/usr/share/icons
	
	cp -a $_pkg/usr/bin $fs/usr
	cp -a $_pkg/usr/lib/*.so $fs/usr/lib
	
	cp -a $_pkg/usr/share/abiword-* $fs/usr/share
	# Non standard pixmap
	cp $_pkg/usr/share/icons/abiword_48.png \
		$fs/usr/share/pixmaps/abiword.png
	# fix error when abiword is run in command line
	ln -sf /usr/share/pixmaps/abiword.png $fs/usr/share/icons/abiword_48.png
	# Non-standard locale use : get english, spanish, french, german
	rm $fs/usr/share/abiword-*/strings/*
	rm $fs/usr/share/abiword-*/templates/*
	rm $fs/usr/share/abiword-*/system.pro*
	cp  $_pkg/usr/share/abiword-*/strings/d* \
	   $_pkg/usr/share/abiword-*/strings/e* \
	    $_pkg/usr/share/abiword-*/strings/f*    \
		$fs/usr/share/abiword-*/strings/
	cp $_pkg/usr/share/abiword-*/templates/normal.awt \
		$_pkg/usr/share/abiword-*/templates/normal.awt-d* \
		$_pkg/usr/share/abiword-*/templates/normal.awt-e*  \
		$_pkg/usr/share/abiword-*/templates/normal.awt-f*  \
	    $fs/usr/share/abiword-*/templates/
	    
	cp $_pkg/usr/share/abiword-*/templates/*.awt $fs/usr/share/abiword-*/templates/
	    
	cp $_pkg/usr/share/abiword-*/system.profile \
		$_pkg/usr/share/abiword-*/system.profile-d* \
		$_pkg/usr/share/abiword-*/system.profile-e* \
		$_pkg/usr/share/abiword-*/system.profile-f* \
	   $fs/usr/share/abiword-*/

}