wok-current view dropbear/receipt @ rev 25338
updated svkbd packages ( -> 0.4.1)
author | Hans-G?nter Theisgen |
---|---|
date | Sun Jul 24 10:22:05 2022 +0100 (2022-07-24) |
parents | 9c5316bc7e8e |
children | 00bff3684d8a |
line source
1 # SliTaz package receipt.
3 PACKAGE="dropbear"
4 VERSION="2022.82"
5 CATEGORY="security"
6 SHORT_DESC="Lightweight SSH2 server and client"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="MIT"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="https://matt.ucc.asn.au/dropbear/dropbear.html"
11 WGET_URL="https://matt.ucc.asn.au/dropbear/releases/$TARBALL"
12 CONFIG_FILES="/etc/dropbear/banner"
13 SECRET_FILES="/etc/dropbear/*key"
14 SUGGESTED="sftp-server"
15 PROVIDE="ssh"
16 TAGS="ssh"
17 HOST_ARCH="i486 arm"
19 DEPENDS="zlib"
20 BUILD_DEPENDS="zlib-dev pam pam-dev"
22 # Handle multiarch compilation.
23 case "$ARCH" in
24 arm)
25 BUILD_DEPENDS=""
26 CROSS_ARGS="--disable-zlib"
27 CROSS_BUGS="Fails to find zlib: -lz... no" ;;
28 esac
30 # What is the latest version available today?
31 current_version()
32 {
33 wget -O - $WEB_SITE 2>/dev/null | \
34 sed "/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|;q"
35 }
37 # Rules to configure and make the package.
38 compile_rules()
39 {
40 local i
41 local DROPBEARS
42 DROPBEARS="dropbearkey dropbearconvert dbclient scp"
43 cat > localoptions.h <<EOT
44 #define SFTPSERVER_PATH "/usr/sbin/sftp-server"
45 #define DROPBEAR_X11FWD 1
46 EOT
47 sed -i 's|DROPBEAR_CHANNEL_PRIO_INTERACTIVE|DROPBEAR_PRIO_LOWDELAY|' svr-x11fwd.c
48 sed -i 's|shell arch|shell uname -m|' libtommath/makefile_include.mk
49 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS &&
50 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
51 install -d -m 755 $DESTDIR/usr/sbin &&
52 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear &&
53 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1
55 # No pam support in ARM
56 case "$ARCH" in
57 arm) echo "Skipping Dropbear PAM..." ;;
58 i?86)
59 cat >> localoptions.h <<EOT
60 #define DROPBEAR_SVR_PASSWORD_AUTH 0
61 #define DROPBEAR_SVR_PAM_AUTH 1
62 EOT
63 ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS &&
64 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
65 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear-pam &&
66 chown 0.0 $DESTDIR/usr/sbin/dropbear-pam || exit 1 ;;
67 esac
69 install -d -m 755 $DESTDIR/usr/bin &&
70 for i in $DROPBEARS ssh; do
71 ln -s ../sbin/dropbear $DESTDIR/usr/bin/$i || exit 1
72 done
73 install -d -m 755 $DESTDIR/usr/share/man/man1 &&
74 install -m 644 $src/*.1 $DESTDIR/usr/share/man/man1 &&
75 install -d -m 755 $DESTDIR/usr/share/man/man8 &&
76 install -m 644 $src/*.8 $DESTDIR/usr/share/man/man8 &&
77 install -d -m 755 $DESTDIR/usr/share/doc &&
78 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc
79 }
81 # Rules to gen a SliTaz package suitable for Tazpkg.
82 genpkg_rules()
83 {
84 mkdir -p $fs/usr
85 cp -a $install/usr/bin $fs/usr
86 cp -a $install/usr/sbin $fs/usr
87 rm -f $fs/usr/sbin/dropbear-pam
88 # Config file and init script.
89 mkdir -p $fs/etc
90 cp -a $stuff/dropbear $fs/etc
91 cp -a $stuff/init.d $fs/etc
92 ln -s daemon $fs/etc/init.d/sshd
93 cp -a $stuff/sshx $fs/usr/bin
94 ln -s sshx $fs/usr/bin/pppssh
95 ln -s sshx $fs/usr/bin/sshfbvnc
96 touch $fs/etc/dropbear/dropbear_dss_host_key \
97 $fs/etc/dropbear/dropbear_rsa_host_key \
98 $fs/etc/dropbear/dropbear_ecdsa_host_key \
99 $fs/etc/dropbear/dropbear_ed25519_host_key
101 # Fix dropbear initscript perms
102 chown -R root.root $fs
103 }
105 # Post message when installing.
106 post_install()
107 {
108 while read dropbear openssh ; do
109 [ -s "$1/$openssh" ] || continue
110 [ -s "$1/$dropbear" ] && continue
111 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear
112 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
113 done <<EOT
114 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
115 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
116 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key
117 /etc/dropbear/dropbear_ed25519_host_key /etc/ssh/ssh_host_ed25519_key
118 EOT
119 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
120 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner
121 EOT
122 [ -n "$quiet" ] && return
123 echo -e "\nTo starts $PACKAGE server you can run :\n"
124 echo "/etc/init.d/$PACKAGE start"
125 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
126 }
128 post_remove()
129 {
130 grep -q dropbear "$1/etc/inetd.conf" && sed -i '/dropbear/d' "$1/etc/inetd.conf"
131 }