#!/bin/sh CWD=`pwd` TMP=/tmp PKG=$TMP/package-shadow VERSION=4.1.4.2 ARCH=alpha BUILD=1 TARGET=$ARCH-alphaslack-linux rm -rf $PKG mkdir -p $PKG ( cd $TMP rm -rf shadow-$VERSION tar xjf $CWD/shadow-$VERSION.tar.bz2 cd shadow-$VERSION chown -R root.root . zcat $CWD/shadow.login.defs.diff.gz | patch -p0 --verbose || exit 1 zcat $CWD/shadow.audiovideocdrom.diff.gz | patch -p0 --verbose || exit 1 ./configure \ --prefix=/usr \ --infodir=/usr/info \ --mandir=/usr/man \ --sysconfdir=/etc \ --disable-shared \ --build=$TARGET make || exit 1 make install DESTDIR=$PKG # Add the friendly 'adduser' script: cat $CWD/adduser > $PKG/usr/sbin/adduser chmod 755 $PKG/usr/sbin/adduser mkdir -p $PKG/var/log ; touch $PKG/var/log/faillog.new # Fix user group = 100: zcat $CWD/useradd.gz > $PKG/etc/default/useradd # /bin/groups is provided by coreutils. rm -f $PKG/bin/groups find $PKG -name groups.1 -exec rm {} \; # Install a login.defs with unsurprising defaults: rm -f $PKG/etc/login.defs zcat $CWD/login.defs.gz > $PKG/etc/login.defs.new # I don't think this works well enough to recommend it. #mv $PKG/etc/limits $PKG/etc/limits.new rm -f $PKG/etc/limits # Add sulogin to the package: cp -a src/sulogin $PKG/sbin ( cd $PKG/bin ; ln -s ../sbin/sulogin ) # Put some stuff back in "old" locations and make symlinks for compat ( cd $PKG/usr/bin mv faillog ../sbin mv lastlog ../sbin ln -s ../sbin/faillog ln -s ../sbin/lastlog ) # Fixup a few permissions: chmod 4711 $PKG/bin/su chmod 4711 $PKG/usr/bin/* ( cd $PKG ( find . -type f | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) ( mv etc/login.access etc/login.access.new ) ) gzip -9 $PKG/usr/man/*/man?/* $PKG/usr/man/man?/* mkdir -p $PKG/install zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n $TMP/shadow-$VERSION-$ARCH-$BUILD.tgz ) 2>&1 | tee $TMP/shadow.build.log