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

pkgname=tuxmath
pkgver=1.7.2
pkgrel=1gv
arch=i486
source=("http://alioth.debian.org/frs/download.php/2971/tuxmath_w_fonts-1.7.2.tar.gz" "tuxmath.png")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "about-nls")
url=http://tux4kids.alioth.debian.org/tuxmath/index.php

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"tuxmath (math game for children)"
"tuxmath AKA Tux, of Math Command, is an educational math tutorial game"
"starring Tux, the Linux Penguin. In this game, you are to prevent"
"comets from crashing by solving the equations to destroy them."
)


build() {
	cd $startdir/src/tuxmath_w_fonts-$pkgver
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc
	make || return 1
	make install DESTDIR=$startdir/pkg

	mkdir -p $startdir/pkg/usr/doc/$pkgname-$pkgver
	mv $startdir/pkg/usr/share/doc/tuxmath/* $startdir/pkg/usr/doc/$pkgname-$pkgver/
	rm -rf $startdir/pkg/usr/share/doc

	mkdir -p $startdir/pkg/usr/share/applications
	cp tuxmath.desktop $startdir/pkg/usr/share/applications/
	sed -i "s/Categories=.*/Categories=Game;KidsGame;/" $startdir/pkg/usr/share/applications/tuxmath.desktop

	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	cp $startdir/src/tuxmath.png $startdir/pkg/usr/share/icons/hicolor/48x48/apps

	mkdir -p $startdir/pkg/usr/share/icons/hicolor/scalable/apps
	cd $startdir/pkg/usr/share/icons/hicolor/scalable/apps
	ln -s ../../../../tuxmath/images/icons/tuxmath.svg tuxmath.svg
}