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

pkgname=stardict
pkgver=3.0.2
pkgrel=1gv
source=("http://downloads.sourceforge.net/stardict/stardict-3.0.2.tar.bz2" "help-in-destdir.patch" "as-needed.patch")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "about-nls" "faq" "hacking" "HowToCreateDictionary" "StarDictFileFormat" "Translation")
url=http://stardict.sourceforge.net/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"stardict (a GTK+2 dictionary tool)"
"StarDict is a Cross-Platform and international dictionary Software. It"
"has powerful features such as \"Glob-style pattern matching\", \"Scan"
"selection word,\" \"Fuzzy query,\" etc." 
)

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

	patch -p1 < $startdir/src/as-needed.patch || exit 1
	patch -p1 < $startdir/src/help-in-destdir.patch || exit 1

	automake

	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-schemas-install \
		--with-gconf-source="xml::/etc/gconf/gconf.xml.defaults" \
		--disable-gucharmap \
		--disable-gnome-support \
		--disable-festival \
		--disable-espeak \
		--build=$arch-slackware-linux
	make || return 1
	make install DESTDIR=$startdir/pkg

	mkdir -p $startdir/pkg/usr/share/applications
	sed 's/.png//' data/stardict.desktop > $startdir/pkg/usr/share/applications/stardict.desktop

	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	(
	cd $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	ln -s ../../../../pixmaps/stardict.png stardirct.png
	)
}