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

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