summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 798f14282eb590d75ca12f7f260b82114ddb2fdf (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
# Generated by debtap
# Contributor: holishing
pkgname=esunbank-webatm
pkgver=1.0.0.5
pkgrel=1
pkgdesc="玉山銀行晶片金融卡安控元件(Linux)10.0.5安裝. 這個精靈將指引你完成玉山銀行晶片金融卡安控元件(Linux)1.0.0.5的安裝流程。 在開始安裝之前,建議先關閉其他所有應用程式,並在安裝完成後於「套件庫」手動啟用玉山銀行晶片金融卡安控元件,或是重新啟動您的電腦。 按一下「安裝」開始安裝流程。 deb 套件請手動至玉山銀行 WebATM 入口頁面下載"
arch=('x86_64')
url="http://www.esunbank.com.tw"
license=('custom')
#groups=('')
makedepends=('libarchive')
depends=('libindicator-gtk2' 'desktop-file-utils' 'hicolor-icon-theme' 'libappindicator-gtk2' 'libcanberra' 'nss' 'pcsclite')
## please use browser agent to download deb package:
## https://netbank.esunbank.com.tw/webatm/assets/ActiveX/EsunATM.deb
source=('local://EsunATM.deb')
sha512sums=('176fdf1d9b331deabe3037a4e2ba49783b08f4cb430c1bbab21755e4b4d17185407c487f53da1cfa2909187fec7ed723bdea20fc4397ff0ad33fcfd973d4d48b')

package(){
	# Extract package data
	bsdtar -xvf EsunATM.deb
	bsdtar -xvf data.tar.xz -C "${pkgdir}"

	# Fix directories structure differencies (We cannot do this because the path is fixed)
	#cd "${pkgdir}"
	#mv usr/local/share/* usr/share; rm -rf usr/local
	#cd ..
}

pre_install() {
	sudo killall EsunATM_Service;
}

post_install() {
	gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
	echo "start install...."

	if [ -d /usr/local/share/esunbank/ ]; then
	    sudo chmod 755 /usr/local/share/esunbank/EsunATM_Service ;
	    echo "chmod EsunATM_Service..."
	fi

	certfile="/usr/local/share/esunbank/AAA_Certificate_Authority.crt"
	certname="AAA Root CA"

	###
	### For cert8 (legacy - DBM)
	###

	for certDB in $(sudo find /home/ -name "cert8.db")
	do

	    certdir=$(dirname ${certDB});
	    echo "add root  cert8.db..."
	    sudo certutil -A -n "${certname}" -t "TCu,Cu,Tu" -i ${certfile} -d dbm:${certdir}

	done

	###
	### For cert9 (SQL)
	###

	for certDB in $(sudo find /home/ -name "cert9.db")
	do
	    certdir=$(dirname ${certDB});
	    echo "add root  cert9.db..."
	    sudo certutil -A -n "${certname}" -t "TCu,Cu,Tu" -i ${certfile} -d sql:${certdir}
	done

	/usr/local/share/esunbank/EsunATM_Service &
	#sudo /usr/share/update-notifier/notify-reboot-required

	echo "install ok..." 
	update-desktop-database -q
}

post_remove() {
	gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
	sudo killall EsunATM_Service;
	update-desktop-database -q
}