1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit libtool multilib multilib-minimal eutils pam toolchain-funcs flag-o-matic db-use
12 DESCRIPTION="Linux-PAM (Pluggable Authentication Modules)"
13 HOMEPAGE="http://www.linux-pam.org/ https://fedorahosted.org/linux-pam/"
14 SRC_URI="http://www.linux-pam.org/library/${MY_P}.tar.bz2
15 http://www.linux-pam.org/documentation/${MY_PN}-1.2.0-docs.tar.bz2"
17 LICENSE="|| ( BSD GPL-2 )"
19 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~ia64-linux ~x86-linux"
20 IUSE="audit berkdb cracklib debug nis nls +pie selinux test vim-syntax"
22 RDEPEND="nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )
23 cracklib? ( >=sys-libs/cracklib-2.9.1-r1[${MULTILIB_USEDEP}] )
24 audit? ( >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] )
25 selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
26 berkdb? ( >=sys-libs/db-4.8.30-r1[${MULTILIB_USEDEP}] )
27 nis? ( >=net-libs/libtirpc-0.2.4-r2[${MULTILIB_USEDEP}] )"
30 >=sys-devel/flex-2.5.39-r1[${MULTILIB_USEDEP}]
31 nls? ( sys-devel/gettext )
32 nis? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )"
33 PDEPEND="sys-auth/pambase
34 vim-syntax? ( app-vim/pam-syntax )"
36 !<sys-apps/openrc-0.11.8
40 !<=app-emulation/emul-linux-x86-baselibs-20140508-r7
41 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
44 S="${WORKDIR}/${MY_P}"
49 if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | fgrep -q pam_stack.so; then
51 eerror "Your current setup is using the pam_stack module."
52 eerror "This module is deprecated and no longer supported, and since version"
53 eerror "0.99 is no longer installed, nor provided by any other package."
54 eerror "The package will be built (to allow binary package builds), but will"
55 eerror "not be installed."
56 eerror "Please replace pam_stack usage with proper include directive usage,"
57 eerror "following the PAM Upgrade guide at the following URL"
58 eerror " https://www.gentoo.org/proj/en/base/pam/upgrade-0.99.xml"
64 if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | egrep -q 'pam_(pwdb|console)'; then
66 eerror "Your current setup is using one or more of the following modules,"
67 eerror "that are not built or supported anymore:"
68 eerror "pam_pwdb, pam_console"
69 eerror "If you are in real need for these modules, please contact the maintainers"
70 eerror "of PAM through http://bugs.gentoo.org/ providing information about its"
72 eerror "Please also make sure to read the PAM Upgrade guide at the following URL:"
73 eerror " https://www.gentoo.org/proj/en/base/pam/upgrade-0.99.xml"
83 # do not error out, this is just a warning, one could build a binpkg
84 # with old modules enabled.
89 # Upstream didn't release a new doc tarball (since nothing changed?).
90 unpack ${MY_PN}-1.2.0-docs.tar.bz2
91 mv Linux-PAM-1.2.{0,1} || die
92 unpack ${MY_P}.tar.bz2
99 multilib_src_configure() {
100 # Do not let user's BROWSER setting mess us up. #549684
103 # Disable automatic detection of libxcrypt; we _don't_ want the
104 # user to link libxcrypt in by default, since we won't track the
105 # dependency and allow to break PAM this way.
106 export ac_cv_header_xcrypt_h=no
109 --docdir='$(datarootdir)'/doc/${PF}
110 --htmldir='$(docdir)/html'
111 --libdir='$(prefix)'/$(get_libdir)
112 --enable-securedir="${EPREFIX}"/$(get_libdir)/security
113 --enable-isadir='.' #464016
115 $(use_enable selinux)
116 $(use_enable cracklib)
119 $(use_enable berkdb db)
122 --with-db-uniquename=-$(db_findver sys-libs/db)
130 multilib_src_compile() {
131 emake sepermitlockdir="${EPREFIX}/run/sepermit"
134 multilib_src_install() {
135 emake DESTDIR="${D}" install \
136 sepermitlockdir="${EPREFIX}/run/sepermit"
139 if multilib_is_native_abi; then
141 gen_usr_ldscript -a pam pamc pam_misc
146 # create extra symlinks just in case something depends on them...
148 for lib in pam pamc pam_misc; do
149 if ! [[ -f "${ED}"${prefix}/$(get_libdir)/lib${lib}$(get_libname) ]]; then
150 dosym lib${lib}$(get_libname 0) ${prefix}/$(get_libdir)/lib${lib}$(get_libname)
155 DOCS=( CHANGELOG ChangeLog README AUTHORS Copyright NEWS )
157 multilib_src_install_all() {
159 prune_libtool_files --all
162 fperms 4711 /sbin/unix_chkpwd
166 for dir in modules/pam_*; do
167 newdoc "${dir}"/README README."$(basename "${dir}")"
171 dodir /usr/lib/tmpfiles.d
172 cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
173 d /run/sepermit 0755 root root
179 check_old_modules || die "deprecated PAM modules still used"
183 ewarn "Some software with pre-loaded PAM libraries might experience"
184 ewarn "warnings or failures related to missing symbols and/or versions"
185 ewarn "after any update. While unfortunate this is a limit of the"
186 ewarn "implementation of PAM and the software, and it requires you to"
187 ewarn "restart the software manually after the update."
189 ewarn "You can get a list of such software running a command like"
190 ewarn " lsof / | egrep -i 'del.*libpam\\.so'"
192 ewarn "Alternatively, simply reboot your system."
193 if [[ -x "${EROOT}"/var/log/tallylog ]] ; then
195 elog "Because of a bug present up to version 1.1.1-r2, you have"
196 elog "an executable /var/log/tallylog file. You can safely"
197 elog "correct it by running the command"
198 elog " chmod -x /var/log/tallylog"