summaryrefslogtreecommitdiff
path: root/source/n/openssh/openssh.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/openssh/openssh.SlackBuild')
-rwxr-xr-xsource/n/openssh/openssh.SlackBuild28
1 files changed, 26 insertions, 2 deletions
diff --git a/source/n/openssh/openssh.SlackBuild b/source/n/openssh/openssh.SlackBuild
index 6b634a23..3c614d87 100755
--- a/source/n/openssh/openssh.SlackBuild
+++ b/source/n/openssh/openssh.SlackBuild
@@ -2,7 +2,7 @@
# Copyright 2000 BSDi, Inc. Concord, CA, USA
# Copyright 2001, 2002, 2003, 2004 Slackware Linux, Inc. Concord, CA, USA
-# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2018 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2018, 2020 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -54,16 +54,22 @@ 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"
elif [ "$ARCH" = "arm" ]; then
SLKCFLAGS="-O2 -march=armv4 -mtune=xscale"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "armel" ]; then
SLKCFLAGS="-O2 -march=armv4t"
+ LIBDIRSUFFIX=""
else
SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
# Clean target location:
@@ -80,6 +86,17 @@ chown -R root:root .
# Restore support for tcpwrappers:
zcat $CWD/openssh.tcp_wrappers.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="--with-pam --with-kerberos5"
+ unset SHADOW_OPTIONS
+ # Enable PAM in sshd_config:
+ zcat $CWD/sshd_config-pam.diff.gz | patch -p1 --verbose || exit 1
+else
+ unset PAM_OPTIONS
+ SHADOW_OPTIONS="--without-pam"
+fi
+
autoreconf -vif
# Compile package:
@@ -88,7 +105,8 @@ CFLAGS="$SLKCFLAGS" \
--prefix=/usr \
--mandir=/usr/man \
--sysconfdir=/etc/ssh \
- --without-pam \
+ $PAM_OPTIONS \
+ $SHADOW_OPTIONS \
--with-md5-passwords \
--with-libedit \
--with-tcp-wrappers \
@@ -170,6 +188,12 @@ fi
cat $CWD/rc.sshd > etc/rc.d/rc.sshd.new
chmod 755 etc/rc.d/rc.sshd.new
+ if [ ! -z "$PAM_OPTIONS" ]; then
+ # Add the pam stuff:
+ mkdir -p etc/pam.d
+ cat $CWD/sshd.pam > etc/pam.d/sshd.new
+ fi
+
# Copy runtime installation files:
mkdir -p install
zcat $CWD/doinst.sh.gz > install/doinst.sh