wok view dropbear/receipt @ rev 25707
Up perl-net-pcap (0.21), qtermwidget (0.5.1), youtube-dl-gui (0.3.8)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 05 14:08:34 2024 +0000 (3 months ago) |
parents | 55b1ebb18512 |
children | 54b8c7c6fe47 |
line source
1 # SliTaz package receipt.
3 PACKAGE="dropbear"
4 VERSION="2024.84"
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://github.com/mkj/dropbear"
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 - https://github.com/mkj/dropbear/releases 2>/dev/null | \
34 sed '/tag\//!d;s|.*tag/[A-Z_]*||;s|".*||;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|shell arch|shell uname -m|' libtommath/makefile_include.mk
48 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS &&
49 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
50 install -d -m 755 $DESTDIR/usr/sbin &&
51 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear &&
52 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1
54 # No pam support in ARM
55 case "$ARCH" in
56 arm) echo "Skipping Dropbear PAM..." ;;
57 i?86)
58 cat >> localoptions.h <<EOT
59 #define DROPBEAR_SVR_PASSWORD_AUTH 0
60 #define DROPBEAR_SVR_PAM_AUTH 1
61 EOT
62 ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS &&
63 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
64 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear-pam &&
65 chown 0.0 $DESTDIR/usr/sbin/dropbear-pam || exit 1 ;;
66 esac
68 install -d -m 755 $DESTDIR/usr/bin &&
69 for i in $DROPBEARS ssh; do
70 ln -s ../sbin/dropbear $DESTDIR/usr/bin/$i || exit 1
71 done
72 install -d -m 755 $DESTDIR/usr/share/man/man1 &&
73 install -m 644 $src/manpages/*.1 $DESTDIR/usr/share/man/man1 &&
74 install -d -m 755 $DESTDIR/usr/share/man/man8 &&
75 install -m 644 $src/manpages/*.8 $DESTDIR/usr/share/man/man8 &&
76 install -d -m 755 $DESTDIR/usr/share/doc &&
77 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc
78 }
80 # Rules to gen a SliTaz package suitable for Tazpkg.
81 genpkg_rules()
82 {
83 mkdir -p $fs/usr
84 cp -a $install/usr/bin $fs/usr
85 cp -a $install/usr/sbin $fs/usr
86 rm -f $fs/usr/sbin/dropbear-pam
87 # Config file and init script.
88 mkdir -p $fs/etc
89 cp -a $stuff/dropbear $fs/etc
90 cp -a $stuff/init.d $fs/etc
91 ln -s daemon $fs/etc/init.d/sshd
92 cp -a $stuff/sshx $fs/usr/bin
93 ln -s sshx $fs/usr/bin/pppssh
94 ln -s sshx $fs/usr/bin/sshfbvnc
95 touch $fs/etc/dropbear/dropbear_rsa_host_key \
96 $fs/etc/dropbear/dropbear_ecdsa_host_key \
97 $fs/etc/dropbear/dropbear_ed25519_host_key
99 # Fix dropbear initscript perms
100 chown -R root.root $fs
101 }
103 # Post message when installing.
104 post_install()
105 {
106 while read dropbear openssh ; do
107 [ -s "$1/$openssh" ] || continue
108 [ -s "$1/$dropbear" ] && continue
109 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear
110 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
111 done <<EOT
112 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
113 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key
114 /etc/dropbear/dropbear_ed25519_host_key /etc/ssh/ssh_host_ed25519_key
115 EOT
116 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
117 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner
118 EOT
119 [ -n "$quiet" ] && return
120 echo -e "\nTo starts $PACKAGE server you can run :\n"
121 echo "/etc/init.d/$PACKAGE start"
122 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
123 }
125 post_remove()
126 {
127 grep -q dropbear "$1/etc/inetd.conf" && sed -i '/dropbear/d' "$1/etc/inetd.conf"
128 }