summaryrefslogtreecommitdiff
path: root/gnome-unstable/gnome-games/gnome-games.install
blob: 1f67c2e010473a31fe20773b1fe247ecfcc7c169 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
pkgname=gnome-games
scores=(glines.Large.scores
	glines.Medium.scores
	glines.Small.scores
	gnibbles.1.0.scores
	gnibbles.1.1.scores
	gnibbles.2.0.scores
	gnibbles.2.1.scores
	gnibbles.3.0.scores
	gnibbles.3.1.scores
	gnibbles.4.0.scores
	gnibbles.4.1.scores
	gnobots2.classic_robots-safe.scores
	gnobots2.classic_robots-super-safe.scores
	gnobots2.classic_robots.scores
	gnobots2.nightmare-safe.scores
	gnobots2.nightmare-super-safe.scores
	gnobots2.nightmare.scores
	gnobots2.robots2-safe.scores
	gnobots2.robots2-super-safe.scores
	gnobots2.robots2.scores
	gnobots2.robots2_easy-safe.scores
	gnobots2.robots2_easy-super-safe.scores
	gnobots2.robots2_easy.scores
	gnobots2.robots_with_safe_teleport-safe.scores
	gnobots2.robots_with_safe_teleport-super-safe.scores
	gnobots2.robots_with_safe_teleport.scores
	gnomine.Custom.scores
	gnomine.Large.scores
	gnomine.Medium.scores
	gnomine.Small.scores
	gnotravex.2x2.scores
	gnotravex.3x3.scores
	gnotravex.4x4.scores
	gnotravex.5x5.scores
	gnotravex.6x6.scores
	gnotski.1.scores
	gnotski.10.scores
	gnotski.11.scores
	gnotski.12.scores
	gnotski.13.scores
	gnotski.14.scores
	gnotski.15.scores
	gnotski.16.scores
	gnotski.17.scores
	gnotski.18.scores
	gnotski.19.scores
	gnotski.2.scores
	gnotski.20.scores
	gnotski.21.scores
	gnotski.22.scores
	gnotski.23.scores
	gnotski.24.scores
	gnotski.25.scores
	gnotski.26.scores
	gnotski.27.scores
	gnotski.28.scores
	gnotski.29.scores
	gnotski.3.scores
	gnotski.30.scores
	gnotski.31.scores
	gnotski.32.scores
	gnotski.33.scores
	gnotski.34.scores
	gnotski.35.scores
	gnotski.36.scores
	gnotski.37.scores
	gnotski.4.scores
	gnotski.5.scores
	gnotski.6.scores
	gnotski.7.scores
	gnotski.8.scores
	gnotski.9.scores
	gtali.Colors.scores
	gtali.Regular.scores
	mahjongg.bridges.scores
	mahjongg.cloud.scores
	mahjongg.confounding.scores
	mahjongg.difficult.scores
	mahjongg.dragon.scores
	mahjongg.easy.scores
	mahjongg.pyramid.scores
	mahjongg.tictactoe.scores
	mahjongg.ziggurat.scores
	swell-foop.Large.scores
	swell-foop.Medium.scores
	swell-foop.Small.scores
	quadrapassel.scores)

post_install() {
  usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas
  usr/sbin/gconfpkg --install ${pkgname}
  update-desktop-database -q
  gtk-update-icon-cache -q -t -f usr/share/icons/hicolor

  for sz in Large Medium Small; do
    if [ -e "opt/gnome/var/games/same-gnome.${sz}.scores" ]; then
      mv "opt/gnome/var/games/same-gnome.${sz}.scores" \
        "var/games/swell-foop.${sz}.scores"
    elif [ -e "var/games/same-gnome.${sz}.scores" ]; then
      mv "var/games/same-gnome.${sz}.scores" \
        "var/games/swell-foop.${sz}.scores"
    fi
  done
  if [ -e "opt/gnome/var/games/gnometris.scores" ]; then
    mv "opt/gnome/var/games/gnometris.scores" \
      "var/games/quadrapassel.scores"
  elif [ -e "var/games/gnometris.scores" ]; then
    mv "var/games/gnometris.scores" \
      "var/games/quadrapassel.scores"
  fi

  for score in "${scores[@]}" ; do
    if [ -e "var/games/${score}" ]; then
      continue
    fi
    if [ -e "opt/gnome/var/games/${score}" ]; then
      mv "opt/gnome/var/games/${score}" var/games/
    else
      touch "var/games/${score}"
    fi
    chown root:games "var/games/${score}"
    chmod 664 "var/games/${score}"
  done
}

pre_upgrade() {
  pre_remove $1
}

post_upgrade() {
  post_install $1
}

pre_remove() {
  usr/sbin/gconfpkg --uninstall ${pkgname}

  if [ -f usr/share/ggz/gnect-client.dsc ]; then
    ggz-config -r -m usr/share/ggz/gnect-client.dsc >& /dev/null
    ggz-config -r -m usr/share/ggz/gnibbles-client.dsc >& /dev/null
    ggz-config -r -m usr/share/ggz/iagno-client.dsc >& /dev/null
  fi
}

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

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