### this file is sourced not run
## source: step

# Build [1] master commit or [2] official release

repo=tmux
pkgname=$repo # for SLACKDESC

# [1] Master commit
# hash=5a7cf897f266345635c6adeca20c9bb90dbe1e2f
# MD5SUM=b5f00377e36ba3d6f2e43a6fec18895c

# hash7=${hash#???????}; hash7=${hash%$hash7}
# PKGVER=2.7_2018.10.01_$hash7
# TARBALL=$pkgname-$hash.tar.gz
# SRC_URL=https://github.com/tmux/$repo/archive/$hash.tar.gz

# [2] Official release

#MD5SUM=bcdfcf910c94c3e02ce6b1c035880306
#PKGVER=2.7
MD5SUM=ee3ccee391a25d4f2c645c94cde2c144
PKGVER=3.0a
TARBALL=$pkgname-$PKGVER.tar.gz
SRC_URL=https://github.com/$pkgname/$pkgname/releases/download/$PKGVER/$TARBALL

# --- common ---

PKGARCH=x86_64
PKGBUILD=1
BUNDLE=

SLACKREQ='libevent libncurses'
SLACKDESC="$pkgname: $pkgname $PKGVER (terminal mux)
$pkgname: tmux is a terminal multiplexer, it enables a number of terminals
$pkgname: (or windows) to be accessed and controlled from a single terminal.
$pkgname: It is an alternative to programs such as GNU screen.
$pkgname: 
$pkgname: 
$pkgname: License: BSD
$pkgname: 
$pkgname: 
$pkgname: https://github.com/tmux/tmux
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/$pkgname-${hash:-$PKGVER} &&
	if [ "$hash" ]; then
		sed -e "s@AC_INIT(tmux, master)@AC_INIT(tmux, ${PKGVER//_/ })@" -i configure.ac
	fi
}
### build
pkg_build() {
	export MAKE="make $MAKEFLAGS"
	cd tmp/$pkgname-${hash:-$PKGVER} &&
	if [ "$hash" ]; then ./autogen.sh; fi &&
	./configure --prefix=/usr --libdir=/usr/lib64 &&
	make &&
	make PREFIX=/usr install INSTALLLIB=/usr/lib64 &&
	pkg_build_slackdesc &&
	cp -a ../pkg/install/* /install/
}

pkg_package() {
	# in $CHROOT_DIR
	: sample rm -r usr/local
}
# vim: fdm=marker ft=sh:
