summarylogtreecommitdiffstats
path: root/xp-pen-tablet.install
blob: 0085e4d78128b6b20f30c5dcefc482263fad597e (plain)
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
#!/bin/bash
pre_install()  {
AppName=pentablet
AppDir=pentablet
pid=`ps -e|grep $AppName`
appScript=$AppName".sh"
if [ -n "$pid" ]; then
	echo $pid
	arr=()
	while read -r line; do
	   arr+=("$line")
	done <<< "$pid"
	for val in "${arr[@]}";
	do
		appid=`echo $val | awk '{print $1}'`
	   	name=`echo $val | awk '{print $4}'`
	   	echo "ID:"$appid
		echo "Name:"$name
		if [ "$name" = "$appRunScript" ]; then
			echo "close $appRunScript"
			kill -15 $appid
		elif [ "$name" = "$AppName" ]; then
			echo "close $AppName"
			kill -15 $appid
		fi
	done
fi
}

post_install() {

appDir=/usr/lib/pentablet
confPath=$appDir/conf/xppen
libPath=$appDir/lib
platPath=$appDir/platforms


chmod +0777 /etc/xdg/autostart/xppentablet.desktop
chmod +0777 /usr/share/applications/xppentablet.desktop
chmod +0777 /usr/share/icons/pentablet.png

chmod +0777 $appDir/pentablet
chmod +0777 $appDir/pentablet.sh
chmod +0666 $appDir/resource.rcc

#Moved to package() script to avoid warnings during installation/updates
#chmod +0777 $confPath
#chmod +0777 $libPath
#chmod +0777 $platPath

chmod +0666 $confPath/config.xml
chmod +0666 $confPath/language.ini
chmod +0666 $confPath/name_config.ini

chmod +0666 $libPath/libicudata.so.56
chmod +0666 $libPath/libicui18n.so.56
chmod +0666 $libPath/libicuuc.so.56
chmod +0666 $libPath/libQt5Core.so.5
chmod +0666 $libPath/libQt5DBus.so.5
chmod +0666 $libPath/libQt5Gui.so.5
chmod +0666 $libPath/libQt5Network.so.5
chmod +0666 $libPath/libQt5Widgets.so.5
chmod +0666 $libPath/libQt5X11Extras.so.5
chmod +0666 $libPath/libQt5XcbQpa.so.5
chmod +0666 $libPath/libQt5Xml.so.5

chmod +0666 $platPath/libqxcb.so

lockfile="/tmp/qtsingleapp-Pentab-9c9b-lockfile"
touch $lockfile
chmod +0666 $lockfile

if [ -f "/etc/xdg/autostart/pentablet.desktop" ]; then
	rm /etc/xdg/autostart/ugee-pentablet.desktop
fi

echo "Installation successful!"
echo "If you are installing for the first time, please use it after restart."

}
pre_upgrade() {
pre_install
}
post_upgrade() {
post_install
}
pre_remove () {
 pre_install
 lockfile="/tmp/qtsingleapp-Pentab-9c9b-lockfile"
 rm $lockfile
 }
 post_remove(){
 echo "Uninstall succeeded."
 }