description="Mobile shell, surviving disconnects with local echo and line editing."
url="http://mosh.mit.edu/"

contributors="Alienus,Fanch,Greg,Tnut"
packager="spiky <spiky@nutyx.org>"

makedepends=(pkgconf protobuf ncurses zlib openssh openssl perl-io-tty libutempter)

name=mosh
version=1.4.0
release=2

source=(https://github.com/mobile-shell/mosh/archive/refs/tags/$name-$version.tar.gz)

prepare() {
  cd $name-$name-$version
  # protobuf 23 requires C++17
  sed -e 's|\[11\]|\[17\]|' -i configure.ac
}

build() {
  
  cd $name-$name-$version

  ./autogen.sh
  ./configure --prefix=/usr \
              --sysconfdir=/etc/mosh

  make
  make DESTDIR=$PKG install
  install -Dm644 "conf/bash-completion/completions/$name" \
    "$PKG/usr/share/bash-completion/completions/$name"
}
