summaryrefslogtreecommitdiff
path: root/source/ap/screen/screen.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/screen/screen.SlackBuild')
-rwxr-xr-xsource/ap/screen/screen.SlackBuild44
1 files changed, 23 insertions, 21 deletions
diff --git a/source/ap/screen/screen.SlackBuild b/source/ap/screen/screen.SlackBuild
index dc7f2ded..ee5b24ae 100755
--- a/source/ap/screen/screen.SlackBuild
+++ b/source/ap/screen/screen.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016, 2018, 2019 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016, 2018, 2019, 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -46,12 +46,16 @@ fi
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
TMP=${TMP:-/tmp}
@@ -86,6 +90,15 @@ done
# the console from being properly cleared when detaching from a screen session:
zcat $CWD/60-revert-screenrc-change.diff.gz | patch -p1 --verbose || exit 1
+# Choose correct options depending on whether PAM is installed:
+if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
+ PAM_OPTIONS="--enable-pam"
+ unset SHADOW_OPTIONS
+else
+ unset PAM_OPTIONS
+ SHADOW_OPTIONS="--disable-pam"
+fi
+
# Configure:
CFLAGS="$SLKCFLAGS" \
./configure \
@@ -97,7 +110,8 @@ CFLAGS="$SLKCFLAGS" \
--with-sys-screenrc=/etc/screenrc \
--with-pty-mode=0620 \
--with-pty-group=5 \
- --disable-pam \
+ $PAM_OPTIONS \
+ $SHADOW_OPTIONS \
--enable-telnet \
--disable-socket-dir \
--enable-use-locale \
@@ -125,6 +139,12 @@ chmod 755 $PKG/usr/bin/screen-$VERSION
mkdir -p $PKG/etc/skel
cat etc/etcscreenrc > $PKG/etc/screenrc.new
cat etc/screenrc > $PKG/etc/skel/.screenrc.new
+
+if [ ! -z "$PAM_OPTIONS" ]; then
+ mkdir -p $PKG/etc/pam.d
+ cat $CWD/screen.pam > $PKG/etc/pam.d/screen.new
+fi
+
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*
gzip -9 $PKG/usr/man/man1/*
@@ -135,26 +155,8 @@ cp -a COPYING ChangeLog HACKING INSTALL NEWS README TODO \
$PKG/usr/doc/screen-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-cat << EOF > $PKG/install/doinst.sh
-#!/bin/bash
-config() {
- NEW="\$1"
- OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
- # If there's no config file by that name, mv it over:
- if [ ! -r \$OLD ]; then
- mv \$NEW \$OLD
- elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy
- rm \$NEW
- fi
- # Otherwise, we leave the .new copy for the admin to consider...
-}
-config etc/screenrc.new
-config etc/skel/.screenrc.new
-# This is probably safer than leaving the hidden .new file... maybe?
-rm -f etc/skel/.screenrc.new
-EOF
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
# Build package:
cd $PKG
makepkg -l y -c n $TMP/screen-$VERSION-$ARCH-$BUILD.txz
-