freebsd-ports/games/fargoal/files/fargoal-sh.in
Pav Lucistnik 7e9172d092 - Update to 20040629
- Take maintainership

PR:		ports/84921
Submitted by:	Alejandro Pulver <alejandro@varnet.biz>
2005-11-13 15:26:34 +00:00

19 lines
554 B
Bash

#!/bin/sh
# The executable needs to be run from its data directory, and needs to store
# configuration in it. We therefore mirror the data directory hierarchy in
# ~/.fargoal, and create symlinks to the data files.
cd %%DATADIR%% || exit 1
find * -type d -exec mkdir -p ~/.fargoal/{} \; || exit 1
test -f ~/.fargoal/data/sof.cfg || cp data/sof.cfg ~/.fargoal/data && \
chmod u+w ~/.fargoal/data/sof.cfg
find * -type f -exec ln -s %%DATADIR%%/{} ~/.fargoal/{} \; 2>/dev/null || \
exit 1
cd ~/.fargoal || exit 1
exec %%PREFIX%%/libexec/fargoal "$@"