wok annotate dropbear/receipt @ rev 25639
Add miss pixmaps for xarchiver, thanks kubepc
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sat Jan 06 09:40:30 2024 +0100 (8 months ago) |
parents | 48dff2952881 |
children | e9542eb10538 |
rev | line source |
---|---|
pankso@126 | 1 # SliTaz package receipt. |
pankso@126 | 2 |
pankso@126 | 3 PACKAGE="dropbear" |
pascal@25498 | 4 VERSION="2022.83" |
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" |
pascal@25421 | 10 WEB_SITE="https://github.com/mkj/dropbear" |
pascal@23881 | 11 WGET_URL="https://matt.ucc.asn.au/dropbear/releases/$TARBALL" |
pascal@23902 | 12 CONFIG_FILES="/etc/dropbear/banner" |
pascal@23902 | 13 SECRET_FILES="/etc/dropbear/*key" |
pankso@12839 | 14 SUGGESTED="sftp-server" |
pascal@4904 | 15 PROVIDE="ssh" |
jozee@4934 | 16 TAGS="ssh" |
pankso@12839 | 17 HOST_ARCH="i486 arm" |
pankso@126 | 18 |
pankso@12689 | 19 DEPENDS="zlib" |
pankso@12689 | 20 BUILD_DEPENDS="zlib-dev pam pam-dev" |
pankso@12689 | 21 |
pankso@12839 | 22 # Handle multiarch compilation. |
pankso@12834 | 23 case "$ARCH" in |
pankso@12839 | 24 arm) |
pankso@12839 | 25 BUILD_DEPENDS="" |
pankso@12839 | 26 CROSS_ARGS="--disable-zlib" |
pankso@12839 | 27 CROSS_BUGS="Fails to find zlib: -lz... no" ;; |
pankso@12834 | 28 esac |
pankso@12834 | 29 |
pascal@25073 | 30 # What is the latest version available today? |
pascal@22822 | 31 current_version() |
pascal@22822 | 32 { |
pascal@25601 | 33 wget -O - https://github.com/mkj/dropbear/releases 2>/dev/null | \ |
pascal@25601 | 34 sed '/tag\//!d;s|.*tag/[A-Z_]*||;s|".*||;q' |
pascal@22822 | 35 } |
pascal@22822 | 36 |
pankso@126 | 37 # Rules to configure and make the package. |
pankso@126 | 38 compile_rules() |
pankso@126 | 39 { |
pankso@126 | 40 local i |
pankso@126 | 41 local DROPBEARS |
pankso@126 | 42 DROPBEARS="dropbearkey dropbearconvert dbclient scp" |
pascal@20233 | 43 cat > localoptions.h <<EOT |
pascal@20233 | 44 #define SFTPSERVER_PATH "/usr/sbin/sftp-server" |
pascal@23872 | 45 #define DROPBEAR_X11FWD 1 |
pascal@20233 | 46 EOT |
pascal@25073 | 47 sed -i 's|DROPBEAR_CHANNEL_PRIO_INTERACTIVE|DROPBEAR_PRIO_LOWDELAY|' svr-x11fwd.c |
pascal@20234 | 48 sed -i 's|shell arch|shell uname -m|' libtommath/makefile_include.mk |
pankso@12839 | 49 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS && |
pankso@12834 | 50 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 && |
slaxemulator@11100 | 51 install -d -m 755 $DESTDIR/usr/sbin && |
slaxemulator@11100 | 52 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear && |
pankso@12834 | 53 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1 |
pankso@12834 | 54 |
pankso@12834 | 55 # No pam support in ARM |
pankso@12834 | 56 case "$ARCH" in |
pankso@12834 | 57 arm) echo "Skipping Dropbear PAM..." ;; |
pankso@12839 | 58 i?86) |
pascal@20233 | 59 cat >> localoptions.h <<EOT |
pascal@20233 | 60 #define DROPBEAR_SVR_PASSWORD_AUTH 0 |
pascal@20233 | 61 #define DROPBEAR_SVR_PAM_AUTH 1 |
pascal@20233 | 62 EOT |
pankso@12834 | 63 ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS && |
pankso@12834 | 64 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 && |
pankso@12834 | 65 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear-pam && |
pankso@12834 | 66 chown 0.0 $DESTDIR/usr/sbin/dropbear-pam || exit 1 ;; |
pankso@12834 | 67 esac |
pankso@12834 | 68 |
slaxemulator@11100 | 69 install -d -m 755 $DESTDIR/usr/bin && |
pascal@1440 | 70 for i in $DROPBEARS ssh; do |
pankso@12834 | 71 ln -s ../sbin/dropbear $DESTDIR/usr/bin/$i || exit 1 |
pankso@126 | 72 done |
pascal@19369 | 73 install -d -m 755 $DESTDIR/usr/share/man/man1 && |
pascal@19371 | 74 install -m 644 $src/*.1 $DESTDIR/usr/share/man/man1 && |
pascal@19369 | 75 install -d -m 755 $DESTDIR/usr/share/man/man8 && |
pascal@19371 | 76 install -m 644 $src/*.8 $DESTDIR/usr/share/man/man8 && |
pascal@19369 | 77 install -d -m 755 $DESTDIR/usr/share/doc && |
pascal@19371 | 78 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc |
pankso@126 | 79 } |
pankso@126 | 80 |
pankso@126 | 81 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@126 | 82 genpkg_rules() |
pankso@126 | 83 { |
pankso@126 | 84 mkdir -p $fs/usr |
pankso@12689 | 85 cp -a $install/usr/bin $fs/usr |
pankso@12689 | 86 cp -a $install/usr/sbin $fs/usr |
pascal@11595 | 87 rm -f $fs/usr/sbin/dropbear-pam |
pankso@126 | 88 # Config file and init script. |
pankso@126 | 89 mkdir -p $fs/etc |
slaxemulator@11100 | 90 cp -a $stuff/dropbear $fs/etc |
slaxemulator@11100 | 91 cp -a $stuff/init.d $fs/etc |
devl547@18881 | 92 ln -s daemon $fs/etc/init.d/sshd |
slaxemulator@11100 | 93 cp -a $stuff/sshx $fs/usr/bin |
pascal@14027 | 94 ln -s sshx $fs/usr/bin/pppssh |
pascal@18330 | 95 ln -s sshx $fs/usr/bin/sshfbvnc |
pascal@25498 | 96 touch $fs/etc/dropbear/dropbear_rsa_host_key \ |
pascal@23872 | 97 $fs/etc/dropbear/dropbear_ecdsa_host_key \ |
pascal@23872 | 98 $fs/etc/dropbear/dropbear_ed25519_host_key |
pankso@12689 | 99 |
erjo@1074 | 100 # Fix dropbear initscript perms |
pankso@1091 | 101 chown -R root.root $fs |
pankso@126 | 102 } |
pankso@126 | 103 |
pankso@126 | 104 # Post message when installing. |
pankso@126 | 105 post_install() |
pankso@126 | 106 { |
pascal@18730 | 107 while read dropbear openssh ; do |
pascal@18730 | 108 [ -s "$1/$openssh" ] || continue |
pascal@23995 | 109 [ -s "$1/$dropbear" ] && continue |
pascal@18730 | 110 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear |
pascal@18730 | 111 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint |
pascal@7304 | 112 done <<EOT |
pascal@7304 | 113 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key |
pascal@19829 | 114 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key |
pascal@23868 | 115 /etc/dropbear/dropbear_ed25519_host_key /etc/ssh/ssh_host_ed25519_key |
pascal@7304 | 116 EOT |
mojo@19390 | 117 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT |
pascal@17046 | 118 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner |
pascal@17046 | 119 EOT |
al@18968 | 120 [ -n "$quiet" ] && return |
pankso@126 | 121 echo -e "\nTo starts $PACKAGE server you can run :\n" |
pankso@126 | 122 echo "/etc/init.d/$PACKAGE start" |
pankso@126 | 123 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n" |
pankso@126 | 124 } |
pascal@17046 | 125 |
pascal@17046 | 126 post_remove() |
pascal@17046 | 127 { |
pascal@18730 | 128 grep -q dropbear "$1/etc/inetd.conf" && sed -i '/dropbear/d' "$1/etc/inetd.conf" |
pascal@17046 | 129 } |