wok-tiny view dropbear/receipt @ rev 86

Add lpd-config
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 21 19:04:10 2012 +0200 (2012-08-21)
parents 326cb72ed4ae
children e2b369ee537b
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="libutil zlib"
10 [ -n "$TARGET" ] || TARGET="i486"
11 BUILD_DEPENDS="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"
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 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 grep -q inetd $1/etc/rcS.conf ||
62 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
63 grep -q dropbear $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
64 ssh stream tcp nowait root /usr/sbin/dropbear /usr/sbin/dropbear -i $DROPBEAR_OPTS
65 EOT
66 dos2unix <<EOT | uudecode - > $1/etc/dropbear/dropbear_dss_host_key
67 $DSSKEY
68 EOT
69 dos2unix <<EOT | uudecode - > $1/etc/dropbear/dropbear_rsa_host_key
70 $RSAKEY
71 EOT
72 chmod 600 $1/etc/dropbear/dropbear_*_host_key
73 }
75 config_form()
76 {
77 [ -n "$DROPBEAR_OPTS" ] || DROPBEAR_OPTS="-b /etc/dropbear/banner"
78 if [ -z "$DSSKEY" ]; then
79 dropbearkey -t dss -f /tmp/mkssh$$ > /dev/null 2>&1
80 DSSKEY="$(uuencode -m - < /tmp/mkssh$$)"
81 rm -f /tmp/mkssh$$
82 fi
83 uudecode - > /tmp/mkssh$$ <<EOT
84 $DSSKEY
85 EOT
86 DSSPUB="$(dropbearkey -y -f /tmp/mkssh$$ | grep ^ssh)"
87 rm -f /tmp/mkssh$$
88 if [ -z "$RSAKEY" ]; then
89 dropbearkey -t rsa -f /tmp/mkssh$$ > /dev/null 2>&1
90 RSAKEY="$(uuencode -m - < /tmp/mkssh$$)"
91 rm -f /tmp/mkssh$$
92 fi
93 uudecode - > /tmp/mkssh$$ <<EOT
94 $RSAKEY
95 EOT
96 RSAPUB="$(dropbearkey -y -f /tmp/mkssh$$ | grep ^ssh)"
97 rm -f /tmp/mkssh$$
98 cat <<EOT
99 <table>
100 <tr>
101 <td>Server options</td>
102 <td><input type="text" name="DROPBEAR_OPTS" value="$DROPBEAR_OPTS" /></td>
103 </tr>
104 <tr>
105 <td>DSS key</td>
106 <td><textarea name="DSSKEY" cols="60" rows="13" wrap="off">
107 $DSSKEY
108 </textarea></td>
109 </tr>
110 <tr>
111 <td>RSA key</td>
112 <td><textarea name="RSAKEY" cols="60" rows="12" wrap="off">
113 $RSAKEY
114 </textarea></td>
115 </tr>
116 </table>
117 You can set your dropbear key
118 <pre>
119 # uuencode -m - < /etc/dropbear/dropbear_dss_host_key
120 </pre>
121 Or your ssh key
122 <pre>
123 # dropbearconvert openssh dropbear /etc/ssh/id_dsa /dev/stdout | uuencode -m -
124 </pre>
125 Default DSS public key is
126 <pre>
127 $DSSPUB
128 </pre>
129 Default RSA public key is
130 <pre>
131 $RSAPUB
132 </pre>
133 EOT
134 }