#Maintainer: George Vlahavas <vlahavas~at~gmail~dot~com>

pkgname=abiword
pkgver=2.8.6
pkgrel=3rl
source=("http://www.abisource.com/downloads/abiword/$pkgver/source/abiword-$pkgver.tar.gz" "glib.patch" "gcc47.patch")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "*.txt")
url=http://www.abisource.com

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"abiword (word processing for everyone)"
"AbiWord is a lean and fast full-featured word processor. It can import"
"many formats including Word97/2000 and RTF, Palm, Psion, DocBook and"
"XHTML documents, and can export to RTF, Palm, Psion, XHTML, Text,"
"and LaTeX formats. Linux Journal calls it \"an elegant, open source"
"word processor that delivers the Word functionality most people use.\""
)


build() {
	cd $startdir/src/$pkgname-$pkgver

	patch -p1 < $startdir/src/glib.patch || exit 1
	patch -p1 < $startdir/src/gcc47.patch || exit 1

	./configure --prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-static \
		--enable-plugins \
		--build=$arch-slackware-linux
	make || return 1
	make install DESTDIR=$startdir/pkg
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	mv $startdir/pkg/usr/share/icons/abiword_48.png $startdir/pkg/usr/share/icons/hicolor/48x48/apps/abiword.png
	sed -i "s/Icon=.*/Icon=abiword/" $startdir/pkg/usr/share/applications/abiword.desktop
}