wok-6.x annotate dropbear/receipt @ rev 23703
fusecloop: typo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Apr 28 08:38:50 2020 +0000 (2020-04-28) |
parents | adbdcada3730 |
children | eb5518b1b094 |
rev | line source |
---|---|
pankso@126 | 1 # SliTaz package receipt. |
pankso@126 | 2 |
pankso@126 | 3 PACKAGE="dropbear" |
pascal@21203 | 4 VERSION="2019.78" |
pankso@209 | 5 CATEGORY="security" |
al@17992 | 6 SHORT_DESC="Lightweight SSH2 server and client" |
pankso@126 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@14657 | 8 LICENSE="MIT" |
pankso@12689 | 9 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pankso@126 | 10 WEB_SITE="http://matt.ucc.asn.au/dropbear/dropbear.html" |
pankso@126 | 11 WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL" |
pascal@19305 | 12 CONFIG_FILES="/etc/dropbear" |
pankso@12839 | 13 SUGGESTED="sftp-server" |
pascal@4904 | 14 PROVIDE="ssh" |
jozee@4934 | 15 TAGS="ssh" |
pankso@12839 | 16 HOST_ARCH="i486 arm" |
pankso@126 | 17 |
pankso@12689 | 18 DEPENDS="zlib" |
pankso@12689 | 19 BUILD_DEPENDS="zlib-dev pam pam-dev" |
pankso@12689 | 20 |
pankso@12839 | 21 # Handle multiarch compilation. |
pankso@12834 | 22 case "$ARCH" in |
pankso@12839 | 23 arm) |
pankso@12839 | 24 BUILD_DEPENDS="" |
pankso@12839 | 25 CROSS_ARGS="--disable-zlib" |
pankso@12839 | 26 CROSS_BUGS="Fails to find zlib: -lz... no" ;; |
pankso@12834 | 27 esac |
pankso@12834 | 28 |
pascal@22822 | 29 current_version() |
pascal@22822 | 30 { |
pascal@22822 | 31 wget -O - $WEB_SITE 2>/dev/null | \ |
pascal@22822 | 32 sed "/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|;q" |
pascal@22822 | 33 } |
pascal@22822 | 34 |
pankso@126 | 35 # Rules to configure and make the package. |
pankso@126 | 36 compile_rules() |
pankso@126 | 37 { |
pankso@126 | 38 local i |
pankso@126 | 39 local DROPBEARS |
pankso@126 | 40 DROPBEARS="dropbearkey dropbearconvert dbclient scp" |
pascal@20233 | 41 cat > localoptions.h <<EOT |
pascal@20233 | 42 #define SFTPSERVER_PATH "/usr/sbin/sftp-server" |
pascal@20233 | 43 EOT |
pascal@20234 | 44 sed -i 's|shell arch|shell uname -m|' libtommath/makefile_include.mk |
pankso@12839 | 45 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS && |
pankso@12834 | 46 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 && |
slaxemulator@11100 | 47 install -d -m 755 $DESTDIR/usr/sbin && |
slaxemulator@11100 | 48 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear && |
pankso@12834 | 49 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1 |
pankso@12834 | 50 |
pankso@12834 | 51 # No pam support in ARM |
pankso@12834 | 52 case "$ARCH" in |
pankso@12834 | 53 arm) echo "Skipping Dropbear PAM..." ;; |
pankso@12839 | 54 i?86) |
pascal@20233 | 55 cat >> localoptions.h <<EOT |
pascal@20233 | 56 #define DROPBEAR_SVR_PASSWORD_AUTH 0 |
pascal@20233 | 57 #define DROPBEAR_SVR_PAM_AUTH 1 |
pascal@20233 | 58 EOT |
pankso@12834 | 59 ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS && |
pankso@12834 | 60 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 && |
pankso@12834 | 61 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear-pam && |
pankso@12834 | 62 chown 0.0 $DESTDIR/usr/sbin/dropbear-pam || exit 1 ;; |
pankso@12834 | 63 esac |
pankso@12834 | 64 |
slaxemulator@11100 | 65 install -d -m 755 $DESTDIR/usr/bin && |
pascal@1440 | 66 for i in $DROPBEARS ssh; do |
pankso@12834 | 67 ln -s ../sbin/dropbear $DESTDIR/usr/bin/$i || exit 1 |
pankso@126 | 68 done |
pascal@19369 | 69 install -d -m 755 $DESTDIR/usr/share/man/man1 && |
pascal@19371 | 70 install -m 644 $src/*.1 $DESTDIR/usr/share/man/man1 && |
pascal@19369 | 71 install -d -m 755 $DESTDIR/usr/share/man/man8 && |
pascal@19371 | 72 install -m 644 $src/*.8 $DESTDIR/usr/share/man/man8 && |
pascal@19369 | 73 install -d -m 755 $DESTDIR/usr/share/doc && |
pascal@19371 | 74 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc |
pankso@126 | 75 } |
pankso@126 | 76 |
pankso@126 | 77 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@126 | 78 genpkg_rules() |
pankso@126 | 79 { |
pankso@126 | 80 mkdir -p $fs/usr |
pankso@12689 | 81 cp -a $install/usr/bin $fs/usr |
pankso@12689 | 82 cp -a $install/usr/sbin $fs/usr |
pascal@11595 | 83 rm -f $fs/usr/sbin/dropbear-pam |
pankso@126 | 84 # Config file and init script. |
pankso@126 | 85 mkdir -p $fs/etc |
slaxemulator@11100 | 86 cp -a $stuff/dropbear $fs/etc |
slaxemulator@11100 | 87 cp -a $stuff/init.d $fs/etc |
devl547@18881 | 88 ln -s daemon $fs/etc/init.d/sshd |
slaxemulator@11100 | 89 cp -a $stuff/sshx $fs/usr/bin |
pascal@14027 | 90 ln -s sshx $fs/usr/bin/pppssh |
pascal@18330 | 91 ln -s sshx $fs/usr/bin/sshfbvnc |
pankso@12834 | 92 touch $fs/etc/dropbear/dropbear_dss_host_key \ |
al@18599 | 93 $fs/etc/dropbear/dropbear_rsa_host_key \ |
pascal@19829 | 94 $fs/etc/dropbear/dropbear_ecdsa_host_key |
pankso@12689 | 95 |
erjo@1074 | 96 # Fix dropbear initscript perms |
pankso@1091 | 97 chown -R root.root $fs |
pankso@126 | 98 } |
pankso@126 | 99 |
pankso@126 | 100 # Post message when installing. |
pankso@126 | 101 post_install() |
pankso@126 | 102 { |
pascal@18730 | 103 while read dropbear openssh ; do |
pascal@18730 | 104 [ -s "$1/$openssh" ] || continue |
pascal@18730 | 105 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear |
pascal@18730 | 106 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint |
pascal@7304 | 107 done <<EOT |
pascal@7304 | 108 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key |
pascal@7305 | 109 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key |
pascal@19829 | 110 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key |
pascal@7304 | 111 EOT |
mojo@19390 | 112 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT |
pascal@17046 | 113 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner |
pascal@17046 | 114 EOT |
al@18968 | 115 [ -n "$quiet" ] && return |
pankso@126 | 116 echo -e "\nTo starts $PACKAGE server you can run :\n" |
pankso@126 | 117 echo "/etc/init.d/$PACKAGE start" |
pankso@126 | 118 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n" |
pankso@126 | 119 } |
pascal@17046 | 120 |
pascal@17046 | 121 post_remove() |
pascal@17046 | 122 { |
pascal@18730 | 123 grep -q dropbear "$1/etc/inetd.conf" && sed -i '/dropbear/d' "$1/etc/inetd.conf" |
pascal@17046 | 124 } |