-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup_client_from_scratch.sh
More file actions
executable file
·100 lines (80 loc) · 2.3 KB
/
setup_client_from_scratch.sh
File metadata and controls
executable file
·100 lines (80 loc) · 2.3 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
#!/bin/bash
set -e
LOGGED_USER=`whoami`
TARGET_DIR=/opt/misura4
BASH_RC=~/.bashrc
PROFILE_RC=~/.profile
DESKTOP=`xdg-user-dir DESKTOP`
function update_bashrc {
echo Updating $1
LINE="export VEUSZ_RESOURCE_DIR=\"$TARGET_DIR/veusz\""
grep -q -F "$LINE" $1 || echo $LINE >> $1
LINE="export PYTHONPATH=\$PYTHONPATH:$TARGET_DIR/veusz"
grep -q -F "$LINE" $1 || echo $LINE >> $1
LINE="source \"$TARGET_DIR/misura.canon/misura/canon/canondefine.sh\""
grep -q -F "$LINE" $1 || echo $LINE >> $1
LINE="source \"$TARGET_DIR/misura.client/misura/client/clientdefine.sh\""
grep -q -F "$LINE" $1 || echo $LINE >> $1
}
update_bashrc "$BASH_RC"
update_bashrc "$PROFILE_RC"
function create_icon {
echo Creating desktop icon for $1
echo "[Desktop Entry]
Type=Application
Exec=bash -c \"source /home/$LOGGED_USER/.profile; python /opt/misura4/misura.client/misura/client/bin/$1.py\"
Terminal=false
Name=$1
Icon=/opt/misura4/misura.client/misura/client/art/$2" > "$DESKTOP/$1.desktop"
chmod +x "$DESKTOP/$1.desktop"
}
create_icon acquisition icon.svg
create_icon browser browser.svg
create_icon graphics graphics.svg
echo "INSTALLING..."
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y build-dep veusz
sudo apt-get -y install python-qt4-sql libqt4-sql-sqlite
#sudo apt-get -y install python-pyqt5 libqt5sql5-sqlite
sudo apt-get -y install wget unzip git-core python-setuptools python-scipy
sudo apt-get -y install libhdf5-10 libhdf5-dev
sudo apt-get -y install libqt4-opengl python-qt4-gl
sudo easy_install pip
export HDF5_DIR=/opt/local
sudo -H pip install tables pycrypto pygments PyOpenGL PyOpenGL-accelerate pyqtgraph
echo
echo
echo Creating $TARGET_DIR
sudo mkdir -p $TARGET_DIR
sudo chown $LOGGED_USER $TARGET_DIR
echo "done."
echo "Getting Misura4 sources..."
cd $TARGET_DIR
if [ -d misura.client ]; then
cd misura.client
git pull --rebase
cd ..
else
git clone https://bitbucket.org/tainstr/misura.client.git
fi
if [ -d misura.canon ]; then
cd misura.canon
git pull --rebase
cd ..
else
git clone https://bitbucket.org/tainstr/misura.canon.git
fi
if [ -d veusz ]; then
cd veusz
git pull --rebase
cd ..
else
git clone https://github.com/tainstr/veusz.git
fi
echo "done cloning."
echo "Building Veusz helpers"
cd $TARGET_DIR/veusz
python setup.py build_ext --inplace
source $BASH_RC
echo "Misura Client Setup complete"