wok view dropbear/receipt @ rev 23855

Up dropbear (2020.79), nagios (4.4.6)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jun 16 20:15:47 2020 +0000 (2020-06-16)
parents d1f85e376665
children 9096d6788292
line source
1 # SliTaz package receipt.
3 PACKAGE="dropbear"
4 VERSION="2020.79"
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="http://matt.ucc.asn.au/dropbear/dropbear.html"
11 WGET_URL="http://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 EOT
44 sed -i 's|shell arch|shell uname -m|' libtommath/makefile_include.mk
45 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS &&
46 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
47 install -d -m 755 $DESTDIR/usr/sbin &&
48 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear &&
49 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1
51 # No pam support in ARM
52 case "$ARCH" in
53 arm) echo "Skipping Dropbear PAM..." ;;
54 i?86)
55 cat >> localoptions.h <<EOT
56 #define DROPBEAR_SVR_PASSWORD_AUTH 0
57 #define DROPBEAR_SVR_PAM_AUTH 1
58 #define DROPBEAR_X11FWD 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
97 # Fix dropbear initscript perms
98 chown -R root.root $fs
99 }
101 # Post message when installing.
102 post_install()
103 {
104 while read dropbear openssh ; do
105 [ -s "$1/$openssh" ] || continue
106 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear
107 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
108 done <<EOT
109 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
110 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
111 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key
112 EOT
113 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
114 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner
115 EOT
116 [ -n "$quiet" ] && return
117 echo -e "\nTo starts $PACKAGE server you can run :\n"
118 echo "/etc/init.d/$PACKAGE start"
119 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
120 }
122 post_remove()
123 {
124 grep -q dropbear "$1/etc/inetd.conf" && sed -i '/dropbear/d' "$1/etc/inetd.conf"
125 }