1
0
mirror of https://salsa.debian.org/games-team/bsdgames synced 2024-11-02 16:37:17 -04:00
bsdgames/debian/postinst

85 lines
2.4 KiB
Plaintext
Raw Normal View History

2012-02-25 11:11:48 -05:00
#!/bin/sh
# Post-install script for bsdgames package.
#
# Man page: dh_installdeb(1)
2012-02-25 11:11:48 -05:00
set -e
2010-01-15 17:31:41 -05:00
# Summary of ways this script can be called:
# * <postinst> configure <most-recently-configured-version>
# * <old-postinst> abort-upgrade <new version>
# * <conflictor-postinst> abort-remove
# in-favour <package> <new-version>
# * <deconfigured-postinst> abort-deconfigure
# in-favour <failed-install-package> <version>
# removing <conflicting-package> <version>
# For details, see <URL:http://www.debian.org/doc/debian-policy/> or
# the debian-policy package.
action="$1"
2010-01-15 17:31:41 -05:00
SCOREFILES="
/var/games/bsdgames/atc_score
/var/games/bsdgames/battlestar.log
/var/games/bsdgames/cfscores
/var/games/bsdgames/criblog
/var/games/bsdgames/robots_roll
/var/games/bsdgames/saillog
/var/games/bsdgames/snake.log
/var/games/bsdgames/snakerawscores
/var/games/bsdgames/tetris-bsd.scores
/var/games/bsdgames/hack/perm
/var/games/bsdgames/hack/record"
# Hack moved over from bsdgames-nonfree.
if [ -d /var/games/bsdgames-nonfree ]; then
for file in perm record; do
if [ -e /var/games/bsdgames-nonfree/hack/$file ]; then
mv -f /var/games/bsdgames-nonfree/hack/$file \
/var/games/bsdgames/hack/$file
fi
done
cp -a -f /var/games/bsdgames-nonfree/hack/save/* \
/var/games/bsdgames/hack/save/ 2>/dev/null || true
rm -f /var/games/bsdgames-nonfree/hack/save/* 2>/dev/null || true
rmdir -p /var/games/bsdgames-nonfree/hack/save 2>/dev/null || true
fi
touch $SCOREFILES
chown root:games $SCOREFILES
chmod 664 $SCOREFILES
ADVENTURE_PRIORITY=50
case "$action" in
configure)
update-alternatives --install \
/usr/games/adventure adventure \
/usr/games/bsdgames-adventure $ADVENTURE_PRIORITY \
--slave \
/usr/share/man/man6/adventure.6.gz adventure.6.gz \
/usr/share/man/man6/bsdgames-adventure.6.gz
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
printf "postinst called with unknown action %s\n" "$action" >&2
exit 1
;;
esac
2010-01-15 17:31:41 -05:00
# I have to make this directory here, because older version of this package
# always deleted it in their postrm. Oops.
mkdir -p /var/games/bsdgames/sail
chown root:games /var/games/bsdgames/sail
chmod g+rws /var/games/bsdgames/sail
#DEBHELPER#
exit 0