wok annotate mosh/receipt @ rev 24985

Add python-future
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue May 10 07:46:58 2022 +0000 (2022-05-10)
parents 5b0e64c0628a
children 82a123e54615
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@24433 20 # What is the latest version available today?
pascal@24433 21 current_version()
pascal@24433 22 {
pascal@24433 23 wget -O - ${WGET_URL%/*} 2>/dev/null | \
pascal@24433 24 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
pascal@24433 25 }
pascal@24433 26
pascal@15179 27 # Rules to configure and make the package.
pascal@15179 28 compile_rules()
pascal@15179 29 {
pascal@21519 30 # Add dropbear support
pascal@21519 31 patch -p0 <<EOT || return 1
pascal@21519 32 --- scripts/mosh.pl
pascal@21519 33 +++ scripts/mosh.pl
pascal@21519 34 @@ -397,2 +397,10 @@
pascal@21519 35 my \$quoted_proxy_command = shell_quote( \$0, "--family=\$family" );
pascal@21519 36 + my \$ssh = join ' ', @ssh;
pascal@21519 37 + if (\`\$ssh -V 2>&1\` =~ m{Dropbear}) {
pascal@21519 38 + my \$host = \$userhost; \$host = \$1 if (\$userhost =~ m{@(.*)});
pascal@21519 39 + my \$port = 22; \$port = \$1 if (\$ssh =~ m{-p *(\d+)});
pascal@21519 40 + exec "\$ssh " . shell_quote( '-J',
pascal@21519 41 + "\$quoted_proxy_command --fake-proxy -- \$host \$port",
pascal@21519 42 + '-t', \$userhost, "\$server " . shell_quote( @server ) );
pascal@21519 43 + }
pascal@21519 44 push @sshopts, ( '-S', 'none', '-o', "ProxyCommand=\$quoted_proxy_command --fake-proxy -- %h %p" );
pascal@21519 45 EOT
pascal@21473 46 ./autogen.sh
Hans-G?nter@21470 47 ./configure \
pascal@21759 48 CC=gcc-83 \
pascal@21759 49 CXX=g++-83 \
Hans-G?nter@21470 50 --prefix=/usr \
Hans-G?nter@21470 51 --sysconfdir=/etc \
pascal@15179 52 --enable-compile-warnings=error &&
Hans-G?nter@21470 53 make -j 1 &&
pascal@15179 54 make DESTDIR=$DESTDIR install
pascal@15179 55 }
pascal@15179 56
pascal@15179 57 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@15179 58 genpkg_rules()
pascal@15179 59 {
pascal@15179 60 mkdir -p $fs/usr
pascal@15179 61 cp -a $install/usr/bin $fs/usr
pascal@15179 62 }
pascal@18178 63
pascal@18178 64 post_install()
pascal@18178 65 {
pascal@19982 66 [ -d "$1/usr/lib/locale/$LC_ALL" ] ||
pascal@19982 67 chroot "$1/" localedef -i ${LC_ALL%.*} -c -f UTF-8 /usr/lib/locale/$LC_ALL
pascal@18730 68 if ! grep ^DROPBEAR_OPTIONS "$1/etc/daemons.conf" | grep -q -- -a; then
pascal@18178 69 cat <<EOT
pascal@18178 70 The mosh server needs dropbear to allow connections to forwarded ports
pascal@18178 71 from any host. Nothing to do if you are using OpenSSH or you plan
pascal@18178 72 to use the mosh client only.
pascal@18178 73 EOT
pascal@18178 74 echo -n "Add -a for DROPBEAR_OPTIONS in /etc/daemons.conf now ?"
pascal@18178 75 read -t 30 answer
pascal@20892 76 [ "$answer" = "y" ] &&
pascal@18730 77 sed -i 's/^DROPBEAR_OPTIONS="/&-a /' "$1/etc/daemons.conf" &&
pascal@18178 78 [ -z "$1" ] && /etc/init.d/dropbear restart
pascal@18178 79 fi
pascal@24011 80 [ ! -e $1/usr/share/terminfo/x/xterm-256color ] &&
pascal@24011 81 [ -e $1/usr/share/terminfo/x/xterm-color ] &&
pascal@24011 82 ln -s xterm-color $1/usr/share/terminfo/x/xterm-256color
pascal@18469 83 true
pascal@18178 84 }