1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-01 10:59:55 +00:00
freebsd-ports/games/cube/files/cube_client.in
Renato Botelho 557eb37569 o Add wrapper scripts for the executables cube_client and cube_server, and
place the programs in libexec because it needs to write files in the
  data directory (otherwise it crashes).
o Use %%DATADIR%% in pkg-plist.

PR:		ports/85270
Submitted by:	Alejandro Pulver <alejandro@varnet.biz>
Approved by:	maintainer
2005-10-06 10:15:36 +00:00

20 lines
613 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
# ~/.cube, and create symlinks to the data files, but the configuration file
# is copied, and write permission for the user is added to it.
cd %%DATADIR%% || exit 1
find * -type d -exec mkdir -p ~/.cube/{} \; || exit 1
test -f ~/.cube/autoexec.cfg || cp autoexec.cfg ~/.cube &&
chmod u+w ~/.cube/autoexec.cfg
find * -type f -exec ln -s %%DATADIR%%/{} ~/.cube/{} \; 2>/dev/null || exit 1
cd ~/.cube || exit 1
exec %%PREFIX%%/libexec/cube_client