aboutsummaryrefslogtreecommitdiff
blob: 9862d3b7f2f89f7e9ae5c2dc491238bfb7eb6ee7 (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
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="O plugin Autenticação.Gov (anteriormente designado por aplicação Autenticação.gov.pt) permite realizar o procedimento de autenticação com o Cartão de Cidadão sem necessidade de efetuar a instalação de qualquer componente no navegador"
HOMEPAGE="https://autenticacao.gov.pt/fa/ajuda/autenticacaogovpt.aspx"

inherit unpacker desktop

SRC_URI="https://aplicacoes.autenticacao.gov.pt/plugin/plugin-autenticacao-gov.deb -> ${P}.deb"

LICENSE="EUPL"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="sys-apps/pcsc-lite
	sys-apps/pcsc-tools
	app-crypt/ccid
	( >=virtual/jdk-1.8:1.8 || ( >=dev-java/oracle-jdk-bin-1.8:1.8 dev-java/icedtea dev-java/icedtea-bin ) )"
RDEPEND="${DEPEND}
	!app-misc/autenticacao-gov-pt:2
	!app-misc/autenticacao-gov-pt:3"

S="${WORKDIR}/"

parse_icons() {
	regex="([^_]+)_([0-9]+).png$"
	cd /usr/share/plugin-${P}
	for file in *.png
	do
		if [[ $file  =~ $regex ]]
		then
			icon="${BASH_REMATCH[1]##*/}"
			size="${BASH_REMATCH[2]}"
			newicon -s "${size}" "${file}" "${icon}"
		fi
	done
}

src_unpack() {
	default
	unpack_deb ${A}
}

src_prepare() {
	default
}

src_configure() {
	true
}

src_compile() {
	true
}

src_install() {
	# deb install
	cp -R "${WORKDIR}/usr" "${D}" || die "Error: copy files in install phase failed!"
	regex="(.*)_([0-9]+).png$"
	for file in "${D}/usr/share/plugin-${P}"/*.png
	do
		if [[ ${file}  =~ ${regex} ]]
		then
			icon_aux="${BASH_REMATCH[1]##*/}"
			icon="${icon_aux//_/-}"
			size="${BASH_REMATCH[2]}"
			insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
			newicon -s "${size}" "${file}" "${icon}"
		fi
	done
}