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.SlackBuild39
1 files changed, 29 insertions, 10 deletions
diff --git a/source/n/openssh/openssh.SlackBuild b/source/n/openssh/openssh.SlackBuild
index 4a661132..3d0d1a98 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 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2007, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -28,9 +28,20 @@ CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-openssh
-VERSION=${VERSION:-5.2p1}
-ARCH=${ARCH:-x86_64}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-$(echo openssh-*.tar.gz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
+
+NUMJOBS=${NUMJOBS:--j6}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@@ -42,6 +53,8 @@ elif [ "$ARCH" = "arm" ]; then
SLKCFLAGS="-O2 -march=armv4 -mtune=xscale"
elif [ "$ARCH" = "armel" ]; then
SLKCFLAGS="-O2 -march=armv4t"
+else
+ SLKCFLAGS="-O2"
fi
# Clean target location:
@@ -51,7 +64,7 @@ mkdir -p $PKG
# Prepare the framework and extract the package:
cd $TMP
rm -rf $PKG openssh-$VERSION
-tar xjvf $CWD/openssh-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/openssh-$VERSION.tar.gz || tar xvf $CWD/openssh-$VERSION.tar.?z* || exit 1
cd openssh-$VERSION
chown -R root:root .
@@ -70,15 +83,13 @@ CFLAGS="$SLKCFLAGS" \
--with-privsep-user=sshd \
--build=$ARCH-slackware-linux
-make -j4 || exit 1
+make $NUMJOBS || make || exit 1
# Install the package:
make install DESTDIR=$PKG
-( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-)
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
# Compress and if needed symlink the man pages:
if [ -d $PKG/usr/man ]; then
@@ -107,6 +118,14 @@ cp -a \
$PKG/usr/doc/openssh-$VERSION
chmod 644 $PKG/usr/doc/openssh-$VERSION/*
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
# Install also 'ssh-copy-id' and its manpage from contrib:
( cd contrib
cp -a ssh-copy-id $PKG/usr/bin/ssh-copy-id