| 1 | # Description: Shadow password file utilities |
| 2 | # URL: http://pkg-shadow.alioth.debian.org/ |
| 3 | # Maintainer: CRUX System Team, core-ports at crux dot nu |
| 4 | # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu |
| 5 | # Depends on: |
| 6 | |
| 7 | name=shadow |
| 8 | version=4.5 |
| 9 | release=2 |
| 10 | source=(https://github.com/shadow-maint/shadow/releases/download/$version/shadow-$version.tar.xz |
| 11 | CVE-2018-7169.patch |
| 12 | pwck login.defs) |
| 13 | |
| 14 | build() { |
| 15 | cd $name-$version |
| 16 | |
| 17 | # https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1729357 |
| 18 | patch -p1 -i $SRC/CVE-2018-7169.patch |
| 19 | |
| 20 | echo "ac_cv_func_setpgrp_void=yes" >> config.cache |
| 21 | |
| 22 | # Fix first configure to point to the right place |
| 23 | sed "s|lt_sysroot=|lt_sysroot=$CLFS|g" -i aclocal.m4 |
| 24 | |
| 25 | ./configure --build=$CHOST \ |
| 26 | --host=$CTARGET \ |
| 27 | --prefix=/usr \ |
| 28 | --mandir=/usr/man \ |
| 29 | --sysconfdir=/etc \ |
| 30 | --disable-shared \ |
| 31 | --disable-shadowgrp \ |
| 32 | --disable-nls \ |
| 33 | --without-selinux \ |
| 34 | --without-libpam \ |
| 35 | --without-audit \ |
| 36 | --cache-file=config.cache |
| 37 | |
| 38 | # Forcing libtool to prioritize our sysroot |
| 39 | sed "s|lt_sysroot=|lt_sysroot=$CLFS|g" -i libtool |
| 40 | |
| 41 | make |
| 42 | make DESTDIR=$PKG install |
| 43 | |
| 44 | install -d $PKG/etc/cron/daily $PKG/var/log |
| 45 | install -m 644 $SRC/login.defs $PKG/etc |
| 46 | install -m 755 $SRC/pwck $PKG/etc/cron/daily |
| 47 | mv $PKG/bin/{su,groups} $PKG/usr/bin |
| 48 | touch $PKG/var/log/{lastlog,faillog} |
| 49 | |
| 50 | rm -r $PKG/usr/bin/gpasswd \ |
| 51 | $PKG/usr/man/man1/gpasswd.1 \ |
| 52 | $PKG/usr/sbin/{chpasswd,grpconv,grpunconv,logoutd} \ |
| 53 | $PKG/usr/sbin/{newusers,pwconv,pwunconv} \ |
| 54 | $PKG/usr/man/man8/{chpasswd.8,grpconv.8,grpunconv.8,logoutd.8} \ |
| 55 | $PKG/usr/man/man8/{newusers.8,pwconv.8,pwunconv.8} \ |
| 56 | $PKG/usr/man/man5/gshadow.5 \ |
| 57 | $PKG/usr/man/man3 \ |
| 58 | $PKG/etc/{login.access,limits,default} |
| 59 | } |