# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Christian Neukirchen <chneukirchen@gmail.com>
# Contributor: Thomas Weißschuh <thomas_weissschuh@lavabit.com>
pkgname=mosh
pkgver=1.4.0
pkgrel=8
pkgdesc='Mobile shell, surviving disconnects with local echo and line editing'
arch=(x86_64 'armv7h')
url='https://mosh.org/'
license=(GPL3)
depends=(libutempter openssh openssl perl-io-tty protobuf python-absl)
makedepends=(git)
options=(!emptydirs)
source=("git+https://github.com/mobile-shell/mosh#tag=$pkgname-$pkgver")
b2sums=('SKIP')
prepare() {
cd $pkgname
git revert -n 195ef46561b5893497c39445442fa6b80d164dfd
# protobuf 23 requires C++17
sed -e 's|\[11\]|\[17\]|' -i configure.ac
}
build() {
cd $pkgname
./autogen.sh
./configure --enable-ufw --prefix=/usr --sysconfdir=/etc
make
}
package() {
DESTDIR="$pkgdir" make -C $pkgname install
install -Dm644 "$pkgname/conf/bash-completion/completions/$pkgname" \
"$pkgdir/usr/share/bash-completion/completions/$pkgname"
}