File: install.sh

package info (click to toggle)
sandboxgamemaker 2.7.1%2Bdfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: wheezy
  • size: 5,868 kB
  • sloc: cpp: 104,572; ansic: 1,446; makefile: 809; sh: 285
file content (74 lines) | stat: -rw-r--r-- 1,931 bytes parent folder | download
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
#!/bin/bash
# dear packagers, please run this script as follows in a chroot jail
# PREFIX=/path/to/install ./install.sh

if [ "${PREFIX}" == "" ]
then
	echo "You are installing sandbox globally, if you wish to abort, hit Ctrl-C now"
	echo ""
	echo "Enter installation path..."
	echo "default: /usr/local/share/games"
	read PREFIX

	if [ "${PREFIX}" == "" ]
	then
		PREFIX="/usr/local/share/games"
	fi

	echo "Sandbox will be installed in \"${PREFIX}/sandbox\""
	echo "Press enter to continue"
	read CC
fi

if [ -e "${PREFIX}/sandbox" ]
then
	echo "NOTE, \"${PREFIX}/sandbox\" already exists"
	rm -rf "${PREFIX}/sandbox"
fi

if [ -e "/usr/bin/sandbox" ]
then
	echo "NOTE, \"/usr/bin/sandbox\" already exists"
	rm -f "/usr/bin/sandbox"
fi

echo "Creating directory \"${PREFIX}/sandbox\""
mkdir -p "${PREFIX}/sandbox"
if [ $? -ne 0 ]
then
	echo "Failed to create directory, do you have permission?"
	exit 1
fi

echo "Copying files to \"${PREFIX}/sandbox\" (this may take a while)"
cp -r . "${PREFIX}/sandbox"
if [ $? -ne 0 ]
then
	echo "Failed to copy files, do you have permission?"
	exit 1
fi

echo "Creating symlink from \"/usr/bin/sandbox\" to \"${PREFIX}/sandbox/sandbox_unix\""
ln -s "${PREFIX}/sandbox/sandbox_unix" "/usr/bin/sandbox"
if [ $? -ne 0 ]
then
	echo "Failed to create symlink, do you have permission?"
	exit 1
fi

echo "Installing pixmaps to /usr/share/pixmaps"
cp ./linux/*.png "/usr/share/pixmaps"

echo "Installing .desktop files"
cp ./linux/*.desktop "/usr/share/applications"

echo "Sandbox has been successfully installed"
echo ""
echo "To fully uninstall sandbox, run the following commands"
echo "rm /usr/bin/sandbox"
echo "rm -r \"${PREFIX}/sandbox\""
echo "rm /usr/share/pixmaps/sandbox_*"
echo "rm /usr/share/applications/sandbox_*"
echo ""
echo "To run sandbox, simply enter \"sandbox\" into your shell of choice"
echo "or select one of the launcher from your desktop's menu under the \"Games\" subtree"