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