summaryrefslogtreecommitdiff
blob: a9b96b6ea1d378b858d0e5b4addea6c3c449e5c5 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils multilib pam

DESCRIPTION="pam module for simple one time password authentication"
HOMEPAGE="http://www.cavecanen.org/cs/projects/pam_sotp/"
SRC_URI="http://www.cavecanen.org/cs/projects/pam_sotp/dl/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug urandom"

DEPEND=">=sys-libs/pam-0.78-r3"
RDEPEND="${DEPEND}"

pkg_setup() {
	enewgroup shadow
}

src_compile() {
	local myconf=""

	use urandom && myconf="--with-randomdev=/dev/urandom"
	econf --libdir="/$(get_libdir)" $(use_enable debug) ${myconf}
	emake || die "emake failed"
}

src_install() {
	dopamd etc/pam.d/otppasswd
	dopammod src/pam/${PN}.so
	diropts -m0770 -o root -g shadow
	keepdir /etc/sotp

	dobin src/utils/otppasswd
	fowners root:shadow /usr/bin/otppasswd
	fperms 2755 /usr/bin/otppasswd

	dodoc AUTHORS ChangeLog NEWS README
	dohtml doc/manual/html/*
}

pkg_postinst() {
	elog "See manual.html in /usr/share/doc/${PF}/html and otppasswd -h"
	elog "for configuration hints."
}