#!/bin/sh -e

SCOREFILES="
	/var/games/bsdgames/atc_score
	/var/games/bsdgames/battlestar.log
	/var/games/bsdgames/cfscores
	/var/games/bsdgames/criblog
	/var/games/bsdgames/robots_roll
	/var/games/bsdgames/saillog
	/var/games/bsdgames/snake.log
	/var/games/bsdgames/snakerawscores
	/var/games/bsdgames/tetris-bsd.scores
	/var/games/bsdgames/phantasia/characs
	/var/games/bsdgames/phantasia/gold
	/var/games/bsdgames/phantasia/lastdead
	/var/games/bsdgames/phantasia/mess
	/var/games/bsdgames/phantasia/motd
	/var/games/bsdgames/phantasia/scoreboard
	/var/games/bsdgames/phantasia/void
	/var/games/bsdgames/phantasia/monsters"

# These files cannot just be zero-byte files:
if [ ! -e /var/games/bsdgames/phantasia/void ]; then
	cp /usr/share/games/bsdgames/phantasia/void \
		/var/games/bsdgames/phantasia/void
fi
if [ ! -e /var/games/bsdgames/phantasia/monsters ] ; then
	cp /usr/share/games/bsdgames/phantasia/monsters \
		/var/games/bsdgames/phantasia/monsters
fi

touch $SCOREFILES
chown root.games $SCOREFILES
chmod 664 $SCOREFILES

# These files may not be world-readable as they have passwords
# in them.
chmod 660 /var/games/bsdgames/phantasia/characs

# I have to make this directory here, because older version of this package
# always deleted it in their postrm. Oops.
mkdir -p /var/games/bsdgames/sail
chown root.games /var/games/bsdgames/sail
chmod g+rws /var/games/bsdgames/sail

#DEBHELPER#
