summarylogtreecommitdiffstats
path: root/nquake-base.install
blob: 1d6ec15660f51e07944143d9f23a66d6d83e3fd6 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
post_install() {
  echo
  echo '!!! NOTE !!!'
  echo 'It is *strongly* encouraged to add users to the "users" group (usermod -aG users <username>) if they will be playing ezQuake/nQuake.
  Trust me. If you hit a bug and you are using a user not in the users group, you are testing bad and you should feel bad.'
  echo
  echo "nQuake has been installed. Please copy the retail pak0.pak and pak1.pak files (as exactly those filenames) to /opt/quake/id1/
  and do this (as root):  chmod 0775 /opt/quake/id1/*.pak ; chgrp users /opt/quake/id1/*.pak'
  If you do not have the retail paks, please copy the shareware pak0.pak and /usr/share/nquake/gpl_maps.pk3 to /opt/quake/id1/
  and do (as root): chmod 0775 /opt/quake/id1/{*.pak,*.pk3} ; chgrp users /opt/quake/id1/{*.pak,*.pk3)"
  echo 'You can find the shareware pak0.pak at http://qw.quakephil.com/nquake/qsw106.zip (or any of the other nQuake mirrors) (in the ID1/PAK0.PAK path).'
  echo

  # This is needed to avoid having sed as a runtime/install dependency. grumble, grumble, grumble.
  if [ -f "/opt/quake/ezquake/pak.lst" ];
  then
    cp -a /opt/quake/ezquake/pak.lst /opt/quake/ezquake/paklst.no_nquake
    echo 'nquake_ezquake.pk3' > /opt/quake/ezquake/pak.lst
    cat /opt/quake/ezquake/paklst.no_nquake >> /opt/quake/ezquake/pak.lst
  else
    echo "Whoops. You might be doing something naughty, as I can't inject the nquake-provided ezquake.pk3 into the proper pak.lst."
    echo "Things *might* or *might not* work quite as expected."
  fi
}

post_upgrade() {

  # fix group ownerships...
  find /opt/quake -group games -exec chgrp users '{}' \;

}

post_remove() {
  # Undo our stupid clever little hack.
  if [ -f "/opt/quake/ezquake/paklst.no_nquake" ];
  then
    mv /opt/quake/ezquake/paklst.no_nquake /opt/quake/ezquake/pak.lst
  else
    echo "Weird; I can't seem to remove our injected entry from the proper pak.lst."
    echo "You weren't doing something naughty like arbitrarily deleting files from your filesystem, were you?"
  fi
}