#!/bin/bash

# MEKA launch script
# By SukkoPera <enjoy.the.silence@iol.it>
# 12/07/2005

VERSION="20051203"
GAMEDIR="/usr/share/games/meka-$VERSION"
USERDIR=~/.meka

# See if user already has his personal MEKA directoy
if ! [ -d $USERDIR ]
then
	# No, let's set it up!
	mkdir -p $USERDIR
	cd $USERDIR

	# Create links to files which are not (usually) modified by users
	for i in $GAMEDIR/meka $GAMEDIR/meka.{dat,msg,nam,pat,thm,txt} $GAMEDIR/{compat.txt,mekanix.txt,multi.txt}
	do
		ln -s $i
	done

	# Copy files which can be modified by users
	for i in $GAMEDIR/meka.{blt,inp}
	do
		cp $i .
	done
fi

cd $USERDIR
./meka
