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

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