### this file is sourced not run
PKGVER=0.9.8083
PKGBUILD=1
PKGARCH=x86_64

# source: debian
TARBALL=btanks-0.9.8083.tar.bz2
MD5SUM=49cb95c0eec47d3436c4fdf65e7c9d12
SRC_URL=http://downloads.sourceforge.net/btanks/$TARBALL
BUNDLE=

SLACKREQ='libSDL libSDL-image libvorbis expat lua libsmpeg'
SLACKDESC="btanks: btanks $PKGVER (Battle Tanks Deathmatch)
btanks: 
btanks: Battle Thanks is a funny battle on your desk, where you can choose 
btanks: one of three vehicles and eliminate your enemy using the whole 
btanks: arsenal of weapons. It has original cartoon-like graphics and cool 
btanks: music. It's fun and dynamic, it has several network modes for 
btanks: deathmatch and cooperative — what else is needed to have fun with 
btanks: your friends?
btanks: 
btanks: http://btanks.sourceforge.net/blog/about-game/
btanks: 
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/btanks* &&
	tar -xf ../pkg/btanks* &&
	for p in $(cat debian/patches/series); do
		patch -Np1 -i debian/patches/$p || return 1
	done &&
	sed -i -e 's/lua_open/luaL_newstate/; /lua_load/ s/);/, NULL&/' \
		engine/luaxx/state.cpp
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/btanks* &&
	scons build \
		prefix=/usr \
		lib_dir=/usr/lib64/btanks \
		plugins_dir=/usr/lib64/btanks/plugins &&
	scons install &&
	pkg_build_slackdesc
}


