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

inherit eutils pam autotools

DESCRIPTION="A PAM module that can mount volumes for a user session e.g. encrypted home directories"
HOMEPAGE="http://pam-mount.souceforge.net"
SRC_URI="mirror://sourceforge/pam-mount/${P}.tbz2"
RESTRICT=""

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

DEPEND=">=sys-libs/pam-0.78-r3
	>=dev-libs/openssl-0.9.7i
	>=dev-libs/glib-2"
RDEPEND="${DEPEND}
	crypt? ( sys-fs/cryptsetup-luks )
	sys-process/lsof"

src_unpack() {
	unpack ${A}
	cd "${S}"

	# Gentoo installs cryptsetup in /bin, this patches the relevant 
	# locations, in srcipts/(u)mount.crypt and adds gentoo specific
	# comments to pam_mount.conf
	epatch "${FILESDIR}/${PN}-gentoo-paths-and-examples.patch"
}

src_compile() {
	# fixes the sanity check failure
	_elibtoolize --copy --force

	econf \
	    --libdir=/$(get_libdir) \
		--with-pam-dir=$(getpam_mod_dir) || die "econf failed"
	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "install failed"

	insinto /etc/security
	insopts -m0644
	doins "${S}/config/pam_mount.conf"
	dopamd "${FILESDIR}/system-auth"

	dodir /sbin
	dosym /usr/bin/mount.crypt /sbin/mount.crypt

	dodoc README TODO AUTHORS ChangeLog FAQ NEWS
}

pkg_postinst() {
	elog "In order to use pam_mount you will need to configure it."
	elog "After the modifications in /etc/security/pam_mount.conf you "
	elog "can create the encrypted directory using the mkehd command."
	elog "Please use mkhed -h for more informations."
	elog
	elog "If you want to encrypt the home directories you will need a "
	elog "kernel with device-mapper and crypto (AES or any other chipher)"
	elog "support."
	elog
	elog "This ebuild only modifies the /etc/pam.d/system-auth file to"
	elog "support pam_mount. If you have any programs that use pam with "
	elog "a configuration file that does NOT include system-auth you will "
	elog "need to modify this file too. Look at /etc/pam.d/system-auth or "
	elog "the /usr/share/doc/${PF}/README file for more informations."
}