summaryrefslogtreecommitdiff
path: root/testing/glhack/glhack.install
blob: 78e1655bc150840ecf6064390cd126d88a2fcd1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
post_install() {
  touch var/games/glhack/{record,perm,logfile}
  chown root:games var/games/glhack/{record,perm,logfile}
  chmod 664 var/games/glhack/{record,perm,logfile}
}

pre_upgrade() {
  install -d -m775 var/games/glhack
  chown root:games var/games/glhack
  [ -e usr/share/glhack/record ] && cp usr/share/glhack/record var/games/glhack
  [ -e usr/share/glhack/perm ] && cp usr/share/glhack/perm var/games/glhack
  [ -e usr/share/glhack/logfile ] && cp usr/share/glhack/logfile var/games/glhack
  if [ -d usr/share/glhack/save ]; then
    chmod g-s usr/share/glhack/save
    mv usr/share/glhack/save var/games/glhack
  else
    install -d -m775 var/games/glhack/save
  fi
  chown root:games var/games/glhack/save
}

post_upgrade() {
  post_install
}