postinst 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/sh
  2. set -e
  3. SCOREFILES="
  4. /var/games/bsdgames/atc_score
  5. /var/games/bsdgames/battlestar.log
  6. /var/games/bsdgames/cfscores
  7. /var/games/bsdgames/criblog
  8. /var/games/bsdgames/robots_roll
  9. /var/games/bsdgames/saillog
  10. /var/games/bsdgames/snake.log
  11. /var/games/bsdgames/snakerawscores
  12. /var/games/bsdgames/tetris-bsd.scores
  13. /var/games/bsdgames/phantasia/characs
  14. /var/games/bsdgames/phantasia/gold
  15. /var/games/bsdgames/phantasia/lastdead
  16. /var/games/bsdgames/phantasia/mess
  17. /var/games/bsdgames/phantasia/motd
  18. /var/games/bsdgames/phantasia/scoreboard
  19. /var/games/bsdgames/phantasia/void
  20. /var/games/bsdgames/phantasia/monsters
  21. /var/games/bsdgames/hack/perm
  22. /var/games/bsdgames/hack/record"
  23. # Hack moved over from bsdgames-nonfree.
  24. if [ -d /var/games/bsdgames-nonfree ]; then
  25. for file in perm record; do
  26. if [ -e /var/games/bsdgames-nonfree/hack/$file ]; then
  27. mv -f /var/games/bsdgames-nonfree/hack/$file \
  28. /var/games/bsdgames/hack/$file
  29. fi
  30. done
  31. cp -a -f /var/games/bsdgames-nonfree/hack/save/* \
  32. /var/games/bsdgames/hack/save/ 2>/dev/null || true
  33. rm -f /var/games/bsdgames-nonfree/hack/save/* 2>/dev/null || true
  34. rmdir -p /var/games/bsdgames-nonfree/hack/save 2>/dev/null || true
  35. fi
  36. # These files cannot just be zero-byte files:
  37. if [ ! -e /var/games/bsdgames/phantasia/void ]; then
  38. cp /usr/share/games/bsdgames/phantasia/void \
  39. /var/games/bsdgames/phantasia/void
  40. fi
  41. if [ ! -e /var/games/bsdgames/phantasia/monsters ] ; then
  42. cp /usr/share/games/bsdgames/phantasia/monsters \
  43. /var/games/bsdgames/phantasia/monsters
  44. fi
  45. touch $SCOREFILES
  46. chown root:games $SCOREFILES
  47. chmod 664 $SCOREFILES
  48. # These files may not be world-readable as they have passwords
  49. # in them.
  50. chmod 660 /var/games/bsdgames/phantasia/characs
  51. # I have to make this directory here, because older version of this package
  52. # always deleted it in their postrm. Oops.
  53. mkdir -p /var/games/bsdgames/sail
  54. chown root:games /var/games/bsdgames/sail
  55. chmod g+rws /var/games/bsdgames/sail
  56. #DEBHELPER#