SUMMARY="Pakset for Simutrans"
DESCRIPTION="A 'pakset' is the data set that Simutrans needs to run: \
it contains all the data for the graphics of individual items (vehicles, \
roads, railways, buildings, etc.) and all of the balancing information \
(such as prices, speeds, capacities and so forth) necessary to make \
the game complete.
When Simutrans could only support 64px size graphics, pak128 already \
started. First pak to feature a complex economy and have a very wide \
variety of objects. It contains roughly 7 time more graphics data than \
pak64 and thus requires by far the largest amount of RAM and \
processing power of all Simutrans sets.
Nightly builds are versions only for debugging and testing. They may contain \
changes which make your savegames unreadable by any official version, or \
bugs that will destroy your game, or not even run. They are for bug testing \
only."
HOMEPAGE="http://www.simutrans.com"
SOURCE_URI="svn+https://svn.code.sf.net/p/simutrans/code/pak128/"
SOURCE_FILENAME="simupak_128-$portVersion"
SOURCE_DIR=""
COPYRIGHT="2004-2007 Tomas Kubes
	2008-2015 The pak128-Team"
LICENSE="Artistic"
REVISION="1"
ARCHITECTURES="?x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	simutrans_pak128$secondaryArchSuffix = $portVersion
	simutrans_pakset$secondaryArchSuffix = $portVersion compat >= 120.0.1
	"
BUILD_PREREQUIRES="
	cmd:svn
	cmd:python
	cmd:makeobj$secondaryArchSuffix == 55.4
	"

GLOBAL_WRITABLE_FILES="
	non-packaged/$relativeAppsDir/simutrans/pak128/config directory keep-old
	"
BUILD()
{
	python ./pakmak.py
}

INSTALL()
{
	mkdir -p $appsDir/simutrans
	mkdir -p $prefix/non-packaged/$relativeAppsDir/simutrans/pak128/config
	cp -r simutrans $appsDir/
	mv $appsDir/simutrans/pak128/config \
		$prefix/non-packaged/$relativeAppsDir/simutrans/pak128/
	ln -s $prefix/non-packaged/$relativeAppsDir/simutrans/pak128/config \
		$appsDir/simutrans/pak128/config
}