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

pkgname=monsterz
pkgver=0.7.1
pkgrel=1gv
arch=i486
source=("http://sam.zoy.org/monsterz/monsterz-$pkgver.tar.gz" "monsterz-0.7.1-blit-crash.patch" "monsterz-0.7.1-makefile.patch" "monsterz.desktop")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://sam.zoy.org/monsterz/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"monsterz (arcade puzzle game)"
"Monsterz is a little arcade puzzle game, similar to the famous"
"Bejeweled or Zookeeper."
"The goal of the game is to create rows of similar monsters, either"
"horizontally or vertically. The only allowed move is the swap of two"
"adjacent monsters, on the condition that it creates a row of three or"
"more. When alignments are cleared, pieces fall from the top of the"
"screen to fill the board again. Chain reactions earn you even more"
"points."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	
	patch -p0 < $startdir/src/monsterz-0.7.1-blit-crash.patch || exit 1
	patch -p1 < $startdir/src/monsterz-0.7.1-makefile.patch || exit 1
	
	make || return 1
	make install DESTDIR=$startdir/pkg

	mkdir -p $startdir/pkg/usr/share/applications
	cp $startdir/src/monsterz.desktop $startdir/pkg/usr/share/applications
	
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/64x64/apps
	( cd $startdir/pkg/usr/share/icons/hicolor/64x64/apps; ln -s ../../../../monsterz/graphics/icon.png monsterz.png )

	chmod 666 $startdir/pkg/usr/share/monsterz/hiscores
}