wok-next annotate dropbear/receipt @ rev 20957
Random updates
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Sep 05 15:26:05 2018 +0300 (2018-09-05) |
parents | 555cf3b9f1ff |
children | d5aab818505e |
rev | line source |
---|---|
al@19850 | 1 # SliTaz package receipt v2. |
pankso@126 | 2 |
pankso@126 | 3 PACKAGE="dropbear" |
al@20896 | 4 VERSION="2018.76" |
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@126 | 9 WEB_SITE="http://matt.ucc.asn.au/dropbear/dropbear.html" |
pankso@126 | 10 |
al@19601 | 11 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
al@19601 | 12 WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL" |
al@19601 | 13 |
al@20443 | 14 case "$ARCH" in |
al@20443 | 15 i486) BUILD_DEPENDS="zlib-dev pam pam-dev"; SPLIT="dropbear-pam";; |
al@20443 | 16 x86_64) BUILD_DEPENDS="zlib-dev";; |
al@20443 | 17 arm*) BUILD_DEPENDS="";; |
al@20443 | 18 esac |
pankso@12689 | 19 |
al@20443 | 20 compile_rules() { |
al@19850 | 21 # Handle multiarch compilation. |
al@19850 | 22 case "$ARCH" in |
al@19850 | 23 arm) |
al@19850 | 24 CROSS_ARGS="--disable-zlib" |
al@19850 | 25 CROSS_BUGS="Fails to find zlib: -lz... no" ;; |
al@19850 | 26 esac |
al@19850 | 27 |
al@19850 | 28 local i DROPBEARS="dropbearkey dropbearconvert dbclient scp" |
al@19850 | 29 sed -iold -e 's|/usr/.*/xauth|/usr/bin/xauth|' \ |
al@18968 | 30 -e 's|ENABLE_SVR_PAM_AUTH|ENABLE_SVR_PASSWORD_AUTH|' \ |
pascal@3628 | 31 options.h |
al@19850 | 32 |
al@19850 | 33 ./configure \ |
al@19850 | 34 --prefix=/usr \ |
al@19850 | 35 --without-pam \ |
al@19850 | 36 $CONFIGURE_ARGS $CROSS_ARGS && |
pankso@12834 | 37 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 && |
al@19850 | 38 install -dm755 $install/usr/sbin && |
al@19850 | 39 install -m755 dropbearmulti $install/usr/sbin/dropbear || exit 1 |
pankso@12834 | 40 |
al@19850 | 41 # No PAM support in ARM |
pankso@12834 | 42 case "$ARCH" in |
pankso@12834 | 43 arm) echo "Skipping Dropbear PAM..." ;; |
pankso@12839 | 44 i?86) |
al@19850 | 45 sed -i 's|ENABLE_SVR_PASSWORD_AUTH|ENABLE_SVR_PAM_AUTH|' options.h |
al@19850 | 46 ./configure \ |
al@19850 | 47 --enable-pam \ |
al@19850 | 48 $CONFIGURE_ARGS && |
pankso@12834 | 49 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 && |
al@20443 | 50 install -m755 dropbearmulti $install/usr/sbin/dropbear-pam || return 1 |
al@19850 | 51 ;; |
pankso@12834 | 52 esac |
pankso@12834 | 53 |
al@19850 | 54 install -dm755 $install/usr/bin && |
pascal@1440 | 55 for i in $DROPBEARS ssh; do |
al@19850 | 56 ln -s ../sbin/dropbear $install/usr/bin/$i || exit 1 |
pankso@126 | 57 done |
al@19850 | 58 |
al@19850 | 59 cook_pick_manpages $src/*.1 $src/*.8 |
al@20896 | 60 cook_pick_docs CHANGES INSTALL LICENSE MULTI README SMALL |
al@19850 | 61 |
al@19850 | 62 # Config file and init script. |
al@19850 | 63 mkdir -p $install/etc |
al@19850 | 64 cp -a $stuff/dropbear $install/etc |
al@19850 | 65 cp -a $stuff/init.d $install/etc |
al@19850 | 66 cp -a $stuff/sshx $install/usr/bin |
al@19850 | 67 ln -s sshx $install/usr/bin/pppssh |
al@19850 | 68 ln -s sshx $install/usr/bin/sshfbvnc |
al@19850 | 69 touch $install/etc/dropbear/dropbear_dss_host_key \ |
al@19850 | 70 $install/etc/dropbear/dropbear_rsa_host_key \ |
al@19850 | 71 $install/etc/dropbear/dropbear_ecdsa_host_key |
al@19850 | 72 |
al@19851 | 73 # PAM |
al@19851 | 74 cp -a $stuff/pam.d $install/etc |
al@19851 | 75 |
al@19850 | 76 # Fix dropbear initscript perms |
al@19850 | 77 chown -R root:root $install |
al@20443 | 78 |
al@20443 | 79 ln -s daemon $install/etc/init.d/sshd |
al@20443 | 80 |
pankso@126 | 81 } |
pankso@126 | 82 |
al@19850 | 83 genpkg_rules() { |
al@19850 | 84 case $PACKAGE in |
al@19850 | 85 dropbear) |
al@19850 | 86 copy @std |
al@19850 | 87 rm -f $fs/usr/sbin/dropbear-pam |
al@19851 | 88 rm -r $fs/etc/pam.d/ |
al@19850 | 89 DEPENDS="zlib" |
al@19850 | 90 CONFIG_FILES="/etc/dropbear" |
al@19850 | 91 PROVIDE="ssh" |
al@19850 | 92 TAGS="ssh" |
al@19850 | 93 ;; |
al@19850 | 94 dropbear-pam) |
al@19851 | 95 copy dropbear-pam pam.d/ |
al@19850 | 96 mv $fs/usr/sbin/dropbear-pam $fs/usr/sbin/dropbear |
al@19850 | 97 DEPENDS="dropbear pam" |
al@19850 | 98 CAT="security|with PAM support" |
al@19850 | 99 PROVIDE="dropbear:pam ssh:pam" |
al@19850 | 100 TAGS="ssh" |
al@19850 | 101 ;; |
al@19850 | 102 esac |
pankso@126 | 103 } |
pankso@126 | 104 |
pankso@126 | 105 # Post message when installing. |
al@19850 | 106 post_install_dropbear() { |
al@19850 | 107 while read dropbear openssh; do |
pascal@18730 | 108 [ -s "$1/$openssh" ] || continue |
pascal@18730 | 109 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear |
pascal@18730 | 110 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint |
pascal@7304 | 111 done <<EOT |
pascal@7304 | 112 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key |
pascal@7305 | 113 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key |
pascal@19889 | 114 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key |
pascal@7304 | 115 EOT |
mojo@19390 | 116 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT |
pascal@17046 | 117 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner |
pascal@17046 | 118 EOT |
al@19858 | 119 [ -n "$quiet" ] && return |
al@19850 | 120 cat <<EOT |
al@19850 | 121 |
al@19850 | 122 .-------------------------------------------------. |
al@19850 | 123 | To start dropbear server you can run: | |
al@19850 | 124 | | |
al@19850 | 125 | /etc/init.d/dropbear start | |
al@19850 | 126 | Or add dropbear to RUN_DAEMONS in /etc/rcS.conf | |
al@19850 | 127 '-------------------------------------------------' |
al@19850 | 128 EOT |
pankso@126 | 129 } |
pascal@17046 | 130 |
al@19850 | 131 post_remove_dropbear() { |
al@19850 | 132 grep -q dropbear "$1/etc/inetd.conf" && |
al@19850 | 133 sed -i '/dropbear/d' "$1/etc/inetd.conf" |
pascal@17046 | 134 } |
al@19850 | 135 |
al@19850 | 136 post_remove_dropbear_pam() { |
al@19850 | 137 tazpkg -gi dropbear --forced |
al@19850 | 138 } |