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.
Pak64 is the main and a base set for Simutrans developed along with \
Simutrans executable. It always contains the most recent features. It is \
neatly painted pixel by pixel with motherly care. On the other hand it \
might look too tiny on high resolution displays. Many artists contributed \
to this pak set, from the 8 bit age on.
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/pak64/"
SOURCE_FILENAME="simupak_64-$portVersion"
SOURCE_DIR=""
COPYRIGHT="1997-2004 Hj. Malthaner
	2005-2015 The Simutrans 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_pak64$secondaryArchSuffix = $portVersion
	simutrans_pakset$secondaryArchSuffix = $portVersion compat >= 120.0.1
	"
BUILD_PREREQUIRES="
	cmd:svn
	cmd:make
	cmd:find
	cmd:makeobj$secondaryArchSuffix == 55.4
	cmd:zip
	"

GLOBAL_WRITABLE_FILES="
	non-packaged/$relativeAppsDir/simutrans/pak/config directory keep-old
	"
BUILD()
{
	export MAKEOBJ=makeobj
	make $jobArgs
}

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