SUMMARY="A pipe connecting game"
DESCRIPTION="Pipepanic is a pipe connecting game using libSDL. Connect as many \
different shaped pipes together as possible within the time given."
HOMEPAGE="http://www.users.waitrose.com/~thunor/pipepanic/"
COPYRIGHT="2006 TheGreenKnight"
LICENSE="GNU GPL v2"
REVISION="8"
SOURCE_URI="http://www.users.waitrose.com/~thunor/pipepanic/dload/pipepanic-$portVersion-source.tar.gz"
CHECKSUM_SHA256="4b02249c92228b03f4cc3c1d999cacf3fe52c16df53c6bf76fc6c1e2caa74318"
SOURCE_DIR="pipepanic-$portVersion-source"
PATCHES="pipepanic-$portVersion.patchset"
ADDITIONAL_FILES="pipepanic.rdef"

ARCHITECTURES="all"

USER_SETTINGS_FILES="
	settings/pipepanic
	"

PROVIDES="
	pipepanic = $portVersion
	app:Pipepanic = $portVersion
	"
REQUIRES="
	haiku
	lib:libSDL_1.2
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libsdl
	"
BUILD_PREREQUIRES="
	cmd:gcc
	cmd:make
	cmd:sed
	"

BUILD()
{
	make $jobArgs
}

INSTALL()
{
	install -m 755 -d $appsDir/Pipepanic $docDir

	install -m 444 -t $appsDir/Pipepanic \
		ascii15.bmp ascii30.bmp \
		digits24.bmp digits48.bmp \
		tiles24.bmp tiles48.bmp

	install -m 444 -t $docDir README
	install -m 555 -T pipepanic $appsDir/Pipepanic/Pipepanic

	MAJOR="`echo "$portVersion" | cut -d. -f1`"
	MIDDLE="`echo "$portVersion" | cut -d. -f2`"
	MINOR="`echo "$portVersion" | cut -d. -f3`"
	sed \
		-e "s|@MAJOR@|$MAJOR|" \
		-e "s|@MIDDLE@|$MIDDLE|" \
		-e "s|@MINOR@|$MINOR|" \
		$portDir/additional-files/pipepanic.rdef \
		> pipepanic.rdef
	addResourcesToBinaries pipepanic.rdef $appsDir/Pipepanic/Pipepanic

	# This isn't starting from Deskbar for some reason
	# Starts ok with Tracker and Terminal
	 addAppDeskbarSymlink $appsDir/Pipepanic/Pipepanic
}
