wok annotate mosh/receipt @ rev 21473

updated mosh (1.2.5 -> 1.3.2) again
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 30 21:45:29 2019 +0200 (2019-04-30)
parents 68d83aa227f4
children adf9182b6536
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"
pascal@21473 16 BUILD_DEPENDS="libcrypto-dev ncursesw-dev openssl-dev pkg-config protobuf-dev \
pascal@21473 17 zlib-dev automake"
pascal@15179 18
pascal@15179 19 # Rules to configure and make the package.
pascal@15179 20 compile_rules()
pascal@15179 21 {
pascal@21473 22 ./autogen.sh
Hans-G?nter@21470 23 ./configure \
Hans-G?nter@21470 24 --prefix=/usr \
Hans-G?nter@21470 25 --sysconfdir=/etc \
pascal@15179 26 --enable-compile-warnings=error &&
Hans-G?nter@21470 27 make -j 1 &&
pascal@15179 28 make DESTDIR=$DESTDIR install
pascal@15179 29 }
pascal@15179 30
pascal@15179 31 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@15179 32 genpkg_rules()
pascal@15179 33 {
pascal@15179 34 mkdir -p $fs/usr
pascal@15179 35 cp -a $install/usr/bin $fs/usr
Hans-G?nter@21470 36
pascal@18359 37 sed -i '/.*quoted_self = shell_quote.*/r/dev/stdin' $fs/usr/bin/mosh <<EOT
pascal@18359 38 if (\`\$ssh -V 2>&1\` =~ m{Dropbear}) {
pascal@18359 39 my \$host = \$userhost; \$host = \$1 if (\$userhost =~ m{@(.*)});
pascal@18359 40 my \$port = 22; \$port = \$1 if (\$ssh =~ m{-p *(\d+)});
pascal@18359 41 exec "\$ssh " . shell_quote( '-J', "\$quoted_self --fake-proxy -- \$host \$port", '-t', \$userhost, "\$server " . shell_quote( @server ) );
pascal@18359 42 }
pascal@18359 43 EOT
pascal@15179 44 }
pascal@18178 45
pascal@18178 46 post_install()
pascal@18178 47 {
pascal@19982 48 [ -d "$1/usr/lib/locale/$LC_ALL" ] ||
pascal@19982 49 chroot "$1/" localedef -i ${LC_ALL%.*} -c -f UTF-8 /usr/lib/locale/$LC_ALL
pascal@18730 50 if ! grep ^DROPBEAR_OPTIONS "$1/etc/daemons.conf" | grep -q -- -a; then
pascal@18178 51 cat <<EOT
pascal@18178 52 The mosh server needs dropbear to allow connections to forwarded ports
pascal@18178 53 from any host. Nothing to do if you are using OpenSSH or you plan
pascal@18178 54 to use the mosh client only.
pascal@18178 55 EOT
pascal@18178 56 echo -n "Add -a for DROPBEAR_OPTIONS in /etc/daemons.conf now ?"
pascal@18178 57 read -t 30 answer
pascal@20892 58 [ "$answer" = "y" ] &&
pascal@18730 59 sed -i 's/^DROPBEAR_OPTIONS="/&-a /' "$1/etc/daemons.conf" &&
pascal@18178 60 [ -z "$1" ] && /etc/init.d/dropbear restart
pascal@18178 61 fi
pascal@18469 62 true
pascal@18178 63 }