wok-tiny view dropbear-without-zlib/receipt @ rev 69

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