1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-25 00:51:21 +00:00
freebsd-ports/games/cube/files/cube_server.in
Alejandro Pulver 89d08ccafe - Update to version 2005.08.29.
- Allow building only the client or server (adding OPTIONS).
- Improve wrapper script (only create ~/.cube once and pass parameters to the
  real executable).
- Install documentation (if !NOPORTDOCS).
- Build targets according to OPTIONS.
- IGNORE if no executables were selected.
- Format pkg-descr and add item.
- Copy autoexec.cfg in addition to config.cfg instead of symlinking it.

PR:		ports/101037
Submitted by:	alepulver (myself)
Approved by:	maintainer (timeout)
2006-08-07 02:30:38 +00:00

21 lines
661 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.
if [ -d ~/.cube ]
then
echo "Using existing ~/.cube directory."
else
echo "Creating ~/.cube directory."
cd %%DATADIR%% || exit 1
find * -type d -exec mkdir -p ~/.cube/{} \;
cp *.cfg ~/.cube && chmod u+w ~/.cube/*.cfg
find * -type f -exec ln -s %%DATADIR%%/{} ~/.cube/{} \; 2>/dev/null
fi
cd ~/.cube || exit 1
exec %%PREFIX%%/libexec/cube_server "$@"