wok-6.x annotate mosh/receipt @ rev 21470

updated mosh (1.2.5 -> 1.3.2)
author Hans-G?nter Theisgen
date Tue Apr 30 17:32:49 2019 +0100 (2019-04-30)
parents 02c70d036ea0
children 2d7b87d501a3
rev   line source
pascal@15179 1 # SliTaz package receipt.
pascal@15179 2
pascal@15179 3 PACKAGE="mosh"
Hans-G?nter@21470 4 VERSION="1.3.2"
pascal@15179 5 CATEGORY="security"
Hans-G?nter@21470 6 TAGS="ssh"
Hans-G?nter@21470 7 SHORT_DESC="An Openbsd Secure Shell replacement."
pascal@15179 8 MAINTAINER="pascal.bellard@slitaz.org"
pascal@15179 9 LICENSE="GPL3"
Hans-G?nter@21470 10 WEB_SITE="https://mosh.org/"
Hans-G?nter@21470 11
pascal@15179 12 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@20031 13 WGET_URL="${WEB_SITE}$TARBALL"
pascal@15179 14
Hans-G?nter@21470 15 DEPENDS="gcc-lib-base libcrypto libssl ncursesw perl protobuf ssh zlib"
Hans-G?nter@21470 16 BUILD_DEPENDS="libcrypto-dev ncursesw-dev openssl-dev pkg-config protobuf-dev zlib-dev"
pascal@15179 17
pascal@15179 18 # Rules to configure and make the package.
pascal@15179 19 compile_rules()
pascal@15179 20 {
Hans-G?nter@21470 21 ./configure \
Hans-G?nter@21470 22 --prefix=/usr \
Hans-G?nter@21470 23 --sysconfdir=/etc \
pascal@15179 24 --enable-compile-warnings=error &&
Hans-G?nter@21470 25 make -j 1 &&
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
Hans-G?nter@21470 34
pascal@18359 35 sed -i '/.*quoted_self = shell_quote.*/r/dev/stdin' $fs/usr/bin/mosh <<EOT
pascal@18359 36 if (\`\$ssh -V 2>&1\` =~ m{Dropbear}) {
pascal@18359 37 my \$host = \$userhost; \$host = \$1 if (\$userhost =~ m{@(.*)});
pascal@18359 38 my \$port = 22; \$port = \$1 if (\$ssh =~ m{-p *(\d+)});
pascal@18359 39 exec "\$ssh " . shell_quote( '-J', "\$quoted_self --fake-proxy -- \$host \$port", '-t', \$userhost, "\$server " . shell_quote( @server ) );
pascal@18359 40 }
pascal@18359 41 EOT
pascal@15179 42 }
pascal@18178 43
pascal@18178 44 post_install()
pascal@18178 45 {
pascal@19982 46 [ -d "$1/usr/lib/locale/$LC_ALL" ] ||
pascal@19982 47 chroot "$1/" localedef -i ${LC_ALL%.*} -c -f UTF-8 /usr/lib/locale/$LC_ALL
pascal@18730 48 if ! grep ^DROPBEAR_OPTIONS "$1/etc/daemons.conf" | grep -q -- -a; then
pascal@18178 49 cat <<EOT
pascal@18178 50 The mosh server needs dropbear to allow connections to forwarded ports
pascal@18178 51 from any host. Nothing to do if you are using OpenSSH or you plan
pascal@18178 52 to use the mosh client only.
pascal@18178 53 EOT
pascal@18178 54 echo -n "Add -a for DROPBEAR_OPTIONS in /etc/daemons.conf now ?"
pascal@18178 55 read -t 30 answer
pascal@20892 56 [ "$answer" = "y" ] &&
pascal@18730 57 sed -i 's/^DROPBEAR_OPTIONS="/&-a /' "$1/etc/daemons.conf" &&
pascal@18178 58 [ -z "$1" ] && /etc/init.d/dropbear restart
pascal@18178 59 fi
pascal@18469 60 true
pascal@18178 61 }