-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-eclipse
More file actions
executable file
·52 lines (45 loc) · 1.18 KB
/
install-eclipse
File metadata and controls
executable file
·52 lines (45 loc) · 1.18 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
#!/bin/bash -e
function die {
echo $@
exit 3
}
if [ -z "$1" ] ; then
die "usage: install-eclipse eclpise-x-x-x-x86_64.tar.gz"
elif [ "$EUID" != "0" ] ; then
die "You must run this as root"
fi
echo "Installing dependencies"
if ! apt-get -y install junit4 libhamcrest-java ; then
die "Failed to install dependencies"
fi
echo "Uncompressing to /opt"
if ! sudo tar xf "$1" -C "/opt" ; then
die "Error: Failed to uncompress properly"
elif [ ! -d /opt/eclipse ] ; then
die "Could not find /opt/eclipse"
elif ! chmod -R +r /opt/eclipse ; then
die "Could not make all of the files universally readable"
fi
if [ ! -f /usr/bin/eclipse ] ; then
echo "Creating eclipse startup file"
cat > /usr/bin/eclipse <<EOF
export ECLIPSE_HOME="/opt/eclipse"
\$ECLIPSE_HOME/eclipse \$*
EOF
chmod 755 /usr/bin/eclipse
fi
if [ ! -f /usr/share/applications/eclipse.desktop ] ; then
echo "Creating the desktop menu item"
cat > /usr/share/applications/eclipse.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
EOF
fi