File: install.sh

package info (click to toggle)
keyman 18.0.245-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,316 kB
  • sloc: python: 52,784; cpp: 21,278; sh: 7,633; ansic: 4,823; xml: 3,617; perl: 959; makefile: 139; javascript: 138
file content (72 lines) | stat: -rwxr-xr-x 1,957 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

# Install keyboardprocessor, ibus-keyman and keyman-config

# It must be run from the keyman/linux directory

set -e

BASEDIR=$(pwd)

SUDOINSTALL=${SUDOINSTALL:-"no"}

INSTALLDIR=${INSTALLDIR:-"/usr/local"}

if [[ "${SUDOINSTALL}" != "no" ]]; then
	if [ "$EUID" -ne 0 ]
	then
		echo "Please run 'build.sh un/install' with sudo"
	exit
	fi
fi

if [ -f "/usr/share/ibus/component/keyman.xml" ] && [ "${SUDOINSTALL}" == "yes" ]; then
	if grep -Fq "/usr/lib/ibus" /usr/share/ibus/component/keyman.xml
	then
		echo "component file is in ibus-keyman package version so move it"
		echo "run 'sudo build.sh uninstall' to put it back"
		mv /usr/share/ibus/component/keyman.xml /usr/share/doc/ibus-keyman/
	else
		echo "component file is local one so overwrite it"
	fi
fi

cd ../core/build/arch/release
ninja install
cd "$BASEDIR"

cd ibus-keyman
if [[ "${SUDOINSTALL}" == "uninstall" ]]; then
    echo "doing build.sh uninstall of ibus-keyman"
    ./build.sh uninstall
else
    echo "doing build.sh install of ibus-keyman"
    ./build.sh install
fi
cd "$BASEDIR"

cd keyman-config
echo "SUDOINSTALL: ${SUDOINSTALL}"
if [[ "${SUDOINSTALL}" == "yes" ]]; then
	if [ ! -d build ]; then
		echo "keyman-config must be built before it is installed. Run 'build.sh configure build'."
		exit 1
	fi
	echo "doing sudo glib-compile-schemas for keyman-config"
	cp resources/com.keyman.gschema.xml /usr/share/glib-2.0/schemas/
	glib-compile-schemas /usr/share/glib-2.0/schemas/
	echo "doing sudo install of keyman-config"
	./build.sh install
elif [[ "${SUDOINSTALL}" == "uninstall" ]]; then
	echo "doing sudo uninstall of keyman-config"
	./build.sh uninstall
else
	echo "doing /tmp install of keyman-config"
	./build.sh install
fi
cd "$BASEDIR"

if [ -f "/usr/share/doc/ibus-keyman/keyman.xml" ] && [ "${SUDOINSTALL}" == "uninstall" ]; then
	echo "putting ibus-keyman package component file back"
	mv /usr/share/doc/ibus-keyman/keyman.xml /usr/share/ibus/component/
fi