# Template file for 'shadow' pkgname=shadow version=4.1.5.1 revision=14 build_style=gnu-configure configure_args="--bindir=/usr/bin --sbindir=/usr/sbin --libdir=/usr/lib --enable-shared --disable-static --with-libpam --without-selinux --with-acl --with-attr" makedepends="acl-devel pam-devel" short_desc="Shadow password file utilities" maintainer="Juan RP " license="BSD" homepage="http://pkg-shadow.alioth.debian.org" distfiles="$homepage/releases/$pkgname-$version.tar.bz2" checksum=aa32333748d68b58ed3a83625f0165e0f6b9dc4639e6377c9300c6bf4fe978fb if [ "$CROSS_BUILD" ]; then hostmakedepends="automake libtool gettext-devel" pre_configure() { autoreconf -fi } fi do_build() { # Don't install groups(1), we use the one from coreutils. sed -i 's/groups$(EXEEXT) //' src/Makefile for f in $(find man -name Makefile); do sed -i 's/groups\.1 / /' $f done # Build PIE binaries by default. make CFLAGS+=" -fPIE" LDFLAGS+=" -pie" ${makejobs} } post_install() { # Install our pam files not the ones supplied with shadow. rm -f ${DESTDIR}/etc/pam.d/* for f in chage passwd other; do install -m644 ${FILESDIR}/${f}.pam ${DESTDIR}/etc/pam.d/${f} done for f in chpasswd chgpasswd groupadd groupdel groupmems \ groupmod newusers useradd userdel usermod; do install -m644 $DESTDIR/etc/pam.d/chage $DESTDIR/etc/pam.d/${f} done install -m644 ${FILESDIR}/login.defs ${DESTDIR}/etc # Disable creating mailbox files by default. sed -i -e 's/yes/no/' $DESTDIR/etc/default/useradd # Change default group to the users gid (100). sed -i -e 's/^\(GROUP\)=\(.*\)$/\1=100/' ${DESTDIR}/etc/default/useradd # Install the cron daily job. install -Dm744 ${FILESDIR}/shadow.cron-daily \ ${DESTDIR}/etc/cron.daily/shadow # Remove groups.1 manpage provided by coreutils. rm -f ${DESTDIR}/usr/share/man/man1/groups.1 # Remove utilities provided by util-linux and logoutd. rm \ $DESTDIR/usr/bin/{chsh,chfn,sg} \ $DESTDIR/usr/bin/{newgrp,login,su} \ $DESTDIR/usr/sbin/{nologin,logoutd,vipw,vigr} # ...and their many man pages find $DESTDIR/usr/share/man \ '(' -name 'chsh.1' -o \ -name 'chfn.1' -o \ -name 'su.1' -o \ -name 'login.1' -o \ -name 'vipw.8' -o \ -name 'vigr.8' -o \ -name 'logoutd.8' -o \ -name 'nologin.8' -o \ -name 'newgrp.1' ')' \ -delete vinstall $FILESDIR/LICENSE 644 usr/share/licenses/shadow } shadow_package() { conf_files=" /etc/pam.d/usermod /etc/pam.d/userdel /etc/pam.d/useradd /etc/pam.d/passwd /etc/pam.d/newusers /etc/pam.d/groupmod /etc/pam.d/groupmems /etc/pam.d/groupdel /etc/pam.d/groupadd /etc/pam.d/chpasswd /etc/pam.d/chgpasswd /etc/pam.d/chage /etc/pam.d/other /etc/defaults/useradd /etc/login.defs" depends="pam" pkg_install() { vmove all } }