wok-current view mosh/receipt @ rev 24011
mosh: create /usr/share/terminfo/x/xterm-256color link
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 05 17:16:12 2021 +0000 (2021-02-05) |
parents | 8710e9c81dd7 |
children | ad8b9ff412d2 |
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 gcc83-lib-base"
17 BUILD_DEPENDS="libcrypto-dev ncursesw-dev openssl-dev pkg-config protobuf-dev \
18 zlib-dev automake gcc83"
20 # Rules to configure and make the package.
21 compile_rules()
22 {
23 # Add dropbear support
24 patch -p0 <<EOT || return 1
25 --- scripts/mosh.pl
26 +++ scripts/mosh.pl
27 @@ -397,2 +397,10 @@
28 my \$quoted_proxy_command = shell_quote( \$0, "--family=\$family" );
29 + my \$ssh = join ' ', @ssh;
30 + if (\`\$ssh -V 2>&1\` =~ m{Dropbear}) {
31 + my \$host = \$userhost; \$host = \$1 if (\$userhost =~ m{@(.*)});
32 + my \$port = 22; \$port = \$1 if (\$ssh =~ m{-p *(\d+)});
33 + exec "\$ssh " . shell_quote( '-J',
34 + "\$quoted_proxy_command --fake-proxy -- \$host \$port",
35 + '-t', \$userhost, "\$server " . shell_quote( @server ) );
36 + }
37 push @sshopts, ( '-S', 'none', '-o', "ProxyCommand=\$quoted_proxy_command --fake-proxy -- %h %p" );
38 EOT
39 ./autogen.sh
40 ./configure \
41 CC=gcc-83 \
42 CXX=g++-83 \
43 --prefix=/usr \
44 --sysconfdir=/etc \
45 --enable-compile-warnings=error &&
46 make -j 1 &&
47 make DESTDIR=$DESTDIR install
48 }
50 # Rules to gen a SliTaz package suitable for Tazpkg.
51 genpkg_rules()
52 {
53 mkdir -p $fs/usr
54 cp -a $install/usr/bin $fs/usr
55 }
57 post_install()
58 {
59 [ -d "$1/usr/lib/locale/$LC_ALL" ] ||
60 chroot "$1/" localedef -i ${LC_ALL%.*} -c -f UTF-8 /usr/lib/locale/$LC_ALL
61 if ! grep ^DROPBEAR_OPTIONS "$1/etc/daemons.conf" | grep -q -- -a; then
62 cat <<EOT
63 The mosh server needs dropbear to allow connections to forwarded ports
64 from any host. Nothing to do if you are using OpenSSH or you plan
65 to use the mosh client only.
66 EOT
67 echo -n "Add -a for DROPBEAR_OPTIONS in /etc/daemons.conf now ?"
68 read -t 30 answer
69 [ "$answer" = "y" ] &&
70 sed -i 's/^DROPBEAR_OPTIONS="/&-a /' "$1/etc/daemons.conf" &&
71 [ -z "$1" ] && /etc/init.d/dropbear restart
72 fi
73 [ ! -e $1/usr/share/terminfo/x/xterm-256color ] &&
74 [ -e $1/usr/share/terminfo/x/xterm-color ] &&
75 ln -s xterm-color $1/usr/share/terminfo/x/xterm-256color
76 true
77 }