1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools db-use fcaps multilib-minimal toolchain-funcs usr-ldscript
8 DESCRIPTION="Linux-PAM (Pluggable Authentication Modules)"
9 HOMEPAGE="https://github.com/linux-pam/linux-pam"
10 SRC_URI="https://github.com/linux-pam/linux-pam/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12 LICENSE="|| ( BSD GPL-2 )"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~amd64-linux ~x86-linux"
15 IUSE="audit berkdb +cracklib debug nis +pie selinux static-libs"
17 BDEPEND="app-text/docbook-xml-dtd:4.1.2
18 app-text/docbook-xml-dtd:4.3
19 app-text/docbook-xml-dtd:4.4
20 app-text/docbook-xml-dtd:4.5
24 virtual/pkgconfig[${MULTILIB_USEDEP}]"
27 virtual/libcrypt:=[${MULTILIB_USEDEP}]
28 >=virtual/libintl-0-r1[${MULTILIB_USEDEP}]
29 audit? ( >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] )
30 berkdb? ( >=sys-libs/db-4.8.30-r1:=[${MULTILIB_USEDEP}] )
31 cracklib? ( >=sys-libs/cracklib-2.9.1-r1[${MULTILIB_USEDEP}] )
32 selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
33 nis? ( >=net-libs/libtirpc-0.2.4-r2[${MULTILIB_USEDEP}] )"
37 PDEPEND="sys-auth/pambase"
39 S="${WORKDIR}/linux-${P}"
43 eapply "${FILESDIR}/${PN}-remove-browsers.patch"
44 touch ChangeLog || die
48 multilib_src_configure() {
49 # Do not let user's BROWSER setting mess us up. #549684
52 # Disable automatic detection of libxcrypt; we _don't_ want the
53 # user to link libxcrypt in by default, since we won't track the
54 # dependency and allow to break PAM this way.
56 export ac_cv_header_xcrypt_h=no
59 --with-db-uniquename=-$(db_findver sys-libs/db)
60 --enable-securedir="${EPREFIX}"/$(get_libdir)/security
61 --libdir=/usr/$(get_libdir)
64 $(use_enable berkdb db)
65 $(use_enable cracklib)
70 $(use_enable static-libs static)
71 --enable-isadir='.' #464016
73 ECONF_SOURCE="${S}" econf ${myconf[@]}
76 multilib_src_compile() {
77 emake sepermitlockdir="${EPREFIX}/run/sepermit"
80 multilib_src_install() {
81 emake DESTDIR="${D}" install \
82 sepermitlockdir="${EPREFIX}/run/sepermit"
84 gen_usr_ldscript -a pam pam_misc pamc
87 multilib_src_install_all() {
88 find "${ED}" -type f -name '*.la' -delete || die
91 dodir /usr/lib/tmpfiles.d
92 cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
93 d /run/sepermit 0755 root root
99 ewarn "Some software with pre-loaded PAM libraries might experience"
100 ewarn "warnings or failures related to missing symbols and/or versions"
101 ewarn "after any update. While unfortunate this is a limit of the"
102 ewarn "implementation of PAM and the software, and it requires you to"
103 ewarn "restart the software manually after the update."
105 ewarn "You can get a list of such software running a command like"
106 ewarn " lsof / | egrep -i 'del.*libpam\\.so'"
108 ewarn "Alternatively, simply reboot your system."
110 # The pam_unix module needs to check the password of the user which requires
111 # read access to /etc/shadow only.
112 fcaps cap_dac_override sbin/unix_chkpwd