wok-current view mosh/receipt @ rev 21488
mosh: update patch
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed May 01 15:49:51 2019 +0200 (2019-05-01) |
parents | 2d7b87d501a3 |
children | daaaf5face8a |
line source
1 # SliTaz package receipt.
3 PACKAGE="mosh"
4 VERSION="1.3.2"
5 CATEGORY="security"
6 TAGS="ssh"
7 SHORT_DESC="An Openbsd Secure Shell replacement."
8 MAINTAINER="pascal.bellard@slitaz.org"
9 LICENSE="GPL3"
10 WEB_SITE="https://mosh.org/"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="${WEB_SITE}$TARBALL"
15 DEPENDS="gcc-lib-base libcrypto libssl ncursesw perl protobuf ssh zlib"
16 BUILD_DEPENDS="libcrypto-dev ncursesw-dev openssl-dev pkg-config protobuf-dev \
17 zlib-dev automake"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 ./autogen.sh
23 ./configure \
24 --prefix=/usr \
25 --sysconfdir=/etc \
26 --enable-compile-warnings=error &&
27 make -j 1 &&
28 make DESTDIR=$DESTDIR install
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr
35 cp -a $install/usr/bin $fs/usr
37 cd $fs/usr/bin
38 patch -p0 <<EOT
39 --- mosh
40 +++ mosh
41 @@ -395,6 +395,14 @@
42 # proxy to break mysteriously.
43 $ENV{ 'SHELL' } = '/bin/sh';
44 my $quoted_proxy_command = shell_quote( $0, "--family=$family" );
45 + my $ssh = 'ssh';
46 + if (`$ssh -V 2>&1` =~ m{Dropbear}) {
47 + my $host = $userhost; $host = $1 if ($userhost =~ m{@(.*)});
48 + my $port = 22; $port = $1 if ($ssh =~ m{-p *(\d+)});
49 + my $quoted_self = shell_quote( $0, "--family=$family" );
50 + exec "$ssh " . shell_quote( '-J', "$quoted_self --fake-proxy -- $host $port",
51 + '-t', $userhost, "$server " . shell_quote( @server ) );
52 + }
53 push @sshopts, ( '-S', 'none', '-o', "ProxyCommand=$quoted_proxy_command --fake-proxy -- %h %p" );
54 }
55 my @exec_argv = ( @ssh, @sshopts, $userhost, '--', $ssh_connection . "$server " . shell_quote( @server ) );
56 EOT
57 cd - > /dev/null
58 }
60 post_install()
61 {
62 [ -d "$1/usr/lib/locale/$LC_ALL" ] ||
63 chroot "$1/" localedef -i ${LC_ALL%.*} -c -f UTF-8 /usr/lib/locale/$LC_ALL
64 if ! grep ^DROPBEAR_OPTIONS "$1/etc/daemons.conf" | grep -q -- -a; then
65 cat <<EOT
66 The mosh server needs dropbear to allow connections to forwarded ports
67 from any host. Nothing to do if you are using OpenSSH or you plan
68 to use the mosh client only.
69 EOT
70 echo -n "Add -a for DROPBEAR_OPTIONS in /etc/daemons.conf now ?"
71 read -t 30 answer
72 [ "$answer" = "y" ] &&
73 sed -i 's/^DROPBEAR_OPTIONS="/&-a /' "$1/etc/daemons.conf" &&
74 [ -z "$1" ] && /etc/init.d/dropbear restart
75 fi
76 true
77 }