diff options
author | Piter PUNK <piterpunk@slackware.com> | 2010-05-11 20:01:31 +0200 |
---|---|---|
committer | Alan Hicks <alan@lizella.net> | 2010-05-11 20:01:31 +0200 |
commit | 4476709274ae0b8a97d086b75673707639dc8b61 (patch) | |
tree | 69e171d4decc0e417062d0892c2f1ecb81626d0f /network | |
parent | 661f29ab0becfdd1a0e394cf41b497aa61719a78 (diff) |
network/dropbear: Added to 12.0 repository
Diffstat (limited to 'network')
-rw-r--r-- | network/dropbear/README | 12 | ||||
-rw-r--r-- | network/dropbear/doinst.sh | 20 | ||||
-rw-r--r-- | network/dropbear/dropbear.SlackBuild | 104 | ||||
-rw-r--r-- | network/dropbear/dropbear.info | 8 | ||||
-rw-r--r-- | network/dropbear/dropbear.xauth.patch | 11 | ||||
-rw-r--r-- | network/dropbear/rc.dropbear.new | 52 | ||||
-rw-r--r-- | network/dropbear/slack-desc | 19 |
7 files changed, 226 insertions, 0 deletions
diff --git a/network/dropbear/README b/network/dropbear/README new file mode 100644 index 0000000000000..c73c86120f047 --- /dev/null +++ b/network/dropbear/README @@ -0,0 +1,12 @@ +dropbear (SSH server and client) + +Dropbear is a relatively small SSH 2 server and client. It runs on a +variety of POSIX-based platforms. Dropbear is open source software, +distributed under a MIT-style license. Dropbear is particularly +useful for "embedded"-type Linux (or other Unix) systems, such as +wireless routers. + +Please note that this package conflicts with OpenSSH's scp binary. +Installing this package will overwrite this file with a symbolic link +to the dropbearmulti binary. If you later remove dropbear, scp will no +longer work. diff --git a/network/dropbear/doinst.sh b/network/dropbear/doinst.sh new file mode 100644 index 0000000000000..f6e2f5b030e12 --- /dev/null +++ b/network/dropbear/doinst.sh @@ -0,0 +1,20 @@ +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... +} + +# Keep same perms on rc.dropbear.new: +if [ -e etc/rc.d/rc.dropbear ]; then + cp -a etc/rc.d/rc.dropbear etc/rc.d/rc.dropbear.new.incoming + cat etc/rc.d/rc.dropbear.new > etc/rc.d/rc.dropbear.new.incoming + mv etc/rc.d/rc.dropbear.new.incoming etc/rc.d/rc.dropbear.new +fi + +config etc/rc.d/rc.dropbear.new diff --git a/network/dropbear/dropbear.SlackBuild b/network/dropbear/dropbear.SlackBuild new file mode 100644 index 0000000000000..0419cf8d49ef7 --- /dev/null +++ b/network/dropbear/dropbear.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/sh + +# Copyright 2007-2008, Piter Punk, São Paulo, Brazil +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=dropbear +VERSION=0.50 +ARCH=${ARCH:-i486} +BUILD=${BUILD:-2} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/pkg-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +fi + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP || exit 1 +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 || exit 1 +cd $PRGNAM-$VERSION || exit 1 +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +# Apply xauth path patch +patch -p0 < $CWD/dropbear.xauth.patch + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --disable-syslog \ + --disable-utmp \ + --disable-utmpx \ + --disable-wtmp \ + --disable-wtmpx \ + --disable-pututline \ + --disable-pututxline \ + --build=$ARCH-slackware-linux + +make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI="1" || exit 1 +make DESTDIR=$PKG MULTI="1" install || exit 1 + +mkdir $PKG/usr/sbin + +# Copy manpages to package +mkdir -p $PKG/usr/man/man{1,8} +cp dbclient.1 $PKG/usr/man/man1 +cp dropbearkey.8 dropbear.8 $PKG/usr/man/man8 + +if [ -d $PKG/usr/man ]; then +( cd $PKG/usr/man + find . -type f -exec gzip -9 {} \; + for i in `find . -type l` ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +) +fi + +# Link binaries to dropbearmulti +cd $PKG/usr/bin + ln -s ../bin/dropbearmulti ../sbin/dropbear + for i in dbclient dropbearkey dropbearconvert scp ; do + ln -s dropbearmulti $i + done +cd - + +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.dropbear.new > $PKG/etc/rc.d/rc.dropbear.new + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a CHANGES INSTALL LICENSE MULTI README SMALL TODO \ + $PKG/usr/doc/$PRGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/dropbear/dropbear.info b/network/dropbear/dropbear.info new file mode 100644 index 0000000000000..759766feef2ca --- /dev/null +++ b/network/dropbear/dropbear.info @@ -0,0 +1,8 @@ +PRGNAM="dropbear" +VERSION="0.50" +HOMEPAGE="http://matt.ucc.asn.au/dropbear/dropbear.html" +DOWNLOAD="http://matt.ucc.asn.au/dropbear/releases/dropbear-0.50.tar.bz2" +MD5SUM="212f519111ef0d5903d25d80b2f418f6" +MAINTAINER="Piter PUNK" +EMAIL="piterpunk@slackware.com" +APPROVED="Alan Hicks" diff --git a/network/dropbear/dropbear.xauth.patch b/network/dropbear/dropbear.xauth.patch new file mode 100644 index 0000000000000..d01e15e044f39 --- /dev/null +++ b/network/dropbear/dropbear.xauth.patch @@ -0,0 +1,11 @@ +--- options.h.old 2008-01-29 11:54:45.000000000 -0200 ++++ options.h 2008-01-29 11:54:52.000000000 -0200 +@@ -197,7 +197,7 @@ + /* The command to invoke for xauth when using X11 forwarding. + * "-q" for quiet */ + #ifndef XAUTH_COMMAND +-#define XAUTH_COMMAND "/usr/X11R6/bin/xauth -q" ++#define XAUTH_COMMAND "/usr/bin/xauth -q" + #endif + + /* if you want to enable running an sftp server (such as the one included with diff --git a/network/dropbear/rc.dropbear.new b/network/dropbear/rc.dropbear.new new file mode 100644 index 0000000000000..81f92e266f4f0 --- /dev/null +++ b/network/dropbear/rc.dropbear.new @@ -0,0 +1,52 @@ +#!/bin/sh +# Start/stop/restart the dropbear secure shell server: + +dropbear_start() { + # Create host keys if needed. + if [ ! -f /etc/dropbear/dropbear_rsa_host_key ]; then + /usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key + fi + if [ ! -f /etc/dropbear/dropbear_dss_host_key ]; then + /usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key + fi + /usr/sbin/dropbear 2>> /var/log/dropbear.log +} + +dropbear_stop() { + killall dropbear +} + +dropbear_restart() { + if [ -r /var/run/dropbear.pid ]; then + echo "WARNING: killing listener process only. To kill every dropbear process, you " + echo " must use 'rc.dropbear stop'. 'rc.dropbear restart' kills only the " + echo " parent dropbear to allow an admin logged in through dropbear to use " + echo " 'rc.dropbear restart' without being cut off. If dropbear has been " + echo " upgraded, new connections will now use the new version, which should " + echo " be a safe enough approach." + kill `cat /var/run/dropbear.pid` + else + echo "WARNING: There does not appear to be a parent instance of dropbear running." + echo " If you really want to kill all running instances of dropbear " + echo " (including any sessions currently in use), run " + echo " '/etc/rc.d/rc.dropbear stop' instead." + exit 1 + fi + sleep 1 + dropbear_start +} + +case "$1" in +'start') + dropbear_start + ;; +'stop') + dropbear_stop + ;; +'restart') + dropbear_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac + diff --git a/network/dropbear/slack-desc b/network/dropbear/slack-desc new file mode 100644 index 0000000000000..c2d5c5e5179a4 --- /dev/null +++ b/network/dropbear/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +dropbear: dropbear (SSH server and client) +dropbear: +dropbear: Dropbear is a relatively small SSH 2 server and client. It runs on a +dropbear: variety of POSIX-based platforms. Dropbear is open source software, +dropbear: distributed under a MIT-style license. Dropbear is particularly +dropbear: useful for "embedded"-type Linux (or other Unix) systems, such as +dropbear: wireless routers. +dropbear: +dropbear: +dropbear: +dropbear: |