--- shadow-4.0.3-r7.ebuild 2003-09-26 16:12:32.000000000 -0400 +++ shadow-4.0.3-r8.ebuild 2003-10-07 17:43:19.000000000 -0400 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /home/cvsroot/gentoo-x86/sys-apps/shadow/shadow-4.0.3-r7.ebuild,v 1.5 2003/09/26 19:55:11 azarah Exp $ -IUSE="" +IUSE="pam" inherit eutils libtool gnuconfig @@ -17,12 +17,10 @@ SLOT="0" KEYWORDS="x86 amd64 ppc sparc alpha mips hppa arm ia64" -DEPEND=">=sys-libs/pam-0.75-r4 - >=sys-libs/cracklib-2.7-r3 +DEPEND="pam? ( >=sys-libs/pam-0.75-r4 >=sys-libs/cracklib-2.7-r3 ) nls? ( sys-devel/gettext )" -RDEPEND=">=sys-libs/pam-0.75-r4 - >=sys-libs/cracklib-2.7-r3" +RDEPEND="pam? ( >=sys-libs/pam-0.75-r4 >=sys-libs/cracklib-2.7-r3 )" pkg_preinst() { @@ -38,7 +36,7 @@ # pam_xauth for one, is then never used. This should close bug #8831. # # (19 Oct 2002) - epatch ${FILESDIR}/${P}-su-pam_open_session.patch-v2 + use pam && epatch ${FILESDIR}/${P}-su-pam_open_session.patch-v2 # If su should not simulate a login shell, use '/bin/sh' as shell to enable # running of commands as user with /bin/false as shell, closing bug #15015. @@ -60,11 +58,10 @@ local myconf="" use nls || myconf="${myconf} --disable-nls" + use pam && myconf="${myconf} --with-libpam --with-libcrack" || myconf="${myconf} --without-libpam" ./configure --disable-desrpc \ --with-libcrypt \ - --with-libcrack \ - --with-libpam \ --enable-shared=no \ --enable-static=yes \ --host=${CHOST} \ @@ -85,7 +82,7 @@ # Do not install this login, but rather the one from # pam-login, as this one have a serious root exploit # with pam_limits in use. - rm ${D}/bin/login + use pam || rm ${D}/bin/login mv ${D}/lib ${D}/usr dosed "s:/lib':/usr/lib':g" /usr/lib/libshadow.la @@ -109,23 +106,21 @@ insinto /etc/default insopts -m0600 doins ${FILESDIR}/default/useradd -# From sys-apps/pam-login now -# insopts -m0644 ; doins ${FILESDIR}/login.defs - - insinto /etc/pam.d ; insopts -m0644 - for x in ${FILESDIR}/pam.d/* - do - [ -f ${x} ] && doins ${x} - done - - cd ${FILESDIR}/pam.d - newins system-auth-1.1 system-auth.new || die - newins shadow chage - newins shadow chsh - newins shadow chfn - newins shadow useradd - newins shadow groupadd - + if [ `use pam` ] ; then + # From sys-apps/pam-login now + # insopts -m0644 ; doins ${FILESDIR}/login.defs + insinto /etc/pam.d ; insopts -m0644 + for x in ${FILESDIR}/pam.d/* ; do + [ -f ${x} ] && doins ${x} + done + cd ${FILESDIR}/pam.d + newins system-auth-1.1 system-auth.new || die + newins shadow chage + newins shadow chsh + newins shadow chfn + newins shadow useradd + newins shadow groupadd + fi cd ${S} # The manpage install is beyond my comprehension, and # also broken. Just do it over. @@ -135,11 +130,13 @@ [ -f ${x} ] && doman ${x} done - # Dont install the manpage, since we dont use - # login with shadow - rm -f ${D}/usr/share/man/man1/login.* - # We use pam, so this is not applicable. - rm -f ${D}/usr/share/man/man5/suauth.* + if [ ! `use pam` ] ; then + # Dont install the manpage, since we dont use + # login with shadow + rm -f ${D}/usr/share/man/man1/login.* + # We use pam, so this is not applicable. + rm -f ${D}/usr/share/man/man5/suauth.* + fi cd ${S}/doc dodoc ANNOUNCE INSTALL LICENSE README WISHLIST @@ -156,6 +153,7 @@ } pkg_postinst() { + use pam || return 0; local CHECK1="$(md5sum ${ROOT}/etc/pam.d/system-auth | cut -d ' ' -f 1)" local CHECK2="$(md5sum ${ROOT}/etc/pam.d/system-auth.new | cut -d ' ' -f 1)"