wok-next annotate dropbear/receipt @ rev 19634

Up Xorg (first chunk)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Feb 10 01:19:30 2017 +0200 (2017-02-10)
parents 7c66c894e9ba
children 2e9df1b30cc2
rev   line source
pankso@126 1 # SliTaz package receipt.
pankso@126 2
pankso@126 3 PACKAGE="dropbear"
pascal@19347 4 VERSION="2016.74"
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"
pascal@19305 10 CONFIG_FILES="/etc/dropbear"
pankso@12839 11 SUGGESTED="sftp-server"
pascal@4904 12 PROVIDE="ssh"
jozee@4934 13 TAGS="ssh"
pankso@12839 14 HOST_ARCH="i486 arm"
pankso@126 15
al@19601 16 TARBALL="$PACKAGE-$VERSION.tar.bz2"
al@19601 17 WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL"
al@19601 18
pankso@12689 19 DEPENDS="zlib"
pankso@12689 20 BUILD_DEPENDS="zlib-dev pam pam-dev"
al@19601 21 SPLIT="dropbear-pam"
pankso@12689 22
pankso@12839 23 # Handle multiarch compilation.
pankso@12834 24 case "$ARCH" in
pankso@12839 25 arm)
pankso@12839 26 BUILD_DEPENDS=""
pankso@12839 27 CROSS_ARGS="--disable-zlib"
pankso@12839 28 CROSS_BUGS="Fails to find zlib: -lz... no" ;;
pankso@12834 29 esac
pankso@12834 30
pankso@126 31 # Rules to configure and make the package.
pankso@126 32 compile_rules()
pankso@126 33 {
pankso@126 34 local i
pankso@126 35 local DROPBEARS
pankso@126 36 DROPBEARS="dropbearkey dropbearconvert dbclient scp"
pascal@9432 37 sed -i -e 's|/usr/.*/xauth|/usr/bin/xauth|' \
pascal@9432 38 -e 's|/usr/.*/sftp-server|/usr/sbin/sftp-server|' \
al@18968 39 -e 's|ENABLE_SVR_PAM_AUTH|ENABLE_SVR_PASSWORD_AUTH|' \
pascal@3628 40 options.h
pankso@12839 41 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS &&
pankso@12834 42 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
slaxemulator@11100 43 install -d -m 755 $DESTDIR/usr/sbin &&
slaxemulator@11100 44 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear &&
pankso@12834 45 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1
pankso@12834 46
pankso@12834 47 # No pam support in ARM
pankso@12834 48 case "$ARCH" in
pankso@12834 49 arm) echo "Skipping Dropbear PAM..." ;;
pankso@12839 50 i?86)
pankso@12834 51 sed -i 's|ENABLE_SVR_PASSWORD_AUTH|ENABLE_SVR_PAM_AUTH|' \
pankso@12834 52 options.h
pankso@12834 53 ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS &&
pankso@12834 54 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
pankso@12834 55 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear-pam &&
pankso@12834 56 chown 0.0 $DESTDIR/usr/sbin/dropbear-pam || exit 1 ;;
pankso@12834 57 esac
pankso@12834 58
slaxemulator@11100 59 install -d -m 755 $DESTDIR/usr/bin &&
pascal@1440 60 for i in $DROPBEARS ssh; do
pankso@12834 61 ln -s ../sbin/dropbear $DESTDIR/usr/bin/$i || exit 1
pankso@126 62 done
pascal@19369 63 install -d -m 755 $DESTDIR/usr/share/man/man1 &&
pascal@19371 64 install -m 644 $src/*.1 $DESTDIR/usr/share/man/man1 &&
pascal@19369 65 install -d -m 755 $DESTDIR/usr/share/man/man8 &&
pascal@19371 66 install -m 644 $src/*.8 $DESTDIR/usr/share/man/man8 &&
pascal@19369 67 install -d -m 755 $DESTDIR/usr/share/doc &&
pascal@19371 68 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc
pankso@126 69 }
pankso@126 70
pankso@126 71 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@126 72 genpkg_rules()
pankso@126 73 {
pankso@126 74 mkdir -p $fs/usr
pankso@12689 75 cp -a $install/usr/bin $fs/usr
pankso@12689 76 cp -a $install/usr/sbin $fs/usr
pascal@11595 77 rm -f $fs/usr/sbin/dropbear-pam
pankso@126 78 # Config file and init script.
pankso@126 79 mkdir -p $fs/etc
slaxemulator@11100 80 cp -a $stuff/dropbear $fs/etc
slaxemulator@11100 81 cp -a $stuff/init.d $fs/etc
devl547@18881 82 ln -s daemon $fs/etc/init.d/sshd
slaxemulator@11100 83 cp -a $stuff/sshx $fs/usr/bin
pascal@14027 84 ln -s sshx $fs/usr/bin/pppssh
pascal@18330 85 ln -s sshx $fs/usr/bin/sshfbvnc
pankso@12834 86 touch $fs/etc/dropbear/dropbear_dss_host_key \
al@18599 87 $fs/etc/dropbear/dropbear_rsa_host_key \
pankso@12689 88
erjo@1074 89 # Fix dropbear initscript perms
pankso@1091 90 chown -R root.root $fs
pankso@126 91 }
pankso@126 92
pankso@126 93 # Post message when installing.
pankso@126 94 post_install()
pankso@126 95 {
pascal@18730 96 while read dropbear openssh ; do
pascal@18730 97 [ -s "$1/$openssh" ] || continue
pascal@18730 98 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear
pascal@18730 99 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
pascal@7304 100 done <<EOT
pascal@7304 101 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
pascal@7305 102 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
pascal@7304 103 EOT
mojo@19390 104 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
pascal@17046 105 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner
pascal@17046 106 EOT
al@18968 107 [ -n "$quiet" ] && return
pankso@126 108 echo -e "\nTo starts $PACKAGE server you can run :\n"
pankso@126 109 echo "/etc/init.d/$PACKAGE start"
pankso@126 110 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
pankso@126 111 }
pascal@17046 112
pascal@17046 113 post_remove()
pascal@17046 114 {
pascal@18730 115 grep -q dropbear "$1/etc/inetd.conf" && sed -i '/dropbear/d' "$1/etc/inetd.conf"
pascal@17046 116 }