-
Notifications
You must be signed in to change notification settings - Fork 2
/
prov.sh
141 lines (118 loc) · 3.34 KB
/
prov.sh
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
#!/bin/bash
#
# Config
#
ECLIPSE_ARCHIVE=eclipse-emoflon-linux-user
set -e
START_PWD=$PWD
#
# Utils
#
# Displays the given input including "=> " on the console.
log () {
echo "=> $1"
}
#
# Script
#
log "Start provisioning."
# Updates
log "Installing updates."
sudo apt-get update
sudo apt-get upgrade -y
# Java/JDK21
log "Installing OpenJDK."
sudo apt-get install -y openjdk-21-jdk
#java --version
# Packages for building a new kernel
sudo apt-get install -y gcc make perl
# eMoflon Eclipse
log "Installing eMoflon Eclipse."
sudo apt-get install -y graphviz
mkdir -p ~/eclipse-apps
cd ~/eclipse-apps
# Get eclipse
if [[ ! -f "./$ECLIPSE_ARCHIVE.zip" ]]; then
log "Downloading latest eMoflon Eclipse archive from Github."
curl -s --header "Authorization: Bearer ${GITHUB_TOKEN}" \
https://api.github.com/repos/eMoflon/emoflon-ibex-eclipse-build/releases/latest \
| grep "$ECLIPSE_ARCHIVE.zip" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -q --header="Authorization: Bearer ${GITHUB_TOKEN}" -i - \
|| :
fi
if [[ ! -f "./$ECLIPSE_ARCHIVE.zip" ]]; then
log "Download of eMoflon Eclipse archive failed."
exit 1;
fi
unzip -qq -o $ECLIPSE_ARCHIVE.zip
rm -f $ECLIPSE_ARCHIVE.zip
# Create desktop launchers
mkdir -p /home/vagrant/Desktop
touch /home/vagrant/Desktop/emoflon-app.desktop
printf "
[Desktop Entry]
Version=1.0
Name=eMoflon::IBeX Eclipse
Comment=Use eMoflon::IBeX Eclipse
GenericName=eMoflon::IBeX Eclipse
Exec=bash -c \"cd /home/vagrant/eclipse-apps/eclipse && ./eclipse\"
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/home/vagrant/eclipse-apps/eclipse/icon.xpm
StartupNotify=true
" > /home/vagrant/Desktop/emoflon-app.desktop
touch /home/vagrant/Desktop/emoflon-website.desktop
printf "
[Desktop Entry]
Encoding=UTF-8
Name=eMoflon::IBeX Website
Type=Link
URL=https://emoflon.org/ibex
Icon=web-browser
" > /home/vagrant/Desktop/emoflon-website.desktop
touch /home/vagrant/Desktop/emoflon-tutorial.desktop
printf "
[Desktop Entry]
Encoding=UTF-8
Name=eMoflon::IBeX Tutorial
Type=Link
URL=https://github.com/eMoflon/emoflon-ibex-tutorial/releases/latest
Icon=web-browser
" > /home/vagrant/Desktop/emoflon-tutorial.desktop
touch /home/vagrant/Desktop/emoflon-tests.desktop
printf "
[Desktop Entry]
Encoding=UTF-8
Name=eMoflon::IBeX Test Suite
Type=Link
URL=https://github.com/eMoflon/emoflon-ibex-tests
Icon=web-browser
" > /home/vagrant/Desktop/emoflon-tests.desktop
chmod u+x /home/vagrant/Desktop/*.desktop
sudo mv /home/vagrant/Desktop/*.desktop /usr/share/xubuntu/applications/
sudo ln -s /usr/share/xubuntu/applications/emoflon-app.desktop /home/vagrant/Desktop/emoflon-app.desktop
sudo ln -s /usr/share/xubuntu/applications/emoflon-website.desktop /home/vagrant/Desktop/emoflon-website.desktop
sudo ln -s /usr/share/xubuntu/applications/emoflon-tutorial.desktop /home/vagrant/Desktop/emoflon-tutorial.desktop
sudo ln -s /usr/share/xubuntu/applications/emoflon-tests.desktop /home/vagrant/Desktop/emoflon-tests.desktop
# Install additional CLI tools
log "Install additional CLI tools."
sudo apt-get install -yq \
git \
ncdu \
htop \
tmux \
rsync
# Clean up
log "Clean-up"
sudo apt-get remove -yq \
libreoffice-* \
thunderbird \
pidgin \
gimp \
evolution
sudo apt-get autoremove -yq
sudo apt-get clean cache
log "Finished provisioning."