Diff pambase-20101024-r2 with a pambase-20150213-r1

/usr/portage/sys-auth/pambase/pambase-20150213-r1.ebuild 2018-09-29 11:09:00.000000000 +0000
1
# Copyright 1999-2018 Gentoo Authors
1
# Copyright 1999-2018 Gentoo Foundation
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=4
5

  
6
inherit eutils
4
EAPI=6
7 5

  
8 6
DESCRIPTION="PAM base configuration files"
9 7
HOMEPAGE="https://wiki.gentoo.org/wiki/Project:PAM"
10
SRC_URI="https://dev.gentoo.org/~flameeyes/${PN}/${P}.tar.bz2"
8
SRC_URI="https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
11 9

  
12 10
LICENSE="GPL-2"
13 11
SLOT="0"
14
KEYWORDS="~amd64-fbsd ~x86-fbsd"
15
IUSE="debug +cracklib passwdqc consolekit gnome-keyring selinux mktemp pam_ssh +sha512 pam_krb5 minimal"
12
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 -x86-fbsd ~amd64-linux ~x86-linux"
13
IUSE="consolekit +cracklib debug elogind gnome-keyring minimal mktemp +nullok pam_krb5 pam_ssh passwdqc securetty selinux +sha512 systemd"
14

  
16 15
RESTRICT="binchecks"
17 16

  
17
MIN_PAM_REQ=1.1.3
18

  
18 19
RDEPEND="
19 20
	|| (
20
		>=sys-libs/pam-0.99.9.0-r1
21
		>=sys-libs/pam-${MIN_PAM_REQ}
21 22
		( sys-auth/openpam sys-freebsd/freebsd-pam-modules )
22 23
	)
23
	cracklib? ( >=sys-libs/pam-0.99[cracklib] )
24
	consolekit? ( >=sys-auth/consolekit-0.3[pam] )
25
	gnome-keyring? ( >=gnome-base/gnome-keyring-2.20[pam] )
26
	selinux? ( >=sys-libs/pam-0.99[selinux] )
27
	passwdqc? ( >=sys-auth/pam_passwdqc-1.0.4 )
24
	consolekit? ( sys-auth/consolekit[pam] )
25
	cracklib? ( sys-libs/pam[cracklib] )
26
	elogind? ( sys-auth/elogind[pam] )
27
	gnome-keyring? ( gnome-base/gnome-keyring[pam] )
28 28
	mktemp? ( sys-auth/pam_mktemp )
29
	pam_ssh? ( sys-auth/pam_ssh )
30
	sha512? ( >=sys-libs/pam-1.0.1 )
31 29
	pam_krb5? (
32
		|| ( >=sys-libs/pam-1.1.0 sys-auth/openpam )
33
		>=sys-auth/pam_krb5-4.3
30
		|| ( >=sys-libs/pam-${MIN_PAM_REQ} sys-auth/openpam )
31
		sys-auth/pam_krb5
34 32
	)
35
	!<sys-freebsd/freebsd-pam-modules-6.2-r1
36
	!<sys-libs/pam-0.99.9.0-r1"
37
DEPEND="app-portage/portage-utils"
33
	pam_ssh? ( sys-auth/pam_ssh )
34
	passwdqc? ( sys-auth/pam_passwdqc )
35
	selinux? ( sys-libs/pam[selinux] )
36
	sha512? ( >=sys-libs/pam-${MIN_PAM_REQ} )
37
	systemd? ( sys-apps/systemd[pam] )
38
"
39
DEPEND="
40
	app-arch/xz-utils
41
	app-portage/portage-utils
42
"
43

  
44
PATCHES=(
45
	"${FILESDIR}"/${P}-selinux-note.patch #540096
46
	"${FILESDIR}"/${P}-elogind.patch #599498
47
)
48

  
49
pkg_setup() {
50
	local stcnt=0
51

  
52
	use consolekit && stcnt=$((stcnt+1))
53
	use elogind && stcnt=$((stcnt+1))
54
	use systemd && stcnt=$((stcnt+1))
55

  
56
	if [[ ${stcnt} -gt 1 ]] ; then
57
		ewarn "You are enabling ${stcnt} session trackers at the same time."
58
		ewarn "This is not a recommended setup to have. Please consider enabling"
59
		ewarn "only one of USE=\"consolekit\", USE=\"elogind\" or USE=\"systemd\"."
60
	fi
61
}
38 62

  
39 63
src_compile() {
40
	local implementation=
41
	local linux_pam_version=
64
	local implementation linux_pam_version
42 65
	if has_version sys-libs/pam; then
43
		implementation="linux-pam"
44
		local ver_str=$(qatom `best_version sys-libs/pam` | cut -d ' ' -f 3)
66
		implementation=linux-pam
67
		local ver_str=$(qatom $(best_version sys-libs/pam) | cut -d ' ' -f 3)
45 68
		linux_pam_version=$(printf "0x%02x%02x%02x" ${ver_str//\./ })
46 69
	elif has_version sys-auth/openpam; then
47
		implementation="openpam"
70
		implementation=openpam
48 71
	else
49 72
		die "PAM implementation not identified"
50 73
	fi
51 74

  
52 75
	use_var() {
53
		local varname=$(echo $1 | tr [a-z] [A-Z])
54
		local usename=${2-$(echo $1 | tr [A-Z] [a-z])}
55
		local varvalue=$(use $usename && echo yes || echo no)
76
		local varname=$(echo "$1" | tr '[:lower:]' '[:upper:]')
77
		local usename=${2-$(echo "$1" | tr '[:upper:]' '[:lower:]')}
78
		local varvalue=$(usex ${usename})
56 79
		echo "${varname}=${varvalue}"
57 80
	}
58 81

  
......
62 85
		$(use_var cracklib) \
63 86
		$(use_var passwdqc) \
64 87
		$(use_var consolekit) \
88
		$(use_var elogind) \
89
		$(use_var systemd) \
65 90
		$(use_var GNOME_KEYRING gnome-keyring) \
66 91
		$(use_var selinux) \
92
		$(use_var nullok) \
67 93
		$(use_var mktemp) \
68
		$(use_var PAM_SSH pam_ssh) \
94
		$(use_var pam_ssh) \
95
		$(use_var securetty) \
69 96
		$(use_var sha512) \
70 97
		$(use_var KRB5 pam_krb5) \
71 98
		$(use_var minimal) \
......
78 105
src_install() {
79 106
	emake GIT=true DESTDIR="${ED}" install
80 107
}
81

  
82
pkg_postinst() {
83
	if use sha512; then
84
		elog "Starting from version 20080801, pambase optionally enables"
85
		elog "SHA512-hashed passwords. For this to work, you need sys-libs/pam-1.0.1"
86
		elog "built against sys-libs/glibc-2.7 or later."
87
		elog "If you don't have support for this, it will automatically fallback"
88
		elog "to MD5-hashed passwords, just like before."
89
		elog
90
		elog "Please note that the change only affects the newly-changed passwords"
91
		elog "and that SHA512-hashed passwords will not work on earlier versions"
92
		elog "of glibc or Linux-PAM."
93
	fi
94
}
Thank you!