aboutsummaryrefslogtreecommitdiff
blob: 6c0eb4fbec271b69ea812ff0c37d7a32c298622a (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DESCRIPTION="Tools for authenticating with https://www.autenticacao.gov.pt/"
HOMEPAGE="https://www.autenticacao.gov.pt/"

inherit subversion unpacker eutils

#SRC_URI="https://autenticacao.gov.pt/fa/ajuda/software/autenticacao.gov.pt.deb"
ESVN_REPO_URI="https://svn.gov.pt/projects/ccidadao/repository/middleware-offline/tags/version${PV}/source/trunk/_src/eidmw"
ESVN_PATCHES="${FILESDIR}/*.patch"

LICENSE="EUPL"
SLOT="2"
KEYWORDS="~amd64 ~x86"
IUSE="+java"

DEPEND="sys-apps/pcsc-lite
	dev-java/icedtea
	sys-apps/pcsc-tools
	app-crypt/ccid
	>=dev-qt/qtcore-5
	dev-qt/qtchooser
	dev-libs/xml-security-c
	dev-libs/xerces-c
	app-text/poppler
	java? ( >=virtual/jdk-1.8:1.8 >=dev-java/oracle-jdk-bin-1.8:1.8 )"
RDEPEND="${DEPEND}"

PATCHES=(
	"${FILESDIR}/qmake.patch"
	"${FILESDIR}/Makefile.gnu.patch"
	)

src_unpack() {
	default
	subversion_src_unpack
	#if use java; then unpack_deb ${A}; fi
	if use java; then
		unpack_deb ${FILESDIR}/autenticacao.gov.pt-${PV}.deb
		unpack ${FILESDIR}/extras-${PV}.tar.gz
	fi
}

src_prepare() {
	if declare -p PATCHES | grep -q "^declare -a "; then
		[[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" || die "Error: failed to apply ebuild patches ${PATCHES}!"
	else
		[[ -n ${PATCHES} ]] && eapply ${PATCHES} || die "Error: failed to apply ebuild patches ${PATCHES}!"
	fi
	eapply_user
}

src_configure() {
	# configure
	if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
		${ECONF_SOURCE:-.}/configure || die "Error: econf failed"
	elif [[ -f ${ECONF_SOURCE:-.}/configure ]] ; then
		fperms 755 ${ECONF_SOURCE:-.}/configure
		${ECONF_SOURCE:-.}/configure || die "Error: econf failed"
	else
		die "Error: ${ECONF_SOURCE:-.}/configure doesn't exists"
	fi
}

src_compile() {
	# make
	if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
		emake || die "Error: emake failed"
	else
		die "Error: compile phase failed because is missing Makefile!"
	fi
}

src_install() {
	# make install
	if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
		emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "Error: emake install failed"
	else
		die "Error: install phase failed because is missing Makefile!"
	fi

	# deb install
	if use java; then
		cp -R "${WORKDIR}/usr" "${D}" || die "Error: copy files in install phase failed!"
	fi
}