wok-next annotate dropbear/receipt @ rev 21119
libarchive: depends on libzstd
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Jan 14 03:39:08 2019 +0200 (2019-01-14) |
parents | 68405ac5fe8a |
children | 211f5ebfccdb |
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@21020 | 14 BUILD_DEPENDS="zlib-dev pam-dev" |
al@21020 | 15 SPLIT="$PACKAGE-pam" |
pankso@12689 | 16 |
al@20443 | 17 compile_rules() { |
al@19850 | 18 local i DROPBEARS="dropbearkey dropbearconvert dbclient scp" |
al@19850 | 19 sed -iold -e 's|/usr/.*/xauth|/usr/bin/xauth|' \ |
al@18968 | 20 -e 's|ENABLE_SVR_PAM_AUTH|ENABLE_SVR_PASSWORD_AUTH|' \ |
pascal@3628 | 21 options.h |
al@19850 | 22 |
al@19850 | 23 ./configure \ |
al@19850 | 24 --prefix=/usr \ |
al@19850 | 25 --without-pam \ |
al@21020 | 26 $CONFIGURE_ARGS && |
pankso@12834 | 27 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 && |
al@21020 | 28 install -Dm755 dropbearmulti $install/usr/sbin/dropbear || return 1 |
pankso@12834 | 29 |
al@21020 | 30 sed -i 's|ENABLE_SVR_PASSWORD_AUTH|ENABLE_SVR_PAM_AUTH|' options.h |
al@21020 | 31 ./configure \ |
al@21020 | 32 --enable-pam \ |
al@21020 | 33 $CONFIGURE_ARGS && |
al@21020 | 34 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 && |
al@21020 | 35 install -Dm755 dropbearmulti $install/usr/sbin/dropbear-pam || return 1 |
pankso@12834 | 36 |
al@19850 | 37 install -dm755 $install/usr/bin && |
pascal@1440 | 38 for i in $DROPBEARS ssh; do |
al@21020 | 39 ln -s ../sbin/dropbear $install/usr/bin/$i || return 1 |
pankso@126 | 40 done |
al@19850 | 41 |
al@19850 | 42 cook_pick_manpages $src/*.1 $src/*.8 |
al@20896 | 43 cook_pick_docs CHANGES INSTALL LICENSE MULTI README SMALL |
al@19850 | 44 |
al@19850 | 45 # Config file and init script. |
al@19850 | 46 mkdir -p $install/etc |
al@19850 | 47 cp -a $stuff/dropbear $install/etc |
al@19850 | 48 cp -a $stuff/init.d $install/etc |
al@19850 | 49 cp -a $stuff/sshx $install/usr/bin |
al@19850 | 50 ln -s sshx $install/usr/bin/pppssh |
al@19850 | 51 ln -s sshx $install/usr/bin/sshfbvnc |
al@19850 | 52 touch $install/etc/dropbear/dropbear_dss_host_key \ |
al@19850 | 53 $install/etc/dropbear/dropbear_rsa_host_key \ |
al@19850 | 54 $install/etc/dropbear/dropbear_ecdsa_host_key |
al@19850 | 55 |
al@19851 | 56 # PAM |
al@19851 | 57 cp -a $stuff/pam.d $install/etc |
al@19851 | 58 |
al@19850 | 59 # Fix dropbear initscript perms |
al@19850 | 60 chown -R root:root $install |
al@20443 | 61 |
al@20443 | 62 ln -s daemon $install/etc/init.d/sshd |
pankso@126 | 63 } |
pankso@126 | 64 |
al@19850 | 65 genpkg_rules() { |
al@19850 | 66 case $PACKAGE in |
al@19850 | 67 dropbear) |
al@19850 | 68 copy @std |
al@19850 | 69 rm -f $fs/usr/sbin/dropbear-pam |
al@19851 | 70 rm -r $fs/etc/pam.d/ |
al@19850 | 71 DEPENDS="zlib" |
al@19850 | 72 CONFIG_FILES="/etc/dropbear" |
al@19850 | 73 PROVIDE="ssh" |
al@19850 | 74 TAGS="ssh" |
al@19850 | 75 ;; |
al@19850 | 76 dropbear-pam) |
al@19851 | 77 copy dropbear-pam pam.d/ |
al@19850 | 78 mv $fs/usr/sbin/dropbear-pam $fs/usr/sbin/dropbear |
al@19850 | 79 DEPENDS="dropbear pam" |
al@19850 | 80 CAT="security|with PAM support" |
al@19850 | 81 PROVIDE="dropbear:pam ssh:pam" |
al@19850 | 82 TAGS="ssh" |
al@19850 | 83 ;; |
al@19850 | 84 esac |
pankso@126 | 85 } |
pankso@126 | 86 |
pankso@126 | 87 # Post message when installing. |
al@19850 | 88 post_install_dropbear() { |
al@19850 | 89 while read dropbear openssh; do |
pascal@18730 | 90 [ -s "$1/$openssh" ] || continue |
pascal@18730 | 91 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear |
pascal@18730 | 92 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint |
pascal@7304 | 93 done <<EOT |
pascal@7304 | 94 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key |
pascal@7305 | 95 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key |
pascal@19889 | 96 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key |
pascal@7304 | 97 EOT |
mojo@19390 | 98 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT |
pascal@17046 | 99 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner |
pascal@17046 | 100 EOT |
al@21020 | 101 [ -n "$quiet" ] || cat <<EOT |
al@19850 | 102 |
al@19850 | 103 .-------------------------------------------------. |
al@19850 | 104 | To start dropbear server you can run: | |
al@21020 | 105 | /etc/init.d/dropbear start | |
al@19850 | 106 | | |
al@21020 | 107 | or add dropbear to RUN_DAEMONS in /etc/rcS.conf | |
al@19850 | 108 '-------------------------------------------------' |
al@19850 | 109 EOT |
pankso@126 | 110 } |
pascal@17046 | 111 |
al@19850 | 112 post_remove_dropbear() { |
al@19850 | 113 grep -q dropbear "$1/etc/inetd.conf" && |
al@19850 | 114 sed -i '/dropbear/d' "$1/etc/inetd.conf" |
pascal@17046 | 115 } |
al@19850 | 116 |
al@19850 | 117 post_remove_dropbear_pam() { |
al@19850 | 118 tazpkg -gi dropbear --forced |
al@19850 | 119 } |