summaryrefslogtreecommitdiff
path: root/source/a/shadow/shadow.SlackBuild
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2020-02-07 22:32:38 +0000
committerEric Hameleers <alien@slackware.com>2020-02-08 08:59:48 +0100
commit080300e1e7dec7bb1a6297b5a4406e2c0be46048 (patch)
tree4ca397920d9a177af9eb3ca6781e2c8498b3672d /source/a/shadow/shadow.SlackBuild
parent194ec853e8f20fd32d5a91eec74ff77383093f4e (diff)
downloadcurrent-080300e1e7dec7bb1a6297b5a4406e2c0be46048.tar.gz
Fri Feb 7 22:32:38 UTC 202020200207223238
a/kernel-firmware-20200206_5351afe-noarch-1.txz: Upgraded. ap/ghostscript-9.50-x86_64-2.txz: Rebuilt. Recompiled against krb5-1.17.1. ap/gutenprint-5.3.3-x86_64-2.txz: Rebuilt. Recompiled against krb5-1.17.1. ap/nano-4.8-x86_64-1.txz: Upgraded. ap/screen-4.8.0-x86_64-1.txz: Upgraded. ap/vim-8.2.0224-x86_64-1.txz: Upgraded. d/cvs-1.11.23-x86_64-4.txz: Rebuilt. Recompiled against krb5-1.17.1. d/strace-5.5-x86_64-1.txz: Upgraded. kde/kdelibs-4.14.38-x86_64-6.txz: Rebuilt. Recompiled against krb5-1.17.1. l/gtk+2-2.24.32-x86_64-3.txz: Rebuilt. Recompiled against krb5-1.17.1. l/gtk+3-3.24.13-x86_64-2.txz: Rebuilt. Recompiled against krb5-1.17.1. l/libsoup-2.68.3-x86_64-2.txz: Rebuilt. Recompiled against krb5-1.17.1. l/libssh-0.9.3-x86_64-2.txz: Rebuilt. Recompiled against krb5-1.17.1. l/loudmouth-1.5.3-x86_64-4.txz: Rebuilt. Recompiled against krb5-1.17.1. l/neon-0.30.2-x86_64-2.txz: Rebuilt. Recompiled against krb5-1.17.1. n/cifs-utils-6.10-x86_64-2.txz: Rebuilt. Recompiled to build cifs.upcall. n/curl-7.68.0-x86_64-2.txz: Rebuilt. Recompiled against krb5-1.17.1. n/cyrus-sasl-2.1.27-x86_64-2.txz: Rebuilt. Recompiled against krb5-1.17.1. xap/vim-gvim-8.2.0224-x86_64-1.txz: Upgraded.
Diffstat (limited to 'source/a/shadow/shadow.SlackBuild')
-rwxr-xr-xsource/a/shadow/shadow.SlackBuild55
1 files changed, 47 insertions, 8 deletions
diff --git a/source/a/shadow/shadow.SlackBuild b/source/a/shadow/shadow.SlackBuild
index 4264a24d..360da370 100755
--- a/source/a/shadow/shadow.SlackBuild
+++ b/source/a/shadow/shadow.SlackBuild
@@ -51,12 +51,16 @@ PKG=$TMP/package-shadow
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
rm -rf $PKG
@@ -66,6 +70,15 @@ rm -rf shadow-$VERSION
tar xvf $CWD/shadow-$VERSION.tar.xz || exit 1
cd shadow-$VERSION
+# Choose correct options depending on whether PAM is installed:
+if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
+ PAM_OPTIONS="--with-libpam"
+ unset SHADOW_OPTIONS
+else
+ unset PAM_OPTIONS
+ SHADOW_OPTIONS="--enable-shadowgrp --without-libcrack"
+fi
+
# Apply some patches taken from the svn trunk that
# fix some of the more serious bugs in 4.1.4.3:
for patch in $CWD/patches/*.diff.gz ; do
@@ -109,7 +122,8 @@ CFLAGS="$SLKCFLAGS" \
--enable-man \
--enable-subordinate-ids \
--disable-shared \
- --without-libcrack \
+ $SHADOW_OPTIONS \
+ $PAM_OPTIONS \
--build=$ARCH-slackware-linux
# --enable-utmpx # defaults to 'no'
@@ -134,16 +148,42 @@ mkdir -p $PKG/bin $PKG/sbin
)
mv $PKG/usr/sbin/nologin $PKG/sbin/nologin
+if [ ! -z "$PAM_OPTIONS" ]; then
+ # Don't ship the login utilities. We'll be using the ones from util-linux:
+ for file in /bin/login /bin/su /sbin/runuser /usr/bin/chfn /usr/bin/chsh \
+ /usr/man/man1/chfn.1.gz /usr/man/man1/chsh.1.gz /usr/man/man1/login.1.gz \
+ /usr/man/man1/runuser.1.gz /usr/man/man1/su.1.gz \
+ /usr/share/bash-completion/completions/chfn \
+ /usr/share/bash-completion/completions/chsh \
+ /usr/share/bash-completion/completions/su ; do
+ rm -f $PKG${file}
+ done
+ # Install config files in /etc/pam.d/. We'll use our own copies... I'm not
+ # sure that I trust upstream enough to let them handle this stuff.
+ rm -rf $PKG/etc/pam.d
+ mkdir -p $PKG/etc/pam.d
+ for file in $CWD/pam.d/* ; do
+ cp -a ${file} $PKG/etc/pam.d/
+ done
+ # Ensure correct perms/ownership on files in /etc/pam.d/:
+ chown root:root $PKG/etc/pam.d/*
+ chmod 644 $PKG/etc/pam.d/*
+ # Don't clobber existing config files:
+ find $PKG/etc/pam.d -type f -exec mv {} {}.new \;
+ # Install a login.defs with unsurprising defaults:
+ rm -f $PKG/etc/login.defs
+ zcat $CWD/login.defs.pam.gz > $PKG/etc/login.defs.new
+else # not using PAM
+ mv $PKG/etc/login.access $PKG/etc/login.access.new
+ # Install a login.defs with unsurprising defaults:
+ rm -f $PKG/etc/login.defs
+ zcat $CWD/login.defs.shadow.gz > $PKG/etc/login.defs.new
+fi
+
# /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
-
-mv $PKG/etc/login.access $PKG/etc/login.access.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
@@ -197,4 +237,3 @@ zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $TMP/shadow-$VERSION-$ARCH-$BUILD.txz
-