-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·88 lines (72 loc) · 1.81 KB
/
install.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
#!/bin/bash
function checkFile() {
if [ -f "$1" ]
then
echo "$1 - found"
found=1
else
echo "$1 - not found"
found=0
fi
}
function checkDir() {
if [ -d "$1" ]
then
echo "$1 - found"
found=1
else
echo "$1 - not found"
found=0
fi
}
function error() {
echo $1
exit 0
}
if [ "$EUID" -ne 0 ]
then error "You must execute this file via root (sudo ./install.sh)"
fi
checkDir /usr/include/wx-3.0
if [ $found == 0 ]
then error "Can't find wx-3.0 include dir. Have you installed wxWidgets (wxgtk3 and wxgtk packages, if you are using ArchLinux)?"
fi
checkDir /usr/lib/wx
if [ $found == 0 ]
then error "Can't find wx lib dir. Have you installed wxWidgets (wxgtk3 and wxgtk packages, if you are using ArchLinux)?"
fi
checkFile /bin/wx-config
if [ $found == 0 ]
then
checkFile /usr/bin/wx-config
if [ $found == 0 ]
then
error "Can't find wx-config. Have you installed wxWidgets (wxgtk3 and wxgtk packages, if you are using ArchLinux)?"
fi
fi
checkFile /bin/g++
if [ $found == 0 ]
then
checkFile /usr/bin/g++
if [ $found == 0 ]
then
error "Can't find g++ compiler"
fi
fi
echo "All right"
echo "Executing make.sh"
./make.sh install-build
echo
checkFile bin/nvidia-system-monitor
if [ $found == 0 ]
then
error "Compilation for some reason was failed"
fi
echo "Compilation done"
echo "Installation begins"
mkdir -p /usr/share/doc/nvidia-system-monitor
mkdir -p /usr/share/icons/hicolor/512x512/apps
cp bin/nvidia-system-monitor /usr/bin/nvidia-system-monitor
cp nvidia-system-monitor.desktop /usr/share/applications/nvidia-system-monitor.desktop
cp -r src/html /usr/share/doc/nvidia-system-monitor
cp icon.png /usr/share/icons/hicolor/512x512/apps/nvidia-system-monitor.png
echo "Installation done"