wok annotate mosh/receipt @ rev 20029

Up mosh (1.3.2)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Aug 20 09:44:00 2017 +0200 (2017-08-20)
parents 2c96382fb33e
children cbea337525dd
rev   line source
pascal@15179 1 # SliTaz package receipt.
pascal@15179 2
pascal@15179 3 PACKAGE="mosh"
pascal@20029 4 VERSION="1.3.2"
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@20029 11 WGET_URL="https://github.com/mobile-shell/mosh/archive/mosh-$VERSION.tar.gz"
pascal@15179 12 TAGS="ssh"
pascal@15179 13
pascal@19982 14 DEPENDS="gcc-lib-base glibc-base perl protobuf libssl libcrypto libtinfo \
pascal@19982 15 zlib ncursesw ssh"
pascal@19982 16 BUILD_DEPENDS="pkg-config protobuf-dev openssl-dev libcrypto-dev zlib-dev \
pascal@20029 17 ncursesw-dev autoconf automake libtool"
pascal@15179 18
pascal@15179 19 # Rules to configure and make the package.
pascal@15179 20 compile_rules()
pascal@15179 21 {
pascal@20029 22 ./autogen.sh
pascal@15179 23 ./configure --prefix=/usr --sysconfdir=/etc \
pascal@15179 24 --enable-compile-warnings=error &&
pascal@15179 25 make &&
pascal@15179 26 make DESTDIR=$DESTDIR install
pascal@15179 27 }
pascal@15179 28
pascal@15179 29 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@15179 30 genpkg_rules()
pascal@15179 31 {
pascal@15179 32 mkdir -p $fs/usr
pascal@15179 33 cp -a $install/usr/bin $fs/usr
pascal@18359 34 sed -i '/.*quoted_self = shell_quote.*/r/dev/stdin' $fs/usr/bin/mosh <<EOT
pascal@18359 35 if (\`\$ssh -V 2>&1\` =~ m{Dropbear}) {
pascal@18359 36 my \$host = \$userhost; \$host = \$1 if (\$userhost =~ m{@(.*)});
pascal@18359 37 my \$port = 22; \$port = \$1 if (\$ssh =~ m{-p *(\d+)});
pascal@18359 38 exec "\$ssh " . shell_quote( '-J', "\$quoted_self --fake-proxy -- \$host \$port", '-t', \$userhost, "\$server " . shell_quote( @server ) );
pascal@18359 39 }
pascal@18359 40 EOT
pascal@15179 41 }
pascal@18178 42
pascal@18178 43 post_install()
pascal@18178 44 {
pascal@19982 45 [ -d "$1/usr/lib/locale/$LC_ALL" ] ||
pascal@19982 46 chroot "$1/" localedef -i ${LC_ALL%.*} -c -f UTF-8 /usr/lib/locale/$LC_ALL
pascal@18730 47 if ! grep ^DROPBEAR_OPTIONS "$1/etc/daemons.conf" | grep -q -- -a; then
pascal@18178 48 cat <<EOT
pascal@18178 49 The mosh server needs dropbear to allow connections to forwarded ports
pascal@18178 50 from any host. Nothing to do if you are using OpenSSH or you plan
pascal@18178 51 to use the mosh client only.
pascal@18178 52 EOT
pascal@18178 53 echo -n "Add -a for DROPBEAR_OPTIONS in /etc/daemons.conf now ?"
pascal@18178 54 read -t 30 answer
pascal@18178 55 [ "$answer" == "y" ] &&
pascal@18730 56 sed -i 's/^DROPBEAR_OPTIONS="/&-a /' "$1/etc/daemons.conf" &&
pascal@18178 57 [ -z "$1" ] && /etc/init.d/dropbear restart
pascal@18178 58 fi
pascal@18469 59 true
pascal@18178 60 }