# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=tmux
pkgver=2.6
pkgrel=0
pkgdesc="Tool to control multiple terminals from a single terminal"
url="https://tmux.github.io/"
arch="all"
license="BSD"
depends="ncurses-terminfo"
makedepends="ncurses-dev libevent-dev autoconf automake bsd-compat-headers"
install=
subpackages="$pkgname-doc"
source="https://github.com/tmux/tmux/releases/download/$pkgver/$pkgname-$pkgver.tar.gz"

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

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

check() {
	cd "$builddir"
	make check
}

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

	install -Dm644 example_tmux.conf \
		"$pkgdir"/usr/share/doc/$pkgname/examples/$pkgname.conf
	for file in CHANGES README TODO; do
		install -m644 "$file" "$pkgdir"/usr/share/doc/$pkgname/
	done
}

sha512sums="20a1ae8b8494c5b42757902322f3877731c2cc330c9c00f097a317785d25252b7ebaa8bbab9fc17843299e80cb2914aaac0a664715a85c50f7ea489d23753832  tmux-2.6.tar.gz"
