summaryrefslogtreecommitdiff
blob: 54afc1769ea5300e67acda39ca2fceee6ef86305 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-auth/bioapi/bioapi-1.2.2.ebuild,v 1.4 2007/04/09 16:14:59 wolf31o2 Exp $

inherit eutils toolchain-funcs

DESCRIPTION="Framework for biometric-based authentication"
HOMEPAGE="http://www.bioapi.org"
SRC_URI="http://www.qrivy.net/~michael/blua/${PN}/${P}.tar.bz2"
LICENSE="bioapi"

SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="qt3"

RDEPEND="qt3? ( =x11-libs/qt-3* )"

src_compile() {
	VERGCC=$(gcc-version)
	if [ ${VERGCC} == 4.1 ]; then
		epatch ${FILESDIR}/bioapi-1.2.2_patch
	fi
	myconf="
		--host=${CHOST}\
		--prefix=/opt/bioapi \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--libdir=/usr/$(get_libdir) \
		--infodir=/usr/share/info \
		--mandir=/usr/share/man"

	if use qt3; then
		myconf="${myconf} --with-Qt-dir=/usr/qt/3"
	else
		myconf="${myconf} --without-Qt-dir"
	fi

	econf $myconf || die "./configure failed"
	emake || die "emake failed"
}

src_install() {
	make DESTDIR=${D} install || die "install failed"
	#and now we have to handle the docs
	dodoc README\
		00_License.htm \
		01_Readme.htm \
		09_Manifest.htm \
		10_Build.htm \
		11_Install.htm \
		12_Use.htm \
		20_Todo.htm \
		30_History.htm \
		31_Contributors.htm \
		32_Contacts.htm \
		Disclaimer
	insinto /opt/bioapi/include
	doins include/bioapi_util.h include/installdefs.h \
		imports/cdsa/v2_0/inc/cssmtype.h
	doenvd ${FILESDIR}/20bioapi
	insinto /etc/udev/rules.d
	doins ${FILESDIR}/51-bioapi.rules
}

pkg_postinst() {
	einfo "Running Module Directory Services (MDS) ..."
	/opt/bioapi/bin/mds_install -s /usr/lib || die " MDS failure"
	/opt/bioapi/bin/mod_install -fi /usr/lib/libbioapi100.so || die " mds bioapi100 failed"
	/opt/bioapi/bin/mod_install -fi /usr/lib/libbioapi_dummy100.so || die " mds bioapi_dummy100 failed"
	/opt/bioapi/bin/mod_install -fi /usr/lib/libpwbsp.so || die " mds pwbsp failed"

	if use qt3; then
	    /opt/bioapi/bin/mod_install -fi /usr/lib/libqtpwbsp.so || die " mds qtpwbsp failed"
	fi

	enewgroup bioapi
	chgrp bioapi /var/bioapi -R
	chmod g+w,o= /var/bioapi -R
	einfo "Note: users using bioapi must be in group bioapi."
}

pkg_prerm() {
	einfo "Running Module Directory Services (MDS) ..."
	/opt/bioapi/bin/mod_install -fu libbioapi100.so
	/opt/bioapi/bin/mod_install -fu libbioapi_dummy100.so
	/opt/bioapi/bin/mod_install -fu libpwbsp.so

	if use qt3; then
	    /opt/bioapi/bin/mod_install -fu libqtpwbsp.so
	fi

	einfo "You might want to remove the group bioapi."
	einfo "You might want to remove /var/bioapi."
}