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

# source: james
TARBALL=freeciv-$PKGVER.tar.xz
MD5SUM=2fd95934a50878e5bdc5fad753973386
SRC_URL=http://downloads.sourceforge.net/freeciv/$TARBALL
BUNDLE=

SLACKREQ='gtk3 sqlite3 libSDL2 libSDL2-mixer curl'
SLACKDESC="freeciv: freeciv $PKGVER (Empire-building strategy game)
freeciv: 
freeciv: Freeciv (Free Civilization) is a Free and Open Source empire-building 
freeciv: strategy game inspired by the history of human civilization. The game 
freeciv: commences in prehistory and your mission is to lead your tribe from 
freeciv: the Stone Age to the Space Age...
freeciv: 
freeciv: http://freeciv.org/
freeciv: 
freeciv: 
freeciv: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/freeciv*

	export LDFLAGS=-L/usr/$LIBDIR
	./configure $CONFFLAGS      \
		--enable-client=gtk3    \
		--enable-fcmp=gtk3      \
		--enable-sdl-mixer=sdl2 \
		--enable-fcdb=sqlite3   \
		--disable-static --enable-shared \
	&&
	echo '#define ALWAYS_ROOT 1' >> fc_config.h && # enable running as root
	
	make $MAKEFLAGS && make install &&
	pkg_build_slackdesc &&

	# game cannot run as root - run it as spot
	ln -s program-spot /usr/bin/freeciv-gtk3-spot &&
	ln -s program-spot /usr/bin/freeciv-mp-gtk3-spot &&
	sed -i -e 's|Exec=freeciv-gtk3|&-spot|' /usr/share/applications/org.freeciv.gtk3.desktop &&
	sed -i -e 's|Exec=freeciv-mp-gtk3|&-spot|' /usr/share/applications/org.freeciv.mp.gtk3.desktop
}


