summaryrefslogtreecommitdiff
path: root/extra/gnome-nibbles/gnome-nibbles.install
blob: 8106ea53c7ea8b7f3b67f468cf89856a063bbc5e (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
_scores=(
	gnome-nibbles.1.0.scores
	gnome-nibbles.2.0.scores
	gnome-nibbles.3.0.scores
	gnome-nibbles.4.0.scores
	gnome-nibbles.1.1.scores
	gnome-nibbles.2.1.scores
	gnome-nibbles.3.1.scores
	gnome-nibbles.4.1.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
}