openbsd-ports/games/zangband/pkg/INSTALL
lebel e9933d29cb modify zangband in order to use /var/games/zangband for
user modifiable files (like score, bone and save files). Add
pkg/INSTALL and pkg/DEINSTALL to manage them.
2001-08-11 16:30:13 +00:00

51 lines
1.0 KiB
Plaintext

#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2001/08/11 16:30:13 lebel Exp $
#
# Pre/post-installation setup of zangband
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_DIR=/var/games/zangband
# Function: install the directories and files for zangband
#
do_install()
{
install -m 775 -d $SCORE_DIR
install -m 775 -d $SCORE_DIR/apex
install -m 775 -d $SCORE_DIR/save
install -m 775 -d $SCORE_DIR/data
install -m 775 -d $SCORE_DIR/bone
cp $PREFIX/share/zangband/apex/* $SCORE_DIR/apex
chown -R root.games $SCORE_DIR
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
: nothing to pre-install for this port
;;
POST-INSTALL)
if [ ! -d $SCORE_DIR ]; then
do_install $1
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0