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