aboutsummaryrefslogtreecommitdiffstats
path: root/main/mosh/APKBUILD
blob: 43160db982b2ef7eef6c3cfc1f0b3a21786b1139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=mosh
pkgver=1.3.2
pkgrel=13
pkgdesc="Mobile shell surviving disconnects with local echo and line editing"
options="!check" # emulation-cursor-motion.test fails
url="https://mosh.org"
arch="all !mips64"
license="GPL-3.0-or-later"
depends="$pkgname-client $pkgname-server"
checkdepends="tmux perl"
makedepends="ncurses-dev zlib-dev openssl-dev perl-dev perl-io-tty
	protobuf-dev automake autoconf libtool gzip"
subpackages="$pkgname-doc $pkgname-client $pkgname-server
	$pkgname-bash-completion:bashcomp:noarch"
source="https://mosh.org/$pkgname-$pkgver.tar.gz
	fix-ppc64le-build-with-musl.patch"

builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	default_prepare
	# Test unicode-later-combining is failing. Ideally we want to fix it.
	sed -i '/unicode-later-combining.test/d' "$builddir"/src/tests/Makefile.am
	cd "$builddir"
	./autogen.sh
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-compile-warnings=error \
		--enable-examples
	make
}

check() {
	cd "$builddir"
	make distcheck VERBOSE=1 V=1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm644 "$builddir"/conf/bash-completion/completions/mosh \
		"$subpkgdir"/usr/share/bash-completion/completions/$pkgname
}

server() {
	replaces="mosh"
	pkgdesc="Mosh server"
	depends=""
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/mosh-server \
		"$subpkgdir"/usr/bin/
}

client() {
	replaces="mosh"
	pkgdesc="Mosh client"
	depends="openssh-client perl-io-tty"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/mosh-client \
		"$subpkgdir"/usr/bin/
}

sha512sums="f400e8fe7ba2ab7362311fc12a00ec69587505f901988aeee500fc68d38a388218500a3f602111c883ff23a9d43572114fcf0a8bf505df203691e5b597615769  mosh-1.3.2.tar.gz
a276dde98a2dab63ad9c9c05468c55983a95f482878c5694713810b561eae1ea5618efc72431a17ee5b5014b12ee9709c6a8cbf582620294e7888cc837cd073c  fix-ppc64le-build-with-musl.patch"