| 1 |
jdhore |
1.3 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
nerdboy |
1.1 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
jdhore |
1.3 |
# $Header: /var/cvsroot/gentoo-x86/app-crypt/coolkey/coolkey-1.1.0-r4.ebuild,v 1.2 2011/04/20 02:26:57 nerdboy Exp $
|
| 4 |
nerdboy |
1.1 |
|
| 5 |
|
|
EAPI=3
|
| 6 |
|
|
|
| 7 |
|
|
inherit eutils
|
| 8 |
|
|
|
| 9 |
|
|
PDATE="20110419"
|
| 10 |
|
|
|
| 11 |
|
|
DESCRIPTION="Linux Driver support for the CoolKey and CAC products"
|
| 12 |
|
|
HOMEPAGE="http://directory.fedora.redhat.com/wiki/CoolKey"
|
| 13 |
|
|
SRC_URI="http://directory.fedora.redhat.com/download/coolkey/${P}.tar.gz
|
| 14 |
|
|
mirror://gentoo/${PN}-patches-${PDATE}.tar.gz"
|
| 15 |
|
|
|
| 16 |
|
|
LICENSE="LGPL-2.1"
|
| 17 |
|
|
SLOT="0"
|
| 18 |
|
|
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
|
| 19 |
|
|
IUSE="debug"
|
| 20 |
|
|
|
| 21 |
|
|
RDEPEND=">=sys-apps/pcsc-lite-1.6.4
|
| 22 |
|
|
dev-libs/nss[utils]
|
| 23 |
|
|
sys-libs/zlib"
|
| 24 |
|
|
|
| 25 |
|
|
DEPEND="${RDEPEND}
|
| 26 |
|
|
>=app-crypt/ccid-1.4.0
|
| 27 |
jdhore |
1.3 |
virtual/pkgconfig"
|
| 28 |
nerdboy |
1.1 |
|
| 29 |
|
|
pkg_setup() {
|
| 30 |
|
|
pk="pk11install"
|
| 31 |
|
|
dbdir="/etc/pki/nssdb"
|
| 32 |
|
|
ck_mod_name="CoolKey PKCS #11 Module"
|
| 33 |
|
|
|
| 34 |
|
|
if ! [[ -x $dbdir ]]; then
|
| 35 |
|
|
ewarn "No /etc/pki/nssdb found; check under \$HOME/.pki and"
|
| 36 |
|
|
ewarn "follow the suggested commands using the correct path."
|
| 37 |
|
|
fi
|
| 38 |
|
|
}
|
| 39 |
|
|
|
| 40 |
|
|
src_prepare() {
|
| 41 |
|
|
epatch "${WORKDIR}/${PN}-patches/01_${PN}-cache-dir-move.patch"
|
| 42 |
|
|
epatch "${WORKDIR}/${PN}-patches/02_${P}-gcc43.patch"
|
| 43 |
|
|
epatch "${WORKDIR}/${PN}-patches/03_${P}-latest.patch"
|
| 44 |
|
|
epatch "${WORKDIR}/${PN}-patches/04_${P}-simple-bugs.patch"
|
| 45 |
|
|
epatch "${WORKDIR}/${PN}-patches/05_${P}-thread-fix.patch"
|
| 46 |
|
|
epatch "${WORKDIR}/${PN}-patches/06_${P}-cac.patch"
|
| 47 |
|
|
epatch "${WORKDIR}/${PN}-patches/07_${PN}-cac-1.patch"
|
| 48 |
|
|
epatch "${WORKDIR}/${PN}-patches/08_${PN}-pcsc-lite-fix.patch"
|
| 49 |
|
|
}
|
| 50 |
|
|
|
| 51 |
|
|
src_configure() {
|
| 52 |
|
|
econf --enable-pk11install $(use_enable debug) \
|
| 53 |
|
|
|| die "configure failed"
|
| 54 |
|
|
}
|
| 55 |
|
|
|
| 56 |
|
|
src_compile() {
|
| 57 |
|
|
emake CFLAGS+="-fno-strict-aliasing" -j1 || die "make failed"
|
| 58 |
|
|
}
|
| 59 |
|
|
|
| 60 |
|
|
src_install() {
|
| 61 |
|
|
emake install DESTDIR="${D}" || die
|
| 62 |
|
|
diropts -m 1777
|
| 63 |
|
|
keepdir /var/cache/coolkey
|
| 64 |
|
|
}
|
| 65 |
|
|
|
| 66 |
|
|
pkg_postinst() {
|
| 67 |
|
|
if [[ -x $dbdir ]]; then
|
| 68 |
|
|
if ! $(modutil -rawlist -dbdir $dbdir | grep libcoolkeypk11); then
|
| 69 |
|
|
elog "You still need to install libcoolkey in your PKCS11 library:"
|
| 70 |
|
|
elog "$pk -p $dbdir 'name=$ck_mod_name library=libcoolkeypk11.so'"
|
| 71 |
|
|
|
| 72 |
|
|
fi
|
| 73 |
|
|
else
|
| 74 |
|
|
elog ""
|
| 75 |
|
|
elog "You still need to setup your PKCS11 library, or at least"
|
| 76 |
|
|
elog "find where it is (perhaps \$HOME/.pki/nssdb). Once you"
|
| 77 |
|
|
elog "find it, use 'modutil -rawlist -dbdir \$db' to look for"
|
| 78 |
|
|
elog "libcoolkeypk11.so, and if not found, add it using:"
|
| 79 |
|
|
elog ""
|
| 80 |
|
|
elog "$pk -p \$db 'name=$ck_mod_name library=libcoolkeypk11.so'"
|
| 81 |
|
|
elog ""
|
| 82 |
|
|
elog "where \$db is the full path to your pki/nssdb directory."
|
| 83 |
|
|
elog ""
|
| 84 |
|
|
fi
|
| 85 |
|
|
}
|
| 86 |
|
|
|
| 87 |
|
|
pkg_postrm() {
|
| 88 |
nerdboy |
1.2 |
if [[ -x $dbdir ]]; then
|
| 89 |
|
|
if $(modutil -rawlist -dbdir $dbdir | grep libcoolkeypk11); then
|
| 90 |
|
|
elog "You should remove libcoolkey from your PKCS11 library."
|
| 91 |
|
|
fi
|
| 92 |
nerdboy |
1.1 |
fi
|
| 93 |
|
|
}
|