wok-6.x view dropbear/receipt @ rev 23899
busybox: add crontabs in CONFIG_FILES
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jul 28 08:34:55 2020 +0000 (2020-07-28) |
parents | b29edd818c5e |
children | a8546de77bcc |
line source
1 # SliTaz package receipt.
3 PACKAGE="dropbear"
4 VERSION="2020.80"
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"
13 SUGGESTED="sftp-server"
14 PROVIDE="ssh"
15 TAGS="ssh"
16 HOST_ARCH="i486 arm"
18 DEPENDS="zlib"
19 BUILD_DEPENDS="zlib-dev pam pam-dev"
21 # Handle multiarch compilation.
22 case "$ARCH" in
23 arm)
24 BUILD_DEPENDS=""
25 CROSS_ARGS="--disable-zlib"
26 CROSS_BUGS="Fails to find zlib: -lz... no" ;;
27 esac
29 current_version()
30 {
31 wget -O - $WEB_SITE 2>/dev/null | \
32 sed "/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|;q"
33 }
35 # Rules to configure and make the package.
36 compile_rules()
37 {
38 local i
39 local DROPBEARS
40 DROPBEARS="dropbearkey dropbearconvert dbclient scp"
41 cat > localoptions.h <<EOT
42 #define SFTPSERVER_PATH "/usr/sbin/sftp-server"
43 #define DROPBEAR_X11FWD 1
44 EOT
45 sed -i 's|shell arch|shell uname -m|' libtommath/makefile_include.mk
46 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS &&
47 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
48 install -d -m 755 $DESTDIR/usr/sbin &&
49 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear &&
50 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1
52 # No pam support in ARM
53 case "$ARCH" in
54 arm) echo "Skipping Dropbear PAM..." ;;
55 i?86)
56 cat >> localoptions.h <<EOT
57 #define DROPBEAR_SVR_PASSWORD_AUTH 0
58 #define DROPBEAR_SVR_PAM_AUTH 1
59 EOT
60 ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS &&
61 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
62 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear-pam &&
63 chown 0.0 $DESTDIR/usr/sbin/dropbear-pam || exit 1 ;;
64 esac
66 install -d -m 755 $DESTDIR/usr/bin &&
67 for i in $DROPBEARS ssh; do
68 ln -s ../sbin/dropbear $DESTDIR/usr/bin/$i || exit 1
69 done
70 install -d -m 755 $DESTDIR/usr/share/man/man1 &&
71 install -m 644 $src/*.1 $DESTDIR/usr/share/man/man1 &&
72 install -d -m 755 $DESTDIR/usr/share/man/man8 &&
73 install -m 644 $src/*.8 $DESTDIR/usr/share/man/man8 &&
74 install -d -m 755 $DESTDIR/usr/share/doc &&
75 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc
76 }
78 # Rules to gen a SliTaz package suitable for Tazpkg.
79 genpkg_rules()
80 {
81 mkdir -p $fs/usr
82 cp -a $install/usr/bin $fs/usr
83 cp -a $install/usr/sbin $fs/usr
84 rm -f $fs/usr/sbin/dropbear-pam
85 # Config file and init script.
86 mkdir -p $fs/etc
87 cp -a $stuff/dropbear $fs/etc
88 cp -a $stuff/init.d $fs/etc
89 ln -s daemon $fs/etc/init.d/sshd
90 cp -a $stuff/sshx $fs/usr/bin
91 ln -s sshx $fs/usr/bin/pppssh
92 ln -s sshx $fs/usr/bin/sshfbvnc
93 touch $fs/etc/dropbear/dropbear_dss_host_key \
94 $fs/etc/dropbear/dropbear_rsa_host_key \
95 $fs/etc/dropbear/dropbear_ecdsa_host_key \
96 $fs/etc/dropbear/dropbear_ed25519_host_key
98 # Fix dropbear initscript perms
99 chown -R root.root $fs
100 }
102 # Post message when installing.
103 post_install()
104 {
105 while read dropbear openssh ; do
106 [ -s "$1/$openssh" ] || continue
107 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear
108 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
109 done <<EOT
110 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
111 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
112 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key
113 /etc/dropbear/dropbear_ed25519_host_key /etc/ssh/ssh_host_ed25519_key
114 EOT
115 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
116 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner
117 EOT
118 [ -n "$quiet" ] && return
119 echo -e "\nTo starts $PACKAGE server you can run :\n"
120 echo "/etc/init.d/$PACKAGE start"
121 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
122 }
124 post_remove()
125 {
126 grep -q dropbear "$1/etc/inetd.conf" && sed -i '/dropbear/d' "$1/etc/inetd.conf"
127 }