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

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

repo=fzf
pkgname=$repo # for SLACKDESC

# [1] Master commit

# hash=
# MD5SUM=
# hash7=${hash#???????}; hash7=${hash%$hash7}
# PKGVER=0.17.5_2018.xx.xx_$hash7

# TARBALL=$pkgname-$hash.tar.gz
# SRC_URL=https://github.com/junegunn/$repo/archive/$hash.tar.gz

# [2] Official release

PKGVER=0.28.0
PKGARCH=x86_64
case $PKGARCH in
	i686) M=386 ;;
	x86_64) M=amd64 ;;
esac
TARBALL=$pkgname-$PKGVER.tar.gz
MD5SUM=5103c54dbe17da7a92ef113903dbf243
SRC_URL=https://github.com/junegunn/$pkgname/archive/$PKGVER.tar.gz
TARBALL_BIN=$pkgname-bin-$PKGVER.tar.gz
MD5SUM_BIN=e8e0859197d0997e27fc725ae474cd03
SRC_URL_BIN=https://github.com/junegunn/fzf/releases/download/$PKGVER/fzf-$PKGVER-linux_$M.tar.gz

PKGBUILD=1
BUNDLE=

SLACKREQ=''
SLACKDESC="$pkgname: $pkgname $PKGVER $hash7 (command-line finder)
$pkgname: fzf is a general-purpose, cross-platform command-line fuzzy finder.
$pkgname:
$pkgname: This package installs system-wide just the fzf binary and its manual without
$pkgname: modifying your shell configuration. Configuration scripts are available in
$pkgname: /usr/share/fzf for you to personalize your shell as you see fit.
$pkgname:
$pkgname:
$pkgname: License: MIT
$pkgname:
$pkgname: home page: https://github.com/juengunn/fzf
"

### default pkg_download
pkg_prepare() {
	# Download & unpack source
	pkg_prepare_default &&
	# Download & unpack fzf binary
	SRC_URL="$SRC_URL_BIN" TARBALL="$TARBALL_BIN" MD5SUM="$MD5SUM_BIN" pkg_prepare_default
}
### default pkg_package
### build
pkg_build() {
	cd /tmp/$pkgname-* &&
	install -m755 -Dt /usr/bin ../fzf bin/* &&
	install -m644 -Dt /usr/share/man/man1 man/man1/* &&
	install -m644 -Dt /usr/share/fzf install uninstall README.* LICENSE &&
	install -m644 -Dt /usr/share/fzf/plugin plugin/* &&
	install -m644 -Dt /usr/share/fzf/shell shell/* &&
	pkg_build_slackdesc
}

# vim:ft=sh:

