wok-tiny annotate dropbear-without-zlib/receipt @ rev 87

Add lpd-spooling-config
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 21 20:42:47 2012 +0200 (2012-08-21)
parents dc8eca11e97c
children 8cb0d15c82ba
rev   line source
pascal@69 1 # SliTaz package receipt.
pascal@69 2
pascal@69 3 PACKAGE="dropbear-without-zlib"
pascal@69 4 VERSION="0.53"
pascal@69 5 CATEGORY="security"
pascal@69 6 SHORT_DESC="Light SSH client and server without compression support."
pascal@69 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@69 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@69 9 DEPENDS="libutil"
pascal@69 10 [ -n "$TARGET" ] || TARGET="i486"
pascal@69 11 BUILD_DEPENDS="dropbear uclibc-cross-compiler-$TARGET"
pascal@69 12 SUGGESTED="sftp-server"
pascal@69 13 WEB_SITE="http://matt.ucc.asn.au/dropbear/dropbear.html"
pascal@69 14 WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL"
pascal@69 15 CONFIG_FILES="/etc/dropbear /etc/daemons.conf /etc/rcS.conf"
pascal@69 16 PROVIDE="ssh dropbear"
pascal@69 17 TAGS="ssh"
pascal@69 18
pascal@69 19 # Rules to configure and make the package.
pascal@69 20 compile_rules()
pascal@69 21 {
pascal@69 22 local i
pascal@69 23 local DROPBEARS
pascal@69 24 DROPBEARS="dbclient scp"
pascal@69 25 cd $src
pascal@69 26 sed -i -e 's|/usr/X11R6/bin/xauth|/usr/bin/xauth|' \
pascal@69 27 -e 's|/usr/libexec/sftp-server|/usr/sbin/sftp-server|' \
pascal@69 28 options.h
pascal@69 29 ./configure --prefix=/usr --without-pam --host=$TARGET-pc-linux-gnu \
pascal@69 30 --disable-zlib CC=uclibc-$TARGET-cc &&
pascal@69 31 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 &&
pascal@69 32 install -d -m 755 $PWD/_pkg/usr/sbin &&
pascal@69 33 install -m 755 dropbearmulti $PWD/_pkg/usr/sbin/dropbear &&
pascal@69 34 chown root $PWD/_pkg/usr/sbin/dropbear &&
pascal@69 35 chgrp 0 $PWD/_pkg/usr/sbin/dropbear &&
pascal@69 36 install -d -m 755 $PWD/_pkg/usr/bin &&
pascal@69 37 for i in $DROPBEARS ssh; do
pascal@69 38 ln -s ../sbin/dropbear $PWD/_pkg/usr/bin/$i
pascal@69 39 done
pascal@69 40 }
pascal@69 41
pascal@69 42 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@69 43 genpkg_rules()
pascal@69 44 {
pascal@69 45 mkdir -p $fs/usr $fs/etc/init.d $fs/etc/dropbear
pascal@69 46 cp -a $_pkg/usr/bin $fs/usr
pascal@69 47 cp -a $_pkg/usr/sbin $fs/usr
pascal@69 48 ln -s daemon $fs/etc/init.d/dropbear
pascal@69 49 cat > $fs/etc/dropbear/banner <<EOT
pascal@69 50
pascal@69 51 Secure login on Tiny SliTaz GNU/Linux powered by Dropbear.
pascal@69 52 EOT
pascal@69 53
pascal@69 54 # Fix dropbear initscript perms
pascal@69 55 chown -R root.root $fs
pascal@69 56 }
pascal@69 57
pascal@69 58 # Post message when installing.
pascal@69 59 post_install()
pascal@69 60 {
pascal@87 61 if [ "$STARTDAEMON" = "ON" ]; then
pascal@87 62 grep -q inetd $1/etc/rcS.conf ||
pascal@87 63 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
pascal@87 64 grep -q dropbear $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
pascal@86 65 ssh stream tcp nowait root /usr/sbin/dropbear /usr/sbin/dropbear -i $DROPBEAR_OPTS
pascal@69 66 EOT
pascal@87 67 fi
pascal@69 68 dos2unix <<EOT | uudecode - > $1/etc/dropbear/dropbear_dss_host_key
pascal@69 69 $DSSKEY
pascal@69 70 EOT
pascal@69 71 dos2unix <<EOT | uudecode - > $1/etc/dropbear/dropbear_rsa_host_key
pascal@69 72 $RSAKEY
pascal@69 73 EOT
pascal@69 74 chmod 600 $1/etc/dropbear/dropbear_*_host_key
pascal@69 75 }
pascal@69 76
pascal@69 77 config_form()
pascal@69 78 {
pascal@69 79 [ -n "$DROPBEAR_OPTS" ] || DROPBEAR_OPTS="-b /etc/dropbear/banner"
pascal@69 80 if [ -z "$DSSKEY" ]; then
pascal@69 81 dropbearkey -t dss -f /tmp/mkssh$$ > /dev/null 2>&1
pascal@69 82 DSSKEY="$(uuencode -m - < /tmp/mkssh$$)"
pascal@69 83 rm -f /tmp/mkssh$$
pascal@69 84 fi
pascal@69 85 uudecode - > /tmp/mkssh$$ <<EOT
pascal@69 86 $DSSKEY
pascal@69 87 EOT
pascal@69 88 DSSPUB="$(dropbearkey -y -f /tmp/mkssh$$ | grep ^ssh)"
pascal@69 89 rm -f /tmp/mkssh$$
pascal@69 90 if [ -z "$RSAKEY" ]; then
pascal@69 91 dropbearkey -t rsa -f /tmp/mkssh$$ > /dev/null 2>&1
pascal@69 92 RSAKEY="$(uuencode -m - < /tmp/mkssh$$)"
pascal@69 93 rm -f /tmp/mkssh$$
pascal@69 94 fi
pascal@69 95 uudecode - > /tmp/mkssh$$ <<EOT
pascal@69 96 $RSAKEY
pascal@69 97 EOT
pascal@69 98 RSAPUB="$(dropbearkey -y -f /tmp/mkssh$$ | grep ^ssh)"
pascal@69 99 rm -f /tmp/mkssh$$
pascal@69 100 cat <<EOT
pascal@87 101 <input type="checkbox" name="STARTDAEMON" value="ON" checked="checked" />
pascal@87 102 Start server during boot<br>
pascal@69 103 <table>
pascal@69 104 <tr>
pascal@69 105 <td>Server options</td>
pascal@69 106 <td><input type="text" name="DROPBEAR_OPTS" value="$DROPBEAR_OPTS" /></td>
pascal@69 107 </tr>
pascal@69 108 <tr>
pascal@69 109 <td>DSS key</td>
pascal@69 110 <td><textarea name="DSSKEY" cols="60" rows="13" wrap="off">
pascal@69 111 $DSSKEY
pascal@69 112 </textarea></td>
pascal@69 113 </tr>
pascal@69 114 <tr>
pascal@69 115 <td>RSA key</td>
pascal@69 116 <td><textarea name="RSAKEY" cols="60" rows="12" wrap="off">
pascal@69 117 $RSAKEY
pascal@69 118 </textarea></td>
pascal@69 119 </tr>
pascal@69 120 </table>
pascal@69 121 You can set your dropbear key
pascal@69 122 <pre>
pascal@69 123 # uuencode -m - < /etc/dropbear/dropbear_dss_host_key
pascal@69 124 </pre>
pascal@69 125 Or your ssh key
pascal@69 126 <pre>
pascal@69 127 # dropbearconvert openssh dropbear /etc/ssh/id_dsa /dev/stdout | uuencode -m -
pascal@69 128 </pre>
pascal@69 129 Default DSS public key is
pascal@69 130 <pre>
pascal@69 131 $DSSPUB
pascal@69 132 </pre>
pascal@69 133 Default RSA public key is
pascal@69 134 <pre>
pascal@69 135 $RSAPUB
pascal@69 136 </pre>
pascal@69 137 EOT
pascal@69 138 }