-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·34 lines (27 loc) · 1.24 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
#!/bin/bash
PRGNAM="face"
VERSION=$(< RELEASE)
install_root=${install_root:-""}
set -e
[ "$install_root" != "" ] && {
mkdir -p "$install_root"/usr/{bin,share/{applications,pixmaps,"$PRGNAM"/{autostart,icon_status,sound,translate}},doc/"$PRGNAM"-"$VERSION"}
} || {
mkdir -p /usr/{share/"$PRGNAM"/{autostart,icon_status,sound,translate},doc/"$PRGNAM"-"$VERSION"}
}
install -Dm 0644 appdata/"$PRGNAM".svg "$install_root"/usr/share/pixmaps
install -Dm 0644 appdata/"$PRGNAM".desktop "$install_root"/usr/share/applications
install -Dm 0644 appdata/"$PRGNAM"-autostart.desktop "$install_root"/usr/share/"$PRGNAM"/autostart
install -Dm 0644 icon_status/* "$install_root"/usr/share/"$PRGNAM"/icon_status
install -Dm 0644 translate/*.qm "$install_root"/usr/share/"$PRGNAM"/translate
install -Dm 0644 sound/* "$install_root"/usr/share/"$PRGNAM"/sound
cp -a ChangeLog LICENSE README.md "$install_root"/usr/doc/"$PRGNAM"-"$VERSION"
cp -Tr src "$install_root"/usr/share/"$PRGNAM"
echo "#!/bin/bash
cd /usr/share/$PRGNAM
[ \"\$(grep -E \"nouveau|nvidia\" <(lsmod))\" ] && {
LIBGL_ALWAYS_SOFTWARE=1 python3 main.py \"\$@\" || exit 1
} || {
python3 main.py \"\$@\" || exit 1
}" > "$install_root"/usr/bin/"$PRGNAM"
chmod 755 "$install_root"/usr/bin/"$PRGNAM"
exit 0