-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathosPrereqs
More file actions
executable file
·107 lines (93 loc) · 2.95 KB
/
osPrereqs
File metadata and controls
executable file
·107 lines (93 loc) · 2.95 KB
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
#! /bin/bash
#=========================================================================
# Copyright (c) 2015 GemTalk Systems, LLC <dhenrich@gemtalksystems.com>.
#=========================================================================
echo "================="
echo " GsDevKit script: $(basename $0) $*"
echo "================="
set -e # exit on error
usage() {
cat <<HELP
USAGE: $(basename $0) [-h] [-X] [-G]
Install os-specific required packages:
- 32 bit libraries
- git
- curl
- unzip
- ssl
- PAM
and os-specific optional packages:
- X11
If the file $GS_HOME/bin/.osPrereqsSysSetup exists, then the prerequisite installation is skipped.
OPTIONS
-h
display help
-G
install GemTools and the GemTools prerequisites
-X
if present, X11 client installed
EXAMPLES
./$(basename $0) -h
./$(basename $0)
./$(basename $0) -X
./$(basename $0) -G -X
HELP
}
installUbuntuPackages(){
sudo apt-get -y update
sudo apt-get -y install curl
sudo apt-get -y install git
sudo apt-get -y install zip
sudo apt-get -y install unzip
sudo apt-get -y install libpam0g:i386
sudo apt-get -y install libssl1.0.0:i386
sudo apt-get -y install gcc-multilib libstdc++6:i386
sudo apt-get -y install gdb
sudo apt-get -y install libfreetype6:i386
sudo apt-get -y install pstack
sudo /bin/su -c "echo 'kernel.yama.ptrace_scope = 0' >>/etc/sysctl.d/10-ptrace.conf"
if [ "${X11client}x" = "1x" ] ; then
sudo apt-get -y install libgl1-mesa-dev:i386
sudo apt-get -y install libxcb-dri2-0:i386
fi
if [ "${gemtools}" = "true" ] ; then
if [ ! -d "GemTools-1.0-beta.8.7-3101x.app" ] ; then
sudo apt-get -y install libXrender1:i386
sudo apt-get -y install libSM6:i386
sudo apt-get -y install libICE6:i386
wget http://seaside.gemtalksystems.com/squeak/GemTools-1.0-beta.8.7-310x.zip
unzip GemTools-1.0-beta.8.7-310x.zip
fi
fi
}
os=`lsb_release -rs`
X11client=""
gemtools=""
while getopts "h:GX" OPT ; do
case "$OPT" in
G) gemtools="true";;
h) usage; exit 0 ;;
X) X11client="1";;
*) usage; exit 1 ;;
esac
done
shift $(($OPTIND - 1))
# touch the following file, if you prefer to skip the installation of prerequisites
osPrereqsSysSetup=$GS_HOME/bin/.osPrereqsSysSetup # if file exists, skip installation
if [ -e "$osPrereqsSysSetup" ]; then
echo "Skip operating system prerequisites, operating system prerequisites already installed ($osPrereqsSysSetup exists)"
else
case "$os" in
12.04)
installUbuntuPackages
sudo ln -f -s /lib/i386-linux-gnu/libpam.so.0 /lib/libpam.so.0
sudo ln -f -s /usr/lib/i386-lin-gnu/libstdc++.so.6 /usr/lib/i386-linux-gnu/libstdc++.so
;;
14.04)
sudo dpkg --add-architecture i386
installUbuntuPackages
sudo ln -f -s /usr/lib/i386-lin-gnu/libstdc++.so.6 /usr/lib/i386-linux-gnu/libstdc++.so
;;
*) echo "unrecognized Ubuntu version $os"; usage; exit 1;;
esac
fi