summaryrefslogtreecommitdiffstats
path: root/source/installer/sources/dropbear/dropbear.Slackbuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/installer/sources/dropbear/dropbear.Slackbuild')
-rwxr-xr-xsource/installer/sources/dropbear/dropbear.Slackbuild104
1 files changed, 55 insertions, 49 deletions
diff --git a/source/installer/sources/dropbear/dropbear.Slackbuild b/source/installer/sources/dropbear/dropbear.Slackbuild
index 2954effd0..712286387 100755
--- a/source/installer/sources/dropbear/dropbear.Slackbuild
+++ b/source/installer/sources/dropbear/dropbear.Slackbuild
@@ -1,8 +1,7 @@
#!/bin/sh
-# $Id: dropbear.Slackbuild,v 1.7 2008/03/13 13:42:33 root Exp root $
-# Copyright 2007, Piter Punk, São Paulo, Brazil
-# Adaptations for Slackware installer:
-# Copyright 2008, Eric Hameleers, Eindhoven, Netherlands
+
+# Copyright 2007, Piter Punk, São Paulo, Brazil
+# Copyright 2008, Eric Hameleers, Eindhoven, Netherlands
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,18 +21,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-PRGNAM=dropbear
-VERSION=20171018_fa3b0dd3
-BUILD=${BUILD:-1}
-TAG=${TAG:-''}
+cd $(dirname $0) ; CWD=$(pwd)
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
-fi
+PKGNAM=dropbear
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
# The programs we want to have as symlinks to dropbearmulti binary:
PROGS="dropbear dbclient dropbearkey dropbearconvert scp ssh"
@@ -43,15 +35,34 @@ PROGS="dropbear dbclient dropbearkey dropbearconvert scp ssh"
# and adding symlinks for ssh and scp without worry
# about overwriting any pre-existing binaries.
-CWD=$(pwd)
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i586 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+
TMP=${TMP:-/tmp}
-PKG=$TMP/pkg-$PRGNAM
+PKG=$TMP/package-$PKGNAM
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
@@ -63,11 +74,10 @@ fi
rm -rf $PKG
mkdir -p $TMP $PKG
-cd $TMP || exit 1
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.?z || exit 1
-cd $PRGNAM-$VERSION || exit 1
-
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -76,10 +86,7 @@ find . \
-exec chmod 644 {} \;
# Patch to allow empty passwords (used in Slackware's installer):
-patch -p1 < $CWD/dropbear_emptypass.patch || exit 1
-
-autoconf || exit 1
-autoheader || exit 1
+patch -p1 < $CWD/dropbear_emptypass.patch
cp $CWD/localoptions.h .
@@ -95,47 +102,46 @@ CXXFLAGS="$SLKCFLAGS" \
--disable-wtmpx \
--disable-pututline \
--disable-pututxline \
- --build=$ARCH-slackware-linux
+ --build=$ARCH-slackware-linux || exit 1
-make PROGRAMS="$PROGS" MULTI="1" SCPPROGRESS="1" || exit 1
+make PROGRAMS="$PROGS" MULTI="1" SCPPROGRESS="1" $NUMJOBS || exit 1
mkdir -p $PKG/sbin $PKG/bin $PKG/lib
make DESTDIR=$PKG MULTI="1" install || exit 1
# Copy manpages to package
mkdir -p $PKG/usr/man/man1
-mkdir -p $PKG/usr/man/man8
cp dbclient.1 $PKG/usr/man/man1
+mkdir -p $PKG/usr/man/man8
cp dropbearkey.8 dropbear.8 $PKG/usr/man/man8
+# Link binaries to dropbearmulti since the 'make install' does not do that
+# if we build a multicall binary.
+ln -s /bin/dropbearmulti $PKG/sbin/dropbear
+for i in $(echo $PROGS | sed -e 's/dropbear //') ; do
+ ln -s /bin/dropbearmulti $PKG/bin/$i
+done
+
if [ -d $PKG/usr/man ]; then
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
fi
-# Link binaries to dropbearmulti since the 'make install' does not do that
-# if we build a multicall binary.
-(cd $PKG/bin
- ln -s ../bin/dropbearmulti ../sbin/dropbear
- for i in $(echo $PROGS | sed -e 's/dropbear //') ; do
- ln -s dropbearmulti $i
- done
-)
-
-make install DESTDIR=$PKG
-
-find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
- grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-
mkdir -p $PKG/etc/rc.d $PKG/etc/dropbear
cp $CWD/rc.dropbear.new $PKG/etc/rc.d/ # doinst.sh will handle .new
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a CHANGES INSTALL LICENSE MULTI README SMALL TODO \
- $PKG/usr/doc/$PRGNAM-$VERSION
+ $PKG/usr/doc/$PKGNAM-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz