wok annotate mosh/receipt @ rev 21845

updated rox packages (2.8 -> 2.11)
author Hans-G?nter Theisgen
date Sun Sep 15 11:06:31 2019 +0100 (2019-09-15)
parents daaaf5face8a
children 5b0e64c0628a
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
pascal@21759 15 DEPENDS="gcc-lib-base libcrypto libssl ncursesw perl protobuf ssh zlib \
pascal@21759 16 gcc83-lib-base"
pascal@21473 17 BUILD_DEPENDS="libcrypto-dev ncursesw-dev openssl-dev pkg-config protobuf-dev \
pascal@21759 18 zlib-dev automake gcc83"
pascal@15179 19
pascal@15179 20 # Rules to configure and make the package.
pascal@15179 21 compile_rules()
pascal@15179 22 {
pascal@21519 23 # Add dropbear support
pascal@21519 24 patch -p0 <<EOT || return 1
pascal@21519 25 --- scripts/mosh.pl
pascal@21519 26 +++ scripts/mosh.pl
pascal@21519 27 @@ -397,2 +397,10 @@
pascal@21519 28 my \$quoted_proxy_command = shell_quote( \$0, "--family=\$family" );
pascal@21519 29 + my \$ssh = join ' ', @ssh;
pascal@21519 30 + if (\`\$ssh -V 2>&1\` =~ m{Dropbear}) {
pascal@21519 31 + my \$host = \$userhost; \$host = \$1 if (\$userhost =~ m{@(.*)});
pascal@21519 32 + my \$port = 22; \$port = \$1 if (\$ssh =~ m{-p *(\d+)});
pascal@21519 33 + exec "\$ssh " . shell_quote( '-J',
pascal@21519 34 + "\$quoted_proxy_command --fake-proxy -- \$host \$port",
pascal@21519 35 + '-t', \$userhost, "\$server " . shell_quote( @server ) );
pascal@21519 36 + }
pascal@21519 37 push @sshopts, ( '-S', 'none', '-o', "ProxyCommand=\$quoted_proxy_command --fake-proxy -- %h %p" );
pascal@21519 38 EOT
pascal@21473 39 ./autogen.sh
Hans-G?nter@21470 40 ./configure \
pascal@21759 41 CC=gcc-83 \
pascal@21759 42 CXX=g++-83 \
Hans-G?nter@21470 43 --prefix=/usr \
Hans-G?nter@21470 44 --sysconfdir=/etc \
pascal@15179 45 --enable-compile-warnings=error &&
Hans-G?nter@21470 46 make -j 1 &&
pascal@15179 47 make DESTDIR=$DESTDIR install
pascal@15179 48 }
pascal@15179 49
pascal@15179 50 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@15179 51 genpkg_rules()
pascal@15179 52 {
pascal@15179 53 mkdir -p $fs/usr
pascal@15179 54 cp -a $install/usr/bin $fs/usr
pascal@15179 55 }
pascal@18178 56
pascal@18178 57 post_install()
pascal@18178 58 {
pascal@19982 59 [ -d "$1/usr/lib/locale/$LC_ALL" ] ||
pascal@19982 60 chroot "$1/" localedef -i ${LC_ALL%.*} -c -f UTF-8 /usr/lib/locale/$LC_ALL
pascal@18730 61 if ! grep ^DROPBEAR_OPTIONS "$1/etc/daemons.conf" | grep -q -- -a; then
pascal@18178 62 cat <<EOT
pascal@18178 63 The mosh server needs dropbear to allow connections to forwarded ports
pascal@18178 64 from any host. Nothing to do if you are using OpenSSH or you plan
pascal@18178 65 to use the mosh client only.
pascal@18178 66 EOT
pascal@18178 67 echo -n "Add -a for DROPBEAR_OPTIONS in /etc/daemons.conf now ?"
pascal@18178 68 read -t 30 answer
pascal@20892 69 [ "$answer" = "y" ] &&
pascal@18730 70 sed -i 's/^DROPBEAR_OPTIONS="/&-a /' "$1/etc/daemons.conf" &&
pascal@18178 71 [ -z "$1" ] && /etc/init.d/dropbear restart
pascal@18178 72 fi
pascal@18469 73 true
pascal@18178 74 }