# $Id$ PNAME="shadow" PVER="4.1.3.1" PBUILD="r1" PCATEGORIE="sys-apps" STATE="unstable" DESCRIPTION="Utilities to deal with user accounts, with pam support." HOMEPAGE="http://pkg-shadow.alioth.debian.org/" DEPEND=">= virtual/glibc >= app-shells/bash-3 >= sys-libs/pam-0.99 >= sys-libs/cracklib-2.8" SDEPEND=">= sys-dev/autoconf-4 >= sys-dev/automake-3 >= sys-dev/libtool-1.5" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" # no shared libs get installed, is multilib needed anymore? sminclude multilib mtools SRC_URI=( ftp://pkg-${PNAME}.alioth.debian.org/pub/pkg-${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/securetty mirror://${PNAME}/pamd/chage mirror://${PNAME}/pamd/login mirror://${PNAME}/pamd/other mirror://${PNAME}/pamd/passwd mirror://${PNAME}/pamd/su mirror://${PNAME}/${PNAME}-4.1.2.1-defaults.patch ) UP2DATE="updatecmd ${HOMEPAGE} | grep 'New release' | sed 's/.*: \(.*\).*/\1/;q'" src_prepare() { munpack ${SRCFILE} || die # fixes useradd default settings (create_mail_spool) mpatch ${PNAME}-4.1.2.1-defaults.patch || die # do not build 'groups'; coreutils provide a better version all-abis "sed -i 's/groups$(EXEEXT) //' src/Makefile.in" || die all-abis "sed -i '/groups/d' man/Makefile.in" || die } src_compile() { # configures shadow with pam mconfigure \ --enable-shared \ --with-libpam \ --with-libcrack \ --with-libcrypt \ --enable-nls \ --without-selinux \ || die mmake || die } src_install() { # needed directories minstalldir /etc/{default,skel} || die # added exec_prefix for better bin location mmake DESTDIR=${BINDIR} install || die minstalletc etc/limits limits || die minstalletc etc/login.access login.access || die # makes recovery easier, when /usr is not mounted :) mv -v ${BINDIR}/usr/bin/passwd ${BINDIR}/bin || die mlink /bin/passwd /usr/bin || die # not provided by shadow anymore; install our own now minstalletc securetty || die # install pam related configuration files minstallpam chage || die minstallpam login || die minstallpam other || die minstallpam passwd || die minstallpam su || die minstallpam chage chpasswd || die minstallpam chage chfn || die minstallpam chage chsh || die minstallpam chage newusers || die minstallpam chage groupadd || die minstallpam chage groupdel || die minstallpam chage groupmod || die minstallpam chage useradd || die minstallpam chage userdel || die minstallpam chage usermod || die # disable these checks as pam controls them now sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \ -e "s/^LASTLOG_ENAB/# &/" \ -e "s/^MAIL_CHECK_ENAB/# &/" \ -e "s/^PORTTIME_CHECKS_ENAB/# &/" \ -e "s/^CONSOLE/# &/" \ -e "s/^MOTD_FILE/# &/" \ -e "s/^NOLOGINS_FILE/# &/" \ -e "s/^PASS_MIN_LEN/# &/" \ -e "s/^SU_WHEEL_ONLY/# &/" \ -e "s/^CONSOLE_GROUPS/# &/" \ -e "s/^ENVIRON_FILE/# &/" \ -e "s/^OBSCURE_CHECKS_ENAB/# &/" \ -e "s/^CRACKLIB_DICTPATH/# &/" \ -e "s/^PASS_CHANGE_TRIES/# &/" \ -e "s/^PASS_ALWAYS_WARN/# &/" \ -e "s/^FAILLOG_ENAB/# &/" \ -e "s/^QUOTAS_ENAB/# &/" \ -e "s/^FTMP_FILE/# &/" \ -e "s/^ENV_HZ/# &/" \ -e "s/^CHFN_AUTH/# &/" \ etc/login.defs > ${BINDIR}/etc/login.defs || die # fix some pathes in login.defs # md5crypt is also controlled by pam ! sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \ -e 's%/var/spool/mail%/var/mail%' \ -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \ ${BINDIR}/etc/login.defs || die } postinstall() { if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] then /usr/sbin/pwconv /usr/sbin/grpconv fi }