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