wok annotate mosh/receipt @ rev 18178

mosh: add dropbear support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 04 11:23:16 2015 +0200 (2015-07-04)
parents 7355f9472def
children a5a576b1aaac
rev   line source
pascal@15179 1 # SliTaz package receipt.
pascal@15179 2
pascal@15179 3 PACKAGE="mosh"
pascal@15179 4 VERSION="1.2.4"
pascal@15179 5 CATEGORY="security"
pascal@15179 6 SHORT_DESC="A Openbsd Secure Shell remplacement."
pascal@15179 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@15179 8 LICENSE="GPL3"
pascal@15179 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@15179 10 WEB_SITE="http://mosh.mit.edu/"
pascal@15179 11 WGET_URL="${WEB_SITE}$TARBALL"
pascal@15179 12 TAGS="ssh"
pascal@15179 13
pascal@18174 14 DEPENDS="gcc-lib-base perl protobuf libssl libcrypto zlib ncursesw ssh"
pascal@15179 15 BUILD_DEPENDS="pkg-config protobuf-dev openssl-dev libcrypto-dev zlib-dev ncursesw-dev"
pascal@15179 16
pascal@15179 17 # Rules to configure and make the package.
pascal@15179 18 compile_rules()
pascal@15179 19 {
pascal@18178 20 sed -i '/.*quoted_self = shell_quote.*/r/dev/stdin' scripts/mosh <<EOT
pascal@18178 21 if (\`\$ssh -V 2>&1\` =~ m{Dropbear}) {
pascal@18178 22 my \$host = \$userhost; \$host = \$1 if (\$userhost =~ m{@(.*)});
pascal@18178 23 my \$port = 22; \$port = \$1 if (\$ssh =~ m{-p *(\d+)});
pascal@18178 24 exec "\$ssh " . shell_quote( '-J', "\$quoted_self --fake-proxy -- \$host \$port", '-t', \$userhost, "\$server " . shell_quote( @server ) );
pascal@18178 25 }
pascal@18178 26 EOT
pascal@15179 27 ./configure --prefix=/usr --sysconfdir=/etc \
pascal@15179 28 --enable-compile-warnings=error &&
pascal@15179 29 make &&
pascal@15179 30 make DESTDIR=$DESTDIR install
pascal@15179 31 }
pascal@15179 32
pascal@15179 33 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@15179 34 genpkg_rules()
pascal@15179 35 {
pascal@15179 36 mkdir -p $fs/usr
pascal@15179 37 cp -a $install/usr/bin $fs/usr
pascal@15179 38 }
pascal@18178 39
pascal@18178 40 post_install()
pascal@18178 41 {
pascal@18178 42 if ! grep ^DROPBEAR_OPTIONS $1/etc/daemons.conf | grep -q -- -a; then
pascal@18178 43 cat <<EOT
pascal@18178 44 The mosh server needs dropbear to allow connections to forwarded ports
pascal@18178 45 from any host. Nothing to do if you are using OpenSSH or you plan
pascal@18178 46 to use the mosh client only.
pascal@18178 47 EOT
pascal@18178 48 echo -n "Add -a for DROPBEAR_OPTIONS in /etc/daemons.conf now ?"
pascal@18178 49 read -t 30 answer
pascal@18178 50 [ "$answer" == "y" ] &&
pascal@18178 51 sed -i 's/^DROPBEAR_OPTIONS="/&-a /' $1/etc/daemons.conf &&
pascal@18178 52 [ -z "$1" ] && /etc/init.d/dropbear restart
pascal@18178 53
pascal@18178 54 fi
pascal@18178 55 }