2001-08-11 12:30:13 -04:00
|
|
|
#!/bin/sh
|
2003-04-14 11:02:08 -04:00
|
|
|
# $OpenBSD: INSTALL,v 1.2 2003/04/14 15:02:09 wilfried Exp $
|
2001-08-11 12:30:13 -04:00
|
|
|
#
|
|
|
|
# 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
|
2003-04-14 11:02:08 -04:00
|
|
|
chown -R root:games $SCORE_DIR
|
2001-08-11 12:30:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# 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
|