summaryrefslogtreecommitdiff
path: root/extra/gnome-robots/gnome-robots.install
blob: 3422e0c8ab1f5b2b1fde48f13bca2df35014cd91 (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
43
44
45
46
47
_scores=(
	gnome-robots2.robots2.scores
	gnome-robots2.robots2-safe.scores
	gnome-robots2.robots2-super-safe.scores
	gnome-robots2.robots2_easy.scores
	gnome-robots2.robots2_easy-safe.scores
	gnome-robots2.robots2_easy-super-safe.scores
	gnome-robots2.classic_robots.scores
	gnome-robots2.classic_robots-safe.scores
	gnome-robots2.classic_robots-super-safe.scores
	gnome-robots2.robots_with_safe_teleport.scores
	gnome-robots2.robots_with_safe_teleport-safe.scores
	gnome-robots2.robots_with_safe_teleport-super-safe.scores
	gnome-robots2.nightmare.scores
	gnome-robots2.nightmare-safe.scores
	gnome-robots2.nightmare-super-safe.scores
)

post_install() {
  glib-compile-schemas usr/share/glib-2.0/schemas
  update-desktop-database -q
  gtk-update-icon-cache -q -f usr/share/icons/hicolor

  for score in "${_scores[@]}" ; do
    if [ -e "var/games/$score" ]; then
      continue
    fi

    touch "var/games/$score"
    chown root:games "var/games/$score"
    chmod 664 "var/games/$score"
  done
}

post_upgrade() {
  post_install
}

post_remove() {
  glib-compile-schemas usr/share/glib-2.0/schemas
  update-desktop-database -q
  gtk-update-icon-cache -q -f usr/share/icons/hicolor

  for score in "${_scores[@]}" ; do
    rm -f "var/games/$score"
  done
}