forked from varnamproject/govarnam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh.in
executable file
·35 lines (27 loc) · 1.26 KB
/
install.sh.in
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
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ARG1=${1:-install}
if [ "$ARG1" == "install" ]; then
sudo cp "$SCRIPT_DIR/varnamcli" "@INSTALL_PREFIX@/bin/varnamcli"
sudo mkdir -p "@INSTALL_PREFIX@/lib/pkgconfig"
sudo cp "$SCRIPT_DIR/libgovarnam.so" "@INSTALL_PREFIX@/lib/libgovarnam.so.@VERSION@"
sudo ln -s "@INSTALL_PREFIX@/lib/libgovarnam.so.@VERSION@" "@INSTALL_PREFIX@/lib/libgovarnam.so"
sudo cp "$SCRIPT_DIR/govarnam.pc" "@INSTALL_PREFIX@/lib/pkgconfig/"
sudo mkdir -p "@INSTALL_PREFIX@/include/libgovarnam"
sudo cp "$SCRIPT_DIR/"*.h "@INSTALL_PREFIX@/include/libgovarnam/"
sudo ldconfig
sudo mkdir -p "@INSTALL_PREFIX@/share/varnam/schemes"
msg="Installation finished"
echo "$msg"
notify-send "$msg" || true
elif [ "$ARG1" == "uninstall" ]; then
sudo rm "@INSTALL_PREFIX@/bin/varnamcli" "@INSTALL_PREFIX@/lib/libgovarnam.so.@VERSION@" "@INSTALL_PREFIX@/lib/libgovarnam.so" "@INSTALL_PREFIX@/lib/pkgconfig/govarnam.pc"
sudo rm "@INSTALL_PREFIX@/include/libgovarnam/"*
sudo rmdir "@INSTALL_PREFIX@/include/libgovarnam"
sudo rm "@INSTALL_PREFIX@/share/varnam/schemes/"*
sudo rmdir "@INSTALL_PREFIX@/share/varnam/schemes/"
msg="Uninstallation finished"
echo $msg
else
echo "Unknown argument"
fi